From d55a70e1ea465daf6fb74f7d7c31b23f8e428327 Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Thu, 11 Dec 2025 00:22:06 +0100 Subject: [PATCH 1/8] fix: nullable is not respected if type: object #533 --- package.json | 10 +-- src/schema-parser/schema-utils.ts | 28 +++++-- tests/__snapshots__/extended.test.ts.snap | 74 +++++++++-------- tests/__snapshots__/simple.test.ts.snap | 74 +++++++++-------- .../__snapshots__/basic.test.ts.snap | 2 +- .../__snapshots__/basic.test.ts.snap | 44 ++++++++++ .../basic.test.ts | 35 ++++++++ .../schema.json | 80 +++++++++++++++++++ 8 files changed, 263 insertions(+), 84 deletions(-) create mode 100644 tests/spec/nullable-parent-with-nullable-children/__snapshots__/basic.test.ts.snap create mode 100644 tests/spec/nullable-parent-with-nullable-children/basic.test.ts create mode 100644 tests/spec/nullable-parent-with-nullable-children/schema.json diff --git a/package.json b/package.json index 5c8f4a04c..f673a612f 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,21 @@ "type": "module", "exports": { ".": { - "import": "./dist/index.js", + "import": "./dist/index.mjs", "require": "./dist/index.cjs" }, "./cli": { - "import": "./dist/cli.js", + "import": "./dist/cli.mjs", "require": "./dist/cli.cjs" }, "./package.json": "./package.json" }, "main": "./dist/index.cjs", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "types": "./dist/index.d.cts", "bin": { - "sta": "./dist/cli.js", - "swagger-typescript-api": "./dist/cli.js" + "sta": "./dist/cli.mjs", + "swagger-typescript-api": "./dist/cli.mjs" }, "files": [ "dist", diff --git a/src/schema-parser/schema-utils.ts b/src/schema-parser/schema-utils.ts index bf7614e33..2f76c1d5f 100644 --- a/src/schema-parser/schema-utils.ts +++ b/src/schema-parser/schema-utils.ts @@ -85,14 +85,26 @@ export class SchemaUtils { isNullMissingInType = (schema, type) => { const { nullable, type: schemaType } = schema || {}; - return ( - (nullable || - !!lodash.get(schema, "x-nullable") || - schemaType === this.config.Ts.Keyword.Null) && - typeof type === "string" && - !type.includes(` ${this.config.Ts.Keyword.Null}`) && - !type.includes(`${this.config.Ts.Keyword.Null} `) - ); + + // Check if schema indicates nullable + const isSchemaMarkedNullable = + nullable || + !!lodash.get(schema, "x-nullable") || + schemaType === this.config.Ts.Keyword.Null; + + if (!isSchemaMarkedNullable) return false; + if (typeof type !== "string") return false; + + // Only check for root-level null in union types + // Match patterns: "... | null" or "null | ..." at the root level + // This avoids false positives from nested nullable properties like { prop: string | null } + const nullKeyword = this.config.Ts.Keyword.Null; + const hasRootLevelNull = + type.trim() === nullKeyword || + new RegExp(`\\|\\s*${nullKeyword}\\s*$`).test(type) || // Ends with | null + new RegExp(`^\\s*${nullKeyword}\\s*\\|`).test(type); // Starts with null | + + return !hasRootLevelNull; }; safeAddNullToType = (schema, type) => { diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index e95bc232a..c11fc422e 100644 --- a/tests/__snapshots__/extended.test.ts.snap +++ b/tests/__snapshots__/extended.test.ts.snap @@ -15814,17 +15814,19 @@ export enum CodeScanningAlertDismissedReasonEnum { /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ export type CodeScanningAlertEnvironment = string; -export type CodeScanningAlertInstances = { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key?: CodeScanningAnalysisAnalysisKey; - /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ - environment?: CodeScanningAlertEnvironment; - matrix_vars?: string | null; - /** The full Git reference, formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** State of a code scanning alert. */ - state?: CodeScanningAlertState; -}[]; +export type CodeScanningAlertInstances = + | { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key?: CodeScanningAnalysisAnalysisKey; + /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ + environment?: CodeScanningAlertEnvironment; + matrix_vars?: string | null; + /** The full Git reference, formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** State of a code scanning alert. */ + state?: CodeScanningAlertState; + }[] + | null; /** The full Git reference, formatted as \`refs/heads/\`. */ export type CodeScanningAlertRef = string; @@ -18696,26 +18698,28 @@ export interface GistsUpdateParams { gistId: string; } -export type GistsUpdatePayload = null & { - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} - */ - files?: Record< - string, - (object | null) & { - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } - >; -}; +export type GistsUpdatePayload = null & + ({ + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; + } | null); /** * Git Commit @@ -21629,7 +21633,7 @@ export interface MarketplacePurchase { /** Marketplace Listing Plan */ plan?: MarketplaceListingPlan; unit_count?: number | null; - }; + } | null; marketplace_purchase: { billing_cycle?: string; free_trial_ends_on?: string | null; @@ -25078,7 +25082,7 @@ export interface PullRequest { spdx_id: string | null; /** @format uri */ url: string | null; - }; + } | null; master_branch?: string; /** @format uri */ merges_url: string; @@ -31278,7 +31282,7 @@ export type SimpleUser = { * @example "https://api.github.com/users/octocat" */ url: string; -}; +} | null; /** * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. @@ -32356,7 +32360,7 @@ export type TeamSimple = { * @example "https://api.github.com/organizations/1/team/1" */ url: string; -}; +} | null; export type TeamsAddMemberLegacyData = any; diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 710b23008..dcb8b8168 100644 --- a/tests/__snapshots__/simple.test.ts.snap +++ b/tests/__snapshots__/simple.test.ts.snap @@ -9534,17 +9534,19 @@ export type CodeScanningAlertDismissedReason = /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ export type CodeScanningAlertEnvironment = string; -export type CodeScanningAlertInstances = { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key?: CodeScanningAnalysisAnalysisKey; - /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ - environment?: CodeScanningAlertEnvironment; - matrix_vars?: string | null; - /** The full Git reference, formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** State of a code scanning alert. */ - state?: CodeScanningAlertState; -}[]; +export type CodeScanningAlertInstances = + | { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key?: CodeScanningAnalysisAnalysisKey; + /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ + environment?: CodeScanningAlertEnvironment; + matrix_vars?: string | null; + /** The full Git reference, formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** State of a code scanning alert. */ + state?: CodeScanningAlertState; + }[] + | null; /** The full Git reference, formatted as \`refs/heads/\`. */ export type CodeScanningAlertRef = string; @@ -12595,7 +12597,7 @@ export interface MarketplacePurchase { /** Marketplace Listing Plan */ plan?: MarketplaceListingPlan; unit_count?: number | null; - }; + } | null; marketplace_purchase: { billing_cycle?: string; free_trial_ends_on?: string | null; @@ -14084,7 +14086,7 @@ export interface PullRequest { spdx_id: string | null; /** @format uri */ url: string | null; - }; + } | null; master_branch?: string; /** @format uri */ merges_url: string; @@ -16031,7 +16033,7 @@ export type SimpleUser = { * @example "https://api.github.com/users/octocat" */ url: string; -}; +} | null; /** * Stargazer @@ -16739,7 +16741,7 @@ export type TeamSimple = { * @example "https://api.github.com/organizations/1/team/1" */ url: string; -}; +} | null; /** * Thread @@ -19479,26 +19481,28 @@ export class Api< */ gistsUpdate: ( gistId: string, - data: null & { - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} - */ - files?: Record< - string, - (object | null) & { - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } - >; - }, + data: null & + ({ + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; + } | null), params: RequestParams = {}, ) => this.request({ diff --git a/tests/spec/additional-properties-2.0/__snapshots__/basic.test.ts.snap b/tests/spec/additional-properties-2.0/__snapshots__/basic.test.ts.snap index 1c17d1cea..cf6930535 100644 --- a/tests/spec/additional-properties-2.0/__snapshots__/basic.test.ts.snap +++ b/tests/spec/additional-properties-2.0/__snapshots__/basic.test.ts.snap @@ -33,7 +33,7 @@ export type MyObject4 = Record< { content?: string; filename?: string | null; - } + } | null >; " `; diff --git a/tests/spec/nullable-parent-with-nullable-children/__snapshots__/basic.test.ts.snap b/tests/spec/nullable-parent-with-nullable-children/__snapshots__/basic.test.ts.snap new file mode 100644 index 000000000..8813db8af --- /dev/null +++ b/tests/spec/nullable-parent-with-nullable-children/__snapshots__/basic.test.ts.snap @@ -0,0 +1,44 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`nullable-parent-with-nullable-children > nullable parent object with nullable child properties 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** A nullable user object with nullable email property */ +export type UserWithNullableEmail = { + id: string; + email?: string | null; + name?: string | null; +} | null; + +/** A nullable profile with all nullable properties */ +export type Profile = { + bio?: string | null; + avatar?: string | null; + age?: number | null; +} | null; + +export interface NestedNullableObject { + outerField: string; + innerObject?: { + innerField?: string | null; + } | null; +} + +export interface Container { + /** A nullable user object with nullable email property */ + user?: UserWithNullableEmail; + /** A nullable profile with all nullable properties */ + profile?: Profile; +} +" +`; diff --git a/tests/spec/nullable-parent-with-nullable-children/basic.test.ts b/tests/spec/nullable-parent-with-nullable-children/basic.test.ts new file mode 100644 index 000000000..8a38a795c --- /dev/null +++ b/tests/spec/nullable-parent-with-nullable-children/basic.test.ts @@ -0,0 +1,35 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterAll, beforeAll, describe, expect, test } from "vitest"; +import { generateApi } from "../../../src/index.js"; + +describe("nullable-parent-with-nullable-children", async () => { + let tmpdir = ""; + + beforeAll(async () => { + tmpdir = await fs.mkdtemp( + path.join(os.tmpdir(), "swagger-typescript-api"), + ); + }); + + afterAll(async () => { + await fs.rm(tmpdir, { recursive: true }); + }); + + test("nullable parent object with nullable child properties", async () => { + await generateApi({ + fileName: "schema", + input: path.resolve(import.meta.dirname, "schema.json"), + output: tmpdir, + silent: true, + generateClient: false, + }); + + const content = await fs.readFile(path.join(tmpdir, "schema.ts"), { + encoding: "utf8", + }); + + expect(content).toMatchSnapshot(); + }); +}); diff --git a/tests/spec/nullable-parent-with-nullable-children/schema.json b/tests/spec/nullable-parent-with-nullable-children/schema.json new file mode 100644 index 000000000..90d245b8d --- /dev/null +++ b/tests/spec/nullable-parent-with-nullable-children/schema.json @@ -0,0 +1,80 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Nullable Parent with Nullable Children Test", + "version": "1.0.0" + }, + "paths": {}, + "components": { + "schemas": { + "UserWithNullableEmail": { + "type": "object", + "nullable": true, + "description": "A nullable user object with nullable email property", + "properties": { + "id": { + "type": "string" + }, + "email": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": ["id"] + }, + "Profile": { + "type": "object", + "nullable": true, + "description": "A nullable profile with all nullable properties", + "properties": { + "bio": { + "type": "string", + "nullable": true + }, + "avatar": { + "type": "string", + "nullable": true + }, + "age": { + "type": "integer", + "nullable": true + } + } + }, + "NestedNullableObject": { + "type": "object", + "properties": { + "outerField": { + "type": "string" + }, + "innerObject": { + "type": "object", + "nullable": true, + "properties": { + "innerField": { + "type": "string", + "nullable": true + } + } + } + }, + "required": ["outerField"] + }, + "Container": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/UserWithNullableEmail" + }, + "profile": { + "$ref": "#/components/schemas/Profile" + } + } + } + } + } +} From 6c08c87858859bdae788ca6e3777063b9c3055df Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Thu, 11 Dec 2025 00:36:33 +0100 Subject: [PATCH 2/8] fix: yarn immutable check issue --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f673a612f..5c8f4a04c 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,21 @@ "type": "module", "exports": { ".": { - "import": "./dist/index.mjs", + "import": "./dist/index.js", "require": "./dist/index.cjs" }, "./cli": { - "import": "./dist/cli.mjs", + "import": "./dist/cli.js", "require": "./dist/cli.cjs" }, "./package.json": "./package.json" }, "main": "./dist/index.cjs", - "module": "./dist/index.mjs", + "module": "./dist/index.js", "types": "./dist/index.d.cts", "bin": { - "sta": "./dist/cli.mjs", - "swagger-typescript-api": "./dist/cli.mjs" + "sta": "./dist/cli.js", + "swagger-typescript-api": "./dist/cli.js" }, "files": [ "dist", From 4bddc9c589ac23668b9665271b8e9bb7069f03e2 Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Thu, 11 Dec 2025 00:38:52 +0100 Subject: [PATCH 3/8] fix: lint issue --- .../spec/nullable-parent-with-nullable-children/basic.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/spec/nullable-parent-with-nullable-children/basic.test.ts b/tests/spec/nullable-parent-with-nullable-children/basic.test.ts index 8a38a795c..3a73d711e 100644 --- a/tests/spec/nullable-parent-with-nullable-children/basic.test.ts +++ b/tests/spec/nullable-parent-with-nullable-children/basic.test.ts @@ -8,9 +8,7 @@ describe("nullable-parent-with-nullable-children", async () => { let tmpdir = ""; beforeAll(async () => { - tmpdir = await fs.mkdtemp( - path.join(os.tmpdir(), "swagger-typescript-api"), - ); + tmpdir = await fs.mkdtemp(path.join(os.tmpdir(), "swagger-typescript-api")); }); afterAll(async () => { From 6db96156cd5b5e1c6cac7cba35f7762efb777c63 Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Thu, 11 Dec 2025 00:46:11 +0100 Subject: [PATCH 4/8] fix: adding changeset --- .changeset/giant-hats-work.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/giant-hats-work.md diff --git a/.changeset/giant-hats-work.md b/.changeset/giant-hats-work.md new file mode 100644 index 000000000..4db4d2860 --- /dev/null +++ b/.changeset/giant-hats-work.md @@ -0,0 +1,5 @@ +--- +"swagger-typescript-api": patch +--- + +Fixed incorrect null handling for nullable objects with nullable properties (#533) From 0fb029ee6a81eb9f79a73891c2f4b9dcc0eeaecc Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Sun, 14 Dec 2025 19:01:56 +0100 Subject: [PATCH 5/8] fix: Missing detection of null in middle of unions --- src/schema-parser/schema-utils.ts | 9 +- .../__snapshots__/basic.test.ts.snap | 33 +++++++ .../spec/nullable-union-middle/basic.test.ts | 33 +++++++ tests/spec/nullable-union-middle/schema.json | 91 +++++++++++++++++++ 4 files changed, 161 insertions(+), 5 deletions(-) create mode 100644 tests/spec/nullable-union-middle/__snapshots__/basic.test.ts.snap create mode 100644 tests/spec/nullable-union-middle/basic.test.ts create mode 100644 tests/spec/nullable-union-middle/schema.json diff --git a/src/schema-parser/schema-utils.ts b/src/schema-parser/schema-utils.ts index 2f76c1d5f..05a2ff09a 100644 --- a/src/schema-parser/schema-utils.ts +++ b/src/schema-parser/schema-utils.ts @@ -96,13 +96,12 @@ export class SchemaUtils { if (typeof type !== "string") return false; // Only check for root-level null in union types - // Match patterns: "... | null" or "null | ..." at the root level + // Match null bounded by pipes and/or start/end of string // This avoids false positives from nested nullable properties like { prop: string | null } const nullKeyword = this.config.Ts.Keyword.Null; - const hasRootLevelNull = - type.trim() === nullKeyword || - new RegExp(`\\|\\s*${nullKeyword}\\s*$`).test(type) || // Ends with | null - new RegExp(`^\\s*${nullKeyword}\\s*\\|`).test(type); // Starts with null | + const hasRootLevelNull = new RegExp( + `(^|\\|)\\s*${nullKeyword}\\s*(\\||$)` + ).test(type); return !hasRootLevelNull; }; diff --git a/tests/spec/nullable-union-middle/__snapshots__/basic.test.ts.snap b/tests/spec/nullable-union-middle/__snapshots__/basic.test.ts.snap new file mode 100644 index 000000000..82e082fe2 --- /dev/null +++ b/tests/spec/nullable-union-middle/__snapshots__/basic.test.ts.snap @@ -0,0 +1,33 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`nullable-union-middle > nullable unions with null in middle position 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** A union type where null appears in the middle: string | null | number */ +export type StringNullOrNumber = string | null | number; + +/** A union type where null appears between object and array */ +export type ObjectNullOrArray = + | { + id?: string; + } + | null + | string[]; + +export interface MultipleNullPositions { + nullAtStart?: null | string; + nullInMiddle?: string | null | number; + nullAtEnd?: string | null; +} +" +`; diff --git a/tests/spec/nullable-union-middle/basic.test.ts b/tests/spec/nullable-union-middle/basic.test.ts new file mode 100644 index 000000000..1328d2df8 --- /dev/null +++ b/tests/spec/nullable-union-middle/basic.test.ts @@ -0,0 +1,33 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterAll, beforeAll, describe, expect, test } from "vitest"; +import { generateApi } from "../../../src/index.js"; + +describe("nullable-union-middle", async () => { + let tmpdir = ""; + + beforeAll(async () => { + tmpdir = await fs.mkdtemp(path.join(os.tmpdir(), "swagger-typescript-api")); + }); + + afterAll(async () => { + await fs.rm(tmpdir, { recursive: true }); + }); + + test("nullable unions with null in middle position", async () => { + await generateApi({ + fileName: "schema", + input: path.resolve(import.meta.dirname, "schema.json"), + output: tmpdir, + silent: true, + generateClient: false, + }); + + const content = await fs.readFile(path.join(tmpdir, "schema.ts"), { + encoding: "utf8", + }); + + expect(content).toMatchSnapshot(); + }); +}); diff --git a/tests/spec/nullable-union-middle/schema.json b/tests/spec/nullable-union-middle/schema.json new file mode 100644 index 000000000..b7b21bb0a --- /dev/null +++ b/tests/spec/nullable-union-middle/schema.json @@ -0,0 +1,91 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Nullable Union with Null in Middle Test", + "version": "1.0.0" + }, + "paths": {}, + "components": { + "schemas": { + "StringNullOrNumber": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "type": "number" + } + ], + "nullable": true, + "description": "A union type where null appears in the middle: string | null | number" + }, + "ObjectNullOrArray": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + { + "type": "null" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "nullable": true, + "description": "A union type where null appears between object and array" + }, + "MultipleNullPositions": { + "type": "object", + "properties": { + "nullAtStart": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ], + "nullable": true + }, + "nullInMiddle": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "type": "number" + } + ], + "nullable": true + }, + "nullAtEnd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "nullable": true + } + } + } + } + } +} From 62b1ac835f2f36bad24897c333f06c5f7262b7e6 Mon Sep 17 00:00:00 2001 From: Adam Banky Date: Sun, 14 Dec 2025 19:03:50 +0100 Subject: [PATCH 6/8] fix: lint issue --- src/schema-parser/schema-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema-parser/schema-utils.ts b/src/schema-parser/schema-utils.ts index 05a2ff09a..706577bcf 100644 --- a/src/schema-parser/schema-utils.ts +++ b/src/schema-parser/schema-utils.ts @@ -100,7 +100,7 @@ export class SchemaUtils { // This avoids false positives from nested nullable properties like { prop: string | null } const nullKeyword = this.config.Ts.Keyword.Null; const hasRootLevelNull = new RegExp( - `(^|\\|)\\s*${nullKeyword}\\s*(\\||$)` + `(^|\\|)\\s*${nullKeyword}\\s*(\\||$)`, ).test(type); return !hasRootLevelNull; From 252b994ecd9012c8414e52bc67af2daebfc4d18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20B=C3=A1nky?= Date: Thu, 7 May 2026 17:30:11 +0200 Subject: [PATCH 7/8] fix: handle parenthesized union types in null detection After merging upstream/main, the regex in isNullMissingInType failed to detect root-level null in types wrapped by ExpressionGroup (e.g. "(null | string)"), causing double-wrapping into "(null | string) | null". Treat "(" and ")" as boundaries equivalent to start/end and pipes. Updates full-swagger-scheme snapshots to reflect the de-duplicated nullable wrapping. --- src/schema-parser/schema-utils.ts | 2 +- tests/__snapshots__/extended.test.ts.snap | 895 +++++++++++++++++++++- tests/__snapshots__/simple.test.ts.snap | 733 +++++++++++++++++- 3 files changed, 1584 insertions(+), 46 deletions(-) diff --git a/src/schema-parser/schema-utils.ts b/src/schema-parser/schema-utils.ts index 1cc98a3b2..9ad326a69 100644 --- a/src/schema-parser/schema-utils.ts +++ b/src/schema-parser/schema-utils.ts @@ -161,7 +161,7 @@ export class SchemaUtils { const nullKeyword = this.config.Ts.Keyword.Null; const hasRootLevelNull = new RegExp( - `(^|\\|)\\s*${nullKeyword}\\s*(\\||$)`, + `(^|\\||\\()\\s*${nullKeyword}\\s*(\\||\\)|$)`, ).test(type); return !hasRootLevelNull; diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index 33b354acc..5ca4a2a7d 100644 --- a/tests/__snapshots__/extended.test.ts.snap +++ b/tests/__snapshots__/extended.test.ts.snap @@ -18661,28 +18661,27 @@ export interface GistsUpdateParams { gistId: string; } -export type GistsUpdatePayload = null & - ({ - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} - */ - files?: Record< - string, - (object | null) & - ({ - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } | null) - >; - } | null); +export type GistsUpdatePayload = null & { + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; +}; /** * Git Commit @@ -67360,6 +67359,296 @@ export class Api< " `; +exports[`extended > 'issue-1057' 2`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface MySchema { + not_working?: MySchemaNotWorkingEnum; + working?: MySchemaWorkingEnum; +} + +export enum MySchemaNotWorkingEnum { + PhoneNumber = "phone_number", +} + +export enum MySchemaWorkingEnum { + EmailAddress = "email_address", +} + +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< + FullRequestParams, + "body" | "method" | "query" | "path" +>; + +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", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = ""; + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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 No title + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} +" +`; + exports[`extended > 'link-example' 1`] = ` "/* eslint-disable */ /* tslint:disable */ @@ -67922,6 +68211,568 @@ export class Api< " `; +exports[`extended > 'link-example' 2`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export type GetPullRequestsByIdData = Pullrequest; + +export interface GetPullRequestsByIdParams { + pid: string; + slug: string; + username: string; +} + +export type GetPullRequestsByRepositoryData = Pullrequest[]; + +export interface GetPullRequestsByRepositoryParams { + slug: string; + state?: StateEnum; + username: string; +} + +export enum GetPullRequestsByRepositoryParams1StateEnum { + Open = "open", + Merged = "merged", + Declined = "declined", +} + +export type GetRepositoriesByOwnerData = Repository[]; + +export interface GetRepositoriesByOwnerParams { + username: string; +} + +export type GetRepositoryData = Repository; + +export interface GetRepositoryParams { + slug: string; + username: string; +} + +export type GetUserByNameData = User; + +export interface GetUserByNameParams { + username: string; +} + +export type MergePullRequestData = any; + +export interface MergePullRequestParams { + pid: string; + slug: string; + username: string; +} + +export interface Pullrequest { + author?: User; + id?: number; + repository?: Repository; + title?: string; +} + +export interface Repository { + owner?: User; + slug?: string; +} + +export enum StateEnum { + Open = "open", + Merged = "merged", + Declined = "declined", +} + +export interface User { + username?: string; + uuid?: string; +} + +export namespace V20 { + /** + * No description + * @name GetPullRequestsById + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} + * @link \`200.pullRequestMerge\` operationId:mergePullRequest + */ + export namespace GetPullRequestsById { + export type RequestParams = { + pid: string; + slug: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetPullRequestsByIdData; + } + + /** + * No description + * @name GetPullRequestsByRepository + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests + */ + export namespace GetPullRequestsByRepository { + export type RequestParams = { + slug: string; + username: string; + }; + export type RequestQuery = { + state?: GetPullRequestsByRepositoryParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetPullRequestsByRepositoryData; + } + + /** + * No description + * @name GetRepositoriesByOwner + * @request GET:/2.0/repositories/{username} + * @link \`200.userRepository\` operationId:getRepository + */ + export namespace GetRepositoriesByOwner { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetRepositoriesByOwnerData; + } + + /** + * No description + * @name GetRepository + * @request GET:/2.0/repositories/{username}/{slug} + * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository + */ + export namespace GetRepository { + export type RequestParams = { + slug: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetRepositoryData; + } + + /** + * No description + * @name GetUserByName + * @request GET:/2.0/users/{username} + * @link \`200.userRepositories\` operationId:getRepositoriesByOwner + */ + export namespace GetUserByName { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetUserByNameData; + } + + /** + * No description + * @name MergePullRequest + * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge + */ + export namespace MergePullRequest { + export type RequestParams = { + pid: string; + slug: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MergePullRequestData; + } +} + +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< + FullRequestParams, + "body" | "method" | "query" | "path" +>; + +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", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = ""; + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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 Link Example + * @version 1.0.0 + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + v20 = { + /** + * No description + * + * @name GetPullRequestsById + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} + * @link \`200.pullRequestMerge\` operationId:mergePullRequest + */ + getPullRequestsById: ( + { username, slug, pid }: GetPullRequestsByIdParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetPullRequestsByRepository + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests + */ + getPullRequestsByRepository: ( + { username, slug, ...query }: GetPullRequestsByRepositoryParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetRepositoriesByOwner + * @request GET:/2.0/repositories/{username} + * @link \`200.userRepository\` operationId:getRepository + */ + getRepositoriesByOwner: ( + { username }: GetRepositoriesByOwnerParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetRepository + * @request GET:/2.0/repositories/{username}/{slug} + * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository + */ + getRepository: ( + { username, slug }: GetRepositoryParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetUserByName + * @request GET:/2.0/users/{username} + * @link \`200.userRepositories\` operationId:getRepositoriesByOwner + */ + getUserByName: ( + { username }: GetUserByNameParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/users/\${username}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name MergePullRequest + * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge + */ + mergePullRequest: ( + { username, slug, pid }: MergePullRequestParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, + method: "POST", + ...params, + }), + }; +} +" +`; + exports[`extended > 'no-definitions-schema' 1`] = ` "/* eslint-disable */ /* tslint:disable */ diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 587ba27e0..2b89a9112 100644 --- a/tests/__snapshots__/simple.test.ts.snap +++ b/tests/__snapshots__/simple.test.ts.snap @@ -19481,28 +19481,27 @@ export class Api< */ gistsUpdate: ( gistId: string, - data: null & - ({ - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} - */ - files?: Record< - string, - (object | null) & - ({ - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } | null) - >; - } | null), + data: null & { + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; + }, params: RequestParams = {}, ) => this.request({ @@ -39856,7 +39855,695 @@ export class Api< " `; -exports[`simple > 'link-example' 1`] = ` +exports[`simple > 'issue-1057' 2`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface MySchema { + not_working?: "phone_number"; + working?: "email_address"; +} + +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< + FullRequestParams, + "body" | "method" | "query" | "path" +>; + +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", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = ""; + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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 No title + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} +" +`; + +exports[`simple > 'link-example' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface Pullrequest { + author?: User; + id?: number; + repository?: Repository; + title?: string; +} + +export interface Repository { + owner?: User; + slug?: string; +} + +export interface User { + username?: string; + uuid?: 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< + FullRequestParams, + "body" | "method" | "query" | "path" +>; + +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", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = ""; + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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 Link Example + * @version 1.0.0 + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + v20 = { + /** + * No description + * + * @name GetUserByName + * @request GET:/2.0/users/{username} + * @link \`200.userRepositories\` operationId:getRepositoriesByOwner + */ + getUserByName: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/2.0/users/\${username}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetRepositoriesByOwner + * @request GET:/2.0/repositories/{username} + * @link \`200.userRepository\` operationId:getRepository + */ + getRepositoriesByOwner: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/2.0/repositories/\${username}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetRepository + * @request GET:/2.0/repositories/{username}/{slug} + * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository + */ + getRepository: ( + username: string, + slug: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetPullRequestsByRepository + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests + */ + getPullRequestsByRepository: ( + username: string, + slug: string, + query?: { + state?: "open" | "merged" | "declined"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetPullRequestsById + * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} + * @link \`200.pullRequestMerge\` operationId:mergePullRequest + */ + getPullRequestsById: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @name MergePullRequest + * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge + */ + mergePullRequest: ( + username: string, + slug: string, + pid: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, + method: "POST", + ...params, + }), + }; +} +" +`; + +exports[`simple > 'link-example' 2`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck From 97fb41cba1eae1fe0d2feb5432e014ad82f3123f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20B=C3=A1nky?= Date: Thu, 7 May 2026 17:40:21 +0200 Subject: [PATCH 8/8] test: regenerate snapshots after vitest key format change --- tests/__snapshots__/extended.test.ts.snap | 81346 ++++++++++---------- tests/__snapshots__/simple.test.ts.snap | 45894 ++++++----- 2 files changed, 62850 insertions(+), 64390 deletions(-) diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index 5ca4a2a7d..3e6f6d1fc 100644 --- a/tests/__snapshots__/extended.test.ts.snap +++ b/tests/__snapshots__/extended.test.ts.snap @@ -12020,7 +12020,7 @@ export class Api< " `; -exports[`extended > 'full-swagger-scheme' 1`] = ` +exports[`extended > 'furkot-example' 1`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -12033,2032 +12033,2544 @@ exports[`extended > 'full-swagger-scheme' 1`] = ` * --------------------------------------------------------------- */ -export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData = any; - -export interface ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams { - org: string; - repositoryId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} - -export type ActionsAddSelectedRepoToOrgSecretData = any; - -export interface ActionsAddSelectedRepoToOrgSecretParams { - org: string; - repositoryId: number; - /** secret_name parameter */ - secretName: string; -} - -export type ActionsAddSelfHostedRunnerToGroupForOrgData = any; - -export interface ActionsAddSelfHostedRunnerToGroupForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; -} - -export interface ActionsBillingUsage { - /** The amount of free GitHub Actions minutes available. */ - included_minutes: number; - minutes_used_breakdown: { - /** Total minutes used on macOS runner machines. */ - MACOS?: number; - /** Total minutes used on Ubuntu runner machines. */ - UBUNTU?: number; - /** Total minutes used on Windows runner machines. */ - WINDOWS?: number; +export interface Step { + /** address of the stop */ + address?: string; + /** + * arrival at the stop in its local timezone as YYYY-MM-DDThh:mm + * @format date-time + */ + arrival?: string; + /** geographical coordinates of the stop */ + coordinates?: { + /** + * latitude + * @format float + */ + lat?: number; + /** + * longitude + * @format float + */ + lon?: number; }; - /** The sum of the free and paid GitHub Actions minutes used. */ - total_minutes_used: number; - /** The total paid GitHub Actions minutes used. */ - total_paid_minutes_used: number; + /** + * departure from the stop in its local timezone as YYYY-MM-DDThh:mm + * @format date-time + */ + departure?: string; + /** name of the stop */ + name?: string; + /** + * number of nights + * @format int64 + */ + nights?: number; + /** route leading to the stop */ + route?: { + /** + * route distance in meters + * @format int64 + */ + distance?: number; + /** + * route duration in seconds + * @format int64 + */ + duration?: number; + /** travel mode */ + mode?: StepModeEnum; + /** route path compatible with Google polyline encoding algorithm */ + polyline?: string; + }; + /** url of the page with more information about the stop */ + url?: string; } -export type ActionsCancelWorkflowRunData = any; - -export interface ActionsCancelWorkflowRunParams { - owner: string; - repo: string; - runId: number; +/** travel mode */ +export enum StepModeEnum { + Car = "car", + Motorcycle = "motorcycle", + Bicycle = "bicycle", + Walk = "walk", + Other = "other", } -export type ActionsCreateOrUpdateOrgSecretData = any; +export type StopListData = Step[]; -export interface ActionsCreateOrUpdateOrgSecretParams { - org: string; - /** secret_name parameter */ - secretName: string; +export interface StopListParams { + /** id of the trip */ + tripId: string; } -export interface ActionsCreateOrUpdateOrgSecretPayload { - /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. */ - encrypted_value?: string; - /** ID of the key you used to encrypt the secret. */ - key_id?: string; - /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ - selected_repository_ids?: string[]; +export interface Trip { /** - * Configures the access that repositories have to the organization secret. Can be one of: - * \\- \`all\` - All repositories in an organization can access the secret. - * \\- \`private\` - Private repositories in an organization can access the secret. - * \\- \`selected\` - Only specific repositories can access the secret. + * begin of the trip in its local timezone as YYYY-MM-DDThh:mm + * @format date-time */ - visibility?: ActionsCreateOrUpdateOrgSecretVisibilityEnum; + begin?: string; + /** description of the trip (truncated to 200 characters) */ + description?: string; + /** + * end of the trip in its local timezone as YYYY-MM-DDThh:mm + * @format date-time + */ + end?: string; + /** Unique ID of the trip */ + id?: string; + /** name of the trip */ + name?: string; } -/** - * Configures the access that repositories have to the organization secret. Can be one of: - * \\- \`all\` - All repositories in an organization can access the secret. - * \\- \`private\` - Private repositories in an organization can access the secret. - * \\- \`selected\` - Only specific repositories can access the secret. - */ -export enum ActionsCreateOrUpdateOrgSecretVisibilityEnum { - All = "all", - Private = "private", - Selected = "selected", -} +export type TripListData = Trip[]; -export type ActionsCreateOrUpdateRepoSecretData = any; +export namespace Trip { + /** + * @description list stops for a trip identified by {trip_id} + * @name StopList + * @request GET:/trip/{trip_id}/stop + * @secure + */ + export namespace StopList { + export type RequestParams = { + /** id of the trip */ + tripId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = StopListData; + } -export interface ActionsCreateOrUpdateRepoSecretParams { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + /** + * @description list user's trips + * @name TripList + * @request GET:/trip + * @secure + */ + export namespace TripList { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TripListData; + } } -export interface ActionsCreateOrUpdateRepoSecretPayload { - /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. */ - encrypted_value?: string; - /** ID of the key you used to encrypt the secret. */ - key_id?: 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 ActionsCreateRegistrationTokenForOrgData = AuthenticationToken; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -export interface ActionsCreateRegistrationTokenForOrgParams { - org: string; +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; } -export type ActionsCreateRegistrationTokenForRepoData = AuthenticationToken; - -export interface ActionsCreateRegistrationTokenForRepoParams { - owner: string; - repo: string; +export interface HttpResponse + extends Response { + data: D; + error: E; } -export type ActionsCreateRemoveTokenForOrgData = AuthenticationToken; +type CancelToken = Symbol | string | number; -export interface ActionsCreateRemoveTokenForOrgParams { - org: string; +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", } -export type ActionsCreateRemoveTokenForRepoData = AuthenticationToken; +export class HttpClient { + public baseUrl: string = "https://trips.furkot.com/pub/api"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); -export interface ActionsCreateRemoveTokenForRepoParams { - owner: string; - repo: string; -} + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; -export type ActionsCreateSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } -export interface ActionsCreateSelfHostedRunnerGroupForOrgParams { - org: string; -} + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; -export interface ActionsCreateSelfHostedRunnerGroupForOrgPayload { - /** Name of the runner group. */ - name: string; - /** List of runner IDs to add to the runner group. */ - runners?: number[]; - /** List of repository IDs that can access the runner group. */ - selected_repository_ids?: number[]; - /** - * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. - * @default "all" - */ - visibility?: ActionsCreateSelfHostedRunnerGroupForOrgVisibilityEnum; -} + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } -/** - * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. - * @default "all" - */ -export enum ActionsCreateSelfHostedRunnerGroupForOrgVisibilityEnum { - Selected = "selected", - All = "all", - Private = "private", -} + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } -export type ActionsCreateWorkflowDispatchData = any; + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } -export interface ActionsCreateWorkflowDispatchParams { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; -} + 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("&"); + } -export interface ActionsCreateWorkflowDispatchPayload { - /** Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when \`inputs\` are omitted. */ - inputs?: Record; - /** The git reference for the workflow. The reference can be a branch or tag name. */ - ref: string; -} + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } -export type ActionsDeleteArtifactData = any; + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } -export interface ActionsDeleteArtifactParams { - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; -} + return 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), + }; -export type ActionsDeleteOrgSecretData = any; + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } -export interface ActionsDeleteOrgSecretParams { - org: string; - /** secret_name parameter */ - secretName: string; -} + 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; + } -export type ActionsDeleteRepoSecretData = any; + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; -export interface ActionsDeleteRepoSecretParams { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; -} + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); -export type ActionsDeleteSelfHostedRunnerFromOrgData = any; + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; -export interface ActionsDeleteSelfHostedRunnerFromOrgParams { - org: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; -} + 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; -export type ActionsDeleteSelfHostedRunnerFromRepoData = any; + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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; -export interface ActionsDeleteSelfHostedRunnerFromRepoParams { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; -} + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); -export type ActionsDeleteSelfHostedRunnerGroupFromOrgData = any; + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } -export interface ActionsDeleteSelfHostedRunnerGroupFromOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; + if (!response.ok) throw data; + return data; + }); + }; } -export type ActionsDeleteWorkflowRunData = any; - -export type ActionsDeleteWorkflowRunLogsData = any; - -export interface ActionsDeleteWorkflowRunLogsParams { - owner: string; - repo: string; - runId: number; -} +/** + * @title Furkot Trips + * @version 1.0.0 + * @baseUrl https://trips.furkot.com/pub/api + * @externalDocs https://help.furkot.com/widgets/furkot-api.html + * @contact + * + * Furkot provides Rest API to access user trip data. + * Using Furkot API an application can list user trips and display stops for a specific trip. + * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + trip = { + /** + * @description list stops for a trip identified by {trip_id} + * + * @name StopList + * @request GET:/trip/{trip_id}/stop + * @secure + */ + stopList: ({ tripId }: StopListParams, params: RequestParams = {}) => + this.request({ + path: \`/trip/\${tripId}/stop\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), -export interface ActionsDeleteWorkflowRunParams { - owner: string; - repo: string; - runId: number; + /** + * @description list user's trips + * + * @name TripList + * @request GET:/trip + * @secure + */ + tripList: (params: RequestParams = {}) => + this.request({ + path: \`/trip\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + }; } +" +`; -export type ActionsDisableSelectedRepositoryGithubActionsOrganizationData = any; +exports[`extended > 'giphy' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ -export interface ActionsDisableSelectedRepositoryGithubActionsOrganizationParams { - org: string; - repositoryId: number; -} +/** Your request was formatted incorrectly or missing required parameters. */ +export type BadRequest = any; -export type ActionsDisableWorkflowData = any; +/** You weren't authorized to make your request; most likely this indicates an issue with your API Key. */ +export type Forbidden = any; -export interface ActionsDisableWorkflowParams { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; +export interface GetGifByIdData { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; } -export interface ActionsDownloadArtifactParams { - archiveFormat: string; - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; +export interface GetGifByIdParams { + /** + * Filters results by specified GIF ID. + * @format int32 + */ + gifId: number; } -export interface ActionsDownloadJobLogsForWorkflowRunParams { - /** job_id parameter */ - jobId: number; - owner: string; - repo: string; +export interface GetGifsByIdData { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; } -export interface ActionsDownloadWorkflowRunLogsParams { - owner: string; - repo: string; - runId: number; +export interface GetGifsByIdParams { + /** Filters results by specified GIF IDs, separated by commas. */ + ids?: string; } -export type ActionsEnableSelectedRepositoryGithubActionsOrganizationData = any; - -export interface ActionsEnableSelectedRepositoryGithubActionsOrganizationParams { - org: string; - repositoryId: number; +export interface Gif { + /** + * The unique bit.ly URL for this GIF + * @example "http://gph.is/1gsWDcL" + */ + bitly_url?: string; + /** Currently unused */ + content_url?: string; + /** + * The date this GIF was added to the GIPHY database. + * @format date-time + * @example "2013-08-01 12:41:48" + */ + create_datetime?: string; + /** + * A URL used for embedding this GIF + * @example "http://giphy.com/embed/YsTs5ltWtEhnq" + */ + embded_url?: string; + /** An array of featured tags for this GIF (Note: Not available when using the Public Beta Key) */ + featured_tags?: string[]; + /** + * This GIF's unique ID + * @example "YsTs5ltWtEhnq" + */ + id?: string; + /** An object containing data for various available formats and sizes of this GIF. */ + images?: { + /** Data surrounding a version of this GIF downsized to be under 2mb. */ + downsized?: Image; + /** Data surrounding a version of this GIF downsized to be under 8mb. */ + downsized_large?: Image; + /** Data surrounding a version of this GIF downsized to be under 5mb. */ + downsized_medium?: Image; + /** Data surrounding a version of this GIF downsized to be under 200kb. */ + downsized_small?: Image; + /** Data surrounding a static preview image of the downsized version of this GIF. */ + downsized_still?: Image; + /** Data surrounding versions of this GIF with a fixed height of 200 pixels. Good for mobile use. */ + fixed_height?: Image; + /** Data surrounding versions of this GIF with a fixed height of 200 pixels and the number of frames reduced to 6. */ + fixed_height_downsampled?: Image; + /** Data surrounding versions of this GIF with a fixed height of 100 pixels. Good for mobile keyboards. */ + fixed_height_small?: Image; + /** Data surrounding a static image of this GIF with a fixed height of 100 pixels. */ + fixed_height_small_still?: Image; + /** Data surrounding a static image of this GIF with a fixed height of 200 pixels. */ + fixed_height_still?: Image; + /** Data surrounding versions of this GIF with a fixed width of 200 pixels. Good for mobile use. */ + fixed_width?: Image; + /** Data surrounding versions of this GIF with a fixed width of 200 pixels and the number of frames reduced to 6. */ + fixed_width_downsampled?: Image; + /** Data surrounding versions of this GIF with a fixed width of 100 pixels. Good for mobile keyboards. */ + fixed_width_small?: Image; + /** Data surrounding a static image of this GIF with a fixed width of 100 pixels. */ + fixed_width_small_still?: Image; + /** Data surrounding a static image of this GIF with a fixed width of 200 pixels. */ + fixed_width_still?: Image; + /** Data surrounding a version of this GIF set to loop for 15 seconds. */ + looping?: Image; + /** Data surrounding the original version of this GIF. Good for desktop use. */ + original?: Image; + /** Data surrounding a static preview image of the original GIF. */ + original_still?: Image; + /** Data surrounding a version of this GIF in .MP4 format limited to 50kb that displays the first 1-2 seconds of the GIF. */ + preview?: Image; + /** Data surrounding a version of this GIF limited to 50kb that displays the first 1-2 seconds of the GIF. */ + preview_gif?: Image; + }; + /** + * The creation or upload date from this GIF's source. + * @format date-time + * @example "2013-08-01 12:41:48" + */ + import_datetime?: string; + /** + * The MPAA-style rating for this content. Examples include Y, G, PG, PG-13 and R + * @example "g" + */ + rating?: string; + /** + * The unique slug used in this GIF's URL + * @example "confused-flying-YsTs5ltWtEhnq" + */ + slug?: string; + /** + * The page on which this GIF was found + * @example "http://www.reddit.com/r/reactiongifs/comments/1xpyaa/superman_goes_to_hollywood/" + */ + source?: string; + /** + * The URL of the webpage on which this GIF was found. + * @example "http://cheezburger.com/5282328320" + */ + source_post_url?: string; + /** + * The top level domain of the source URL. + * @example "cheezburger.com" + */ + source_tld?: string; + /** An array of tags for this GIF (Note: Not available when using the Public Beta Key) */ + tags?: string[]; + /** + * The date on which this gif was marked trending, if applicable. + * @format date-time + * @example "2013-08-01 12:41:48" + */ + trending_datetime?: string; + /** + * Type of the gif. By default, this is almost always gif + * @default "gif" + */ + type?: GifTypeEnum; + /** + * The date on which this GIF was last updated. + * @format date-time + * @example "2013-08-01 12:41:48" + */ + update_datetime?: string; + /** + * The unique URL for this GIF + * @example "http://giphy.com/gifs/confused-flying-YsTs5ltWtEhnq" + */ + url?: string; + /** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ + user?: User; + /** + * The username this GIF is attached to, if applicable + * @example "JoeCool4000" + */ + username?: string; } -export type ActionsEnableWorkflowData = any; - -export interface ActionsEnableWorkflowParams { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; +/** + * Type of the gif. By default, this is almost always gif + * @default "gif" + */ +export enum GifTypeEnum { + Gif = "gif", } -/** Whether GitHub Actions is enabled on the repository. */ -export type ActionsEnabled = boolean; - -export interface ActionsEnterprisePermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_organizations: EnabledOrganizations; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; - /** The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when \`enabled_organizations\` is set to \`selected\`. */ - selected_organizations_url?: string; +export interface Image { + /** + * The URL for this GIF in .MP4 format. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.mp4" + */ + mp4?: string; + /** + * The size in bytes of the .MP4 file corresponding to this GIF. + * @example "25123" + */ + mp4_size?: string; + /** + * The number of frames in this GIF. + * @example "15" + */ + frames?: string; + /** + * The height of this GIF in pixels. + * @example "200" + */ + height?: string; + /** + * The size of this GIF in bytes. + * @example "32381" + */ + size?: string; + /** + * The publicly-accessible direct URL for this GIF. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/200.gif" + */ + url?: string; + /** + * The URL for this GIF in .webp format. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.webp" + */ + webp?: string; + /** + * The size in bytes of the .webp file corresponding to this GIF. + * @example "12321" + */ + webp_size?: string; + /** + * The width of this GIF in pixels. + * @example "320" + */ + width?: string; } -export type ActionsGetAllowedActionsOrganizationData = SelectedActions; - -export interface ActionsGetAllowedActionsOrganizationParams { - org: string; +/** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ +export interface Meta { + /** + * HTTP Response Message + * @example "OK" + */ + msg?: string; + /** + * A unique ID paired with this response from the API. + * @example "57eea03c72381f86e05c35d2" + */ + response_id?: string; + /** + * HTTP Response Code + * @format int32 + * @example 200 + */ + status?: number; } -export type ActionsGetAllowedActionsRepositoryData = SelectedActions; +/** The particular GIF you are requesting was not found. This occurs, for example, if you request a GIF by an id that does not exist. */ +export type NotFound = any; -export interface ActionsGetAllowedActionsRepositoryParams { - owner: string; - repo: string; +/** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ +export interface Pagination { + /** + * Total number of items returned. + * @format int32 + * @example 25 + */ + count?: number; + /** + * Position in pagination. + * @format int32 + * @example 75 + */ + offset?: number; + /** + * Total number of items available. + * @format int32 + * @example 250 + */ + total_count?: number; } -export type ActionsGetArtifactData = Artifact; - -export interface ActionsGetArtifactParams { - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; +export interface RandomGifData { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; } -export type ActionsGetGithubActionsPermissionsOrganizationData = - ActionsOrganizationPermissions; - -export interface ActionsGetGithubActionsPermissionsOrganizationParams { - org: string; +export interface RandomGifParams { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; } -export type ActionsGetGithubActionsPermissionsRepositoryData = - ActionsRepositoryPermissions; - -export interface ActionsGetGithubActionsPermissionsRepositoryParams { - owner: string; - repo: string; +export interface RandomStickerData { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; } -export type ActionsGetJobForWorkflowRunData = Job; - -export interface ActionsGetJobForWorkflowRunParams { - /** job_id parameter */ - jobId: number; - owner: string; - repo: string; +export interface RandomStickerParams { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; } -export type ActionsGetOrgPublicKeyData = ActionsPublicKey; - -export interface ActionsGetOrgPublicKeyParams { - org: string; +export interface SearchGifsData { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; } -export type ActionsGetOrgSecretData = OrganizationActionsSecret; - -export interface ActionsGetOrgSecretParams { - org: string; - /** secret_name parameter */ - secretName: string; +export interface SearchGifsParams { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; } -export type ActionsGetRepoPublicKeyData = ActionsPublicKey; +export interface SearchStickersData { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; +} -export interface ActionsGetRepoPublicKeyParams { - owner: string; - repo: string; +export interface SearchStickersParams { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; } -export type ActionsGetRepoSecretData = ActionsSecret; +/** Your API Key is making too many requests. Read about [requesting a Production Key](https://developers.giphy.com/docs/#access) to upgrade your API Key rate limits. */ +export type TooManyRequests = any; -export interface ActionsGetRepoSecretParams { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; +export interface TranslateGifData { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; } -export type ActionsGetSelfHostedRunnerForOrgData = Runner; - -export interface ActionsGetSelfHostedRunnerForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; +export interface TranslateGifParams { + /** Search term. */ + s: string; } -export type ActionsGetSelfHostedRunnerForRepoData = Runner; +export interface TranslateStickerData { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; +} -export interface ActionsGetSelfHostedRunnerForRepoParams { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; -} - -export type ActionsGetSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; - -export interface ActionsGetSelfHostedRunnerGroupForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} - -export type ActionsGetWorkflowData = Workflow; - -export interface ActionsGetWorkflowParams { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; -} - -export type ActionsGetWorkflowRunData = WorkflowRun; - -export interface ActionsGetWorkflowRunParams { - owner: string; - repo: string; - runId: number; -} - -export type ActionsGetWorkflowRunUsageData = WorkflowRunUsage; - -export interface ActionsGetWorkflowRunUsageParams { - owner: string; - repo: string; - runId: number; -} - -export type ActionsGetWorkflowUsageData = WorkflowUsage; - -export interface ActionsGetWorkflowUsageParams { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; +export interface TranslateStickerParams { + /** Search term. */ + s: string; } -export interface ActionsListArtifactsForRepoData { - artifacts: Artifact[]; - total_count: number; +export interface TrendingGifsData { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; } -export interface ActionsListArtifactsForRepoParams { - owner: string; +export interface TrendingGifsParams { /** - * Page number of the results to fetch. - * @default 1 + * The maximum number of records to return. + * @format int32 + * @default 25 */ - page?: number; + limit?: number; /** - * Results per page (max 100) - * @default 30 + * An optional results offset. + * @format int32 + * @default 0 */ - per_page?: number; - repo: string; + offset?: number; + /** Filters results by specified rating. */ + rating?: string; } -export interface ActionsListJobsForWorkflowRunData { - jobs: Job[]; - total_count: number; +export interface TrendingStickersData { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; } -export interface ActionsListJobsForWorkflowRunParams { - /** - * Filters jobs by their \`completed_at\` timestamp. Can be one of: - * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. - * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. - * @default "latest" - */ - filter?: FilterEnum4; - owner: string; +export interface TrendingStickersParams { /** - * Page number of the results to fetch. - * @default 1 + * The maximum number of records to return. + * @format int32 + * @default 25 */ - page?: number; + limit?: number; /** - * Results per page (max 100) - * @default 30 + * An optional results offset. + * @format int32 + * @default 0 */ - per_page?: number; - repo: string; - runId: number; -} - -/** - * Filters jobs by their \`completed_at\` timestamp. Can be one of: - * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. - * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. - * @default "latest" - */ -export enum ActionsListJobsForWorkflowRunParams1FilterEnum { - Latest = "latest", - All = "all", -} - -export interface ActionsListOrgSecretsData { - secrets: OrganizationActionsSecret[]; - total_count: number; + offset?: number; + /** Filters results by specified rating. */ + rating?: string; } -export interface ActionsListOrgSecretsParams { - org: string; +/** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ +export interface User { /** - * Page number of the results to fetch. - * @default 1 + * The URL for this user's avatar image. + * @example "https://media1.giphy.com/avatars/election2016/XwYrZi5H87o6.gif" */ - page?: number; + avatar_url?: string; /** - * Results per page (max 100) - * @default 30 + * The URL for the banner image that appears atop this user's profile page. + * @example "https://media4.giphy.com/avatars/cheezburger/XkuejOhoGLE6.jpg" */ - per_page?: number; -} - -export interface ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData { - repositories: Repository[]; - total_count: number; -} - -export interface ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} - -export interface ActionsListRepoSecretsData { - secrets: ActionsSecret[]; - total_count: number; -} - -export interface ActionsListRepoSecretsParams { - owner: string; + banner_url?: string; /** - * Page number of the results to fetch. - * @default 1 + * The display name associated with this user (contains formatting the base username might not). + * @example "JoeCool4000" */ - page?: number; + display_name?: string; /** - * Results per page (max 100) - * @default 30 + * The URL for this user's profile. + * @example "https://giphy.com/cheezburger/" */ - per_page?: number; - repo: string; -} - -export interface ActionsListRepoWorkflowsData { - total_count: number; - workflows: Workflow[]; -} - -export interface ActionsListRepoWorkflowsParams { - owner: string; + profile_url?: string; /** - * Page number of the results to fetch. - * @default 1 + * The Twitter username associated with this user, if applicable. + * @example "@joecool4000" */ - page?: number; + twitter?: string; /** - * Results per page (max 100) - * @default 30 + * The username associated with this user. + * @example "joecool4000" */ - per_page?: number; - repo: string; -} - -export type ActionsListRunnerApplicationsForOrgData = RunnerApplication[]; - -export interface ActionsListRunnerApplicationsForOrgParams { - org: string; -} - -export type ActionsListRunnerApplicationsForRepoData = RunnerApplication[]; - -export interface ActionsListRunnerApplicationsForRepoParams { - owner: string; - repo: string; -} - -export interface ActionsListSelectedReposForOrgSecretData { - repositories: MinimalRepository[]; - total_count: number; -} - -export interface ActionsListSelectedReposForOrgSecretParams { - org: string; - /** secret_name parameter */ - secretName: string; -} - -export interface ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData { - repositories: Repository[]; - total_count: number; + username?: string; } -export interface ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams { - org: string; +export namespace Gifs { /** - * Page number of the results to fetch. - * @default 1 + * @description Returns a GIF given that GIF's unique ID + * @tags gifs + * @name GetGifById + * @summary Get GIF by Id + * @request GET:/gifs/{gifId} + * @secure */ - page?: number; + export namespace GetGifById { + export type RequestParams = { + /** + * Filters results by specified GIF ID. + * @format int32 + */ + gifId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetGifByIdData; + } + /** - * Results per page (max 100) - * @default 30 + * @description A multiget version of the get GIF by ID endpoint. + * @tags gifs + * @name GetGifsById + * @summary Get GIFs by ID + * @request GET:/gifs + * @secure */ - per_page?: number; -} - -export interface ActionsListSelfHostedRunnerGroupsForOrgData { - runner_groups: RunnerGroupsOrg[]; - total_count: number; -} + export namespace GetGifsById { + export type RequestParams = {}; + export type RequestQuery = { + /** Filters results by specified GIF IDs, separated by commas. */ + ids?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GetGifsByIdData; + } -export interface ActionsListSelfHostedRunnerGroupsForOrgParams { - org: string; /** - * Page number of the results to fetch. - * @default 1 + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @tags gifs + * @name RandomGif + * @summary Random GIF + * @request GET:/gifs/random + * @secure */ - page?: number; + export namespace RandomGif { + export type RequestParams = {}; + export type RequestQuery = { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = RandomGifData; + } + /** - * Results per page (max 100) - * @default 30 + * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. + * @tags gifs + * @name SearchGifs + * @summary Search GIFs + * @request GET:/gifs/search + * @secure */ - per_page?: number; -} - -export interface ActionsListSelfHostedRunnersForOrgData { - runners: Runner[]; - total_count: number; -} + export namespace SearchGifs { + export type RequestParams = {}; + export type RequestQuery = { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchGifsData; + } -export interface ActionsListSelfHostedRunnersForOrgParams { - org: string; /** - * Page number of the results to fetch. - * @default 1 + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF + * @tags gifs + * @name TranslateGif + * @summary Translate phrase to GIF + * @request GET:/gifs/translate + * @secure */ - page?: number; + export namespace TranslateGif { + export type RequestParams = {}; + export type RequestQuery = { + /** Search term. */ + s: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TranslateGifData; + } + /** - * Results per page (max 100) - * @default 30 + * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. + * @tags gifs + * @name TrendingGifs + * @summary Trending GIFs + * @request GET:/gifs/trending + * @secure */ - per_page?: number; -} - -export interface ActionsListSelfHostedRunnersForRepoData { - runners: Runner[]; - total_count: number; + export namespace TrendingGifs { + export type RequestParams = {}; + export type RequestQuery = { + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Filters results by specified rating. */ + rating?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TrendingGifsData; + } } -export interface ActionsListSelfHostedRunnersForRepoParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export namespace Stickers { /** - * Results per page (max 100) - * @default 30 + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @tags stickers + * @name RandomSticker + * @summary Random Sticker + * @request GET:/stickers/random + * @secure */ - per_page?: number; - repo: string; -} - -export interface ActionsListSelfHostedRunnersInGroupForOrgData { - runners: Runner[]; - total_count: number; -} + export namespace RandomSticker { + export type RequestParams = {}; + export type RequestQuery = { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = RandomStickerData; + } -export interface ActionsListSelfHostedRunnersInGroupForOrgParams { - org: string; /** - * Page number of the results to fetch. - * @default 1 + * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. + * @tags stickers + * @name SearchStickers + * @summary Search Stickers + * @request GET:/stickers/search + * @secure */ - page?: number; + export namespace SearchStickers { + export type RequestParams = {}; + export type RequestQuery = { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchStickersData; + } + /** - * Results per page (max 100) - * @default 30 + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. + * @tags stickers + * @name TranslateSticker + * @summary Translate phrase to Sticker + * @request GET:/stickers/translate + * @secure */ - per_page?: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} - -export interface ActionsListWorkflowRunArtifactsData { - artifacts: Artifact[]; - total_count: number; -} + export namespace TranslateSticker { + export type RequestParams = {}; + export type RequestQuery = { + /** Search term. */ + s: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TranslateStickerData; + } -export interface ActionsListWorkflowRunArtifactsParams { - owner: string; /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 + * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. + * @tags stickers + * @name TrendingStickers + * @summary Trending Stickers + * @request GET:/stickers/trending + * @secure */ - per_page?: number; - repo: string; - runId: number; + export namespace TrendingStickers { + export type RequestParams = {}; + export type RequestQuery = { + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Filters results by specified rating. */ + rating?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TrendingStickersData; + } } -export interface ActionsListWorkflowRunsData { - total_count: number; - workflow_runs: WorkflowRun[]; -} +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; -export interface ActionsListWorkflowRunsForRepoData { - total_count: number; - workflow_runs: WorkflowRun[]; +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 interface ActionsListWorkflowRunsForRepoParams { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: StatusEnum; -} +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ -export enum ActionsListWorkflowRunsForRepoParams1StatusEnum { - Completed = "completed", - Status = "status", - Conclusion = "conclusion", +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; } -export interface ActionsListWorkflowRunsParams { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: StatusEnum1; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; +export interface HttpResponse + extends Response { + data: D; + error: E; } -/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ -export enum ActionsListWorkflowRunsParams1StatusEnum { - Completed = "completed", - Status = "status", - Conclusion = "conclusion", -} +type CancelToken = Symbol | string | number; -export interface ActionsOrganizationPermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_repositories: EnabledRepositories; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; - /** The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when \`enabled_repositories\` is set to \`selected\`. */ - selected_repositories_url?: string; +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", } -/** - * ActionsPublicKey - * The public key used for setting Actions Secrets. - */ -export interface ActionsPublicKey { - /** @example "2011-01-26T19:01:12Z" */ - created_at?: string; - /** @example 2 */ - id?: number; - /** - * The Base64 encoded public key. - * @example "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=" - */ - key: string; - /** - * The identifier for the key. - * @example "1234567" - */ - key_id: string; - /** @example "ssh-rsa AAAAB3NzaC1yc2EAAA" */ - title?: string; - /** @example "https://api.github.com/user/keys/2" */ - url?: string; -} +export class HttpClient { + public baseUrl: string = "https://api.giphy.com/v1"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); -export type ActionsReRunWorkflowData = any; + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; -export interface ActionsReRunWorkflowParams { - owner: string; - repo: string; - runId: number; -} + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } -export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData = any; + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; -export interface ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams { - org: string; - repositoryId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } -export type ActionsRemoveSelectedRepoFromOrgSecretData = any; + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } -export interface ActionsRemoveSelectedRepoFromOrgSecretParams { - org: string; - repositoryId: number; - /** secret_name parameter */ - secretName: string; -} + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } -export type ActionsRemoveSelfHostedRunnerFromGroupForOrgData = any; + 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("&"); + } -export interface ActionsRemoveSelfHostedRunnerFromGroupForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; -} + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } -export interface ActionsRepositoryPermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** Whether GitHub Actions is enabled on the repository. */ - enabled: ActionsEnabled; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; -} + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } -/** - * Actions Secret - * Set secrets for GitHub Actions. - */ -export interface ActionsSecret { - /** @format date-time */ - created_at: string; - /** - * The name of the secret. - * @example "SECRET_TOKEN" - */ - name: string; - /** @format date-time */ - updated_at: string; -} + return 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), + }; -export type ActionsSetAllowedActionsOrganizationData = any; + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } -export interface ActionsSetAllowedActionsOrganizationParams { - org: string; -} + 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; + } -export type ActionsSetAllowedActionsRepositoryData = any; + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; -export interface ActionsSetAllowedActionsRepositoryParams { - owner: string; - repo: string; -} + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); -export type ActionsSetGithubActionsPermissionsOrganizationData = any; + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; -export interface ActionsSetGithubActionsPermissionsOrganizationParams { - org: string; -} + 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; -export interface ActionsSetGithubActionsPermissionsOrganizationPayload { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_repositories: EnabledRepositories; -} + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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; -export type ActionsSetGithubActionsPermissionsRepositoryData = any; + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); -export interface ActionsSetGithubActionsPermissionsRepositoryParams { - owner: string; - repo: string; -} + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } -export interface ActionsSetGithubActionsPermissionsRepositoryPayload { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** Whether GitHub Actions is enabled on the repository. */ - enabled: ActionsEnabled; + if (!response.ok) throw data; + return data; + }); + }; } -export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData = any; - -export interface ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} +/** + * @title Giphy + * @version 1.0 + * @termsOfService https://developers.giphy.com/ + * @baseUrl https://api.giphy.com/v1 + * @externalDocs https://developers.giphy.com/docs/ + * @contact + * + * Giphy API + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + gifs = { + /** + * @description Returns a GIF given that GIF's unique ID + * + * @tags gifs + * @name GetGifById + * @summary Get GIF by Id + * @request GET:/gifs/{gifId} + * @secure + */ + getGifById: ({ gifId }: GetGifByIdParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs/\${gifId}\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload { - /** List of repository IDs that can access the runner group. */ - selected_repository_ids: number[]; -} + /** + * @description A multiget version of the get GIF by ID endpoint. + * + * @tags gifs + * @name GetGifsById + * @summary Get GIFs by ID + * @request GET:/gifs + * @secure + */ + getGifsById: (query: GetGifsByIdParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export type ActionsSetSelectedReposForOrgSecretData = any; + /** + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * + * @tags gifs + * @name RandomGif + * @summary Random GIF + * @request GET:/gifs/random + * @secure + */ + randomGif: (query: RandomGifParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs/random\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetSelectedReposForOrgSecretParams { - org: string; - /** secret_name parameter */ - secretName: string; -} - -export interface ActionsSetSelectedReposForOrgSecretPayload { - /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ - selected_repository_ids?: number[]; -} - -export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData = - any; + /** + * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. + * + * @tags gifs + * @name SearchGifs + * @summary Search GIFs + * @request GET:/gifs/search + * @secure + */ + searchGifs: (query: SearchGifsParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs/search\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams { - org: string; -} + /** + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF + * + * @tags gifs + * @name TranslateGif + * @summary Translate phrase to GIF + * @request GET:/gifs/translate + * @secure + */ + translateGif: (query: TranslateGifParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs/translate\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload { - /** List of repository IDs to enable for GitHub Actions. */ - selected_repository_ids: number[]; -} + /** + * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. + * + * @tags gifs + * @name TrendingGifs + * @summary Trending GIFs + * @request GET:/gifs/trending + * @secure + */ + trendingGifs: (query: TrendingGifsParams, params: RequestParams = {}) => + this.request({ + path: \`/gifs/trending\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + }; + stickers = { + /** + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * + * @tags stickers + * @name RandomSticker + * @summary Random Sticker + * @request GET:/stickers/random + * @secure + */ + randomSticker: (query: RandomStickerParams, params: RequestParams = {}) => + this.request({ + path: \`/stickers/random\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export type ActionsSetSelfHostedRunnersInGroupForOrgData = any; + /** + * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. + * + * @tags stickers + * @name SearchStickers + * @summary Search Stickers + * @request GET:/stickers/search + * @secure + */ + searchStickers: (query: SearchStickersParams, params: RequestParams = {}) => + this.request({ + path: \`/stickers/search\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetSelfHostedRunnersInGroupForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} + /** + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. + * + * @tags stickers + * @name TranslateSticker + * @summary Translate phrase to Sticker + * @request GET:/stickers/translate + * @secure + */ + translateSticker: ( + query: TranslateStickerParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/stickers/translate\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -export interface ActionsSetSelfHostedRunnersInGroupForOrgPayload { - /** List of runner IDs to add to the runner group. */ - runners: number[]; + /** + * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. + * + * @tags stickers + * @name TrendingStickers + * @summary Trending Stickers + * @request GET:/stickers/trending + * @secure + */ + trendingStickers: ( + query: TrendingStickersParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/stickers/trending\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + }; } +" +`; -export type ActionsUpdateSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; +exports[`extended > 'issue-1057' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ -export interface ActionsUpdateSelfHostedRunnerGroupForOrgParams { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +export interface MySchema { + not_working?: MySchemaNotWorkingEnum; + working?: MySchemaWorkingEnum; } -export interface ActionsUpdateSelfHostedRunnerGroupForOrgPayload { - /** Name of the runner group. */ - name?: string; - /** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ - visibility?: ActionsUpdateSelfHostedRunnerGroupForOrgVisibilityEnum; +export enum MySchemaNotWorkingEnum { + PhoneNumber = "phone_number", } -/** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ -export enum ActionsUpdateSelfHostedRunnerGroupForOrgVisibilityEnum { - Selected = "selected", - All = "all", - Private = "private", +export enum MySchemaWorkingEnum { + EmailAddress = "email_address", } -export type ActivityCheckRepoIsStarredByAuthenticatedUserData = any; - -export type ActivityCheckRepoIsStarredByAuthenticatedUserError = BasicError; +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; -export interface ActivityCheckRepoIsStarredByAuthenticatedUserParams { - owner: string; - repo: string; +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 ActivityDeleteRepoSubscriptionData = any; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -export interface ActivityDeleteRepoSubscriptionParams { - owner: string; - repo: string; +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; } -export type ActivityDeleteThreadSubscriptionData = any; - -export interface ActivityDeleteThreadSubscriptionParams { - /** thread_id parameter */ - threadId: number; +export interface HttpResponse + extends Response { + data: D; + error: E; } -export type ActivityGetFeedsData = Feed; - -export type ActivityGetRepoSubscriptionData = RepositorySubscription; +type CancelToken = Symbol | string | number; -export interface ActivityGetRepoSubscriptionParams { - owner: string; - repo: string; +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", } -export type ActivityGetThreadData = Thread; +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); -export interface ActivityGetThreadParams { - /** thread_id parameter */ - threadId: number; -} + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; -export type ActivityGetThreadSubscriptionForAuthenticatedUserData = - ThreadSubscription; + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } -export interface ActivityGetThreadSubscriptionForAuthenticatedUserParams { - /** thread_id parameter */ - threadId: number; -} + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; -export type ActivityListEventsForAuthenticatedUserData = Event[]; + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } -export interface ActivityListEventsForAuthenticatedUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; -} + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } -export type ActivityListNotificationsForAuthenticatedUserData = Thread[]; + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } -export interface ActivityListNotificationsForAuthenticatedUserParams { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; -} + 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("&"); + } -export type ActivityListOrgEventsForAuthenticatedUserData = Event[]; + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } -export interface ActivityListOrgEventsForAuthenticatedUserParams { - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; -} + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } -export type ActivityListPublicEventsData = Event[]; + return 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), + }; -export type ActivityListPublicEventsForRepoNetworkData = Event[]; + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } -export interface ActivityListPublicEventsForRepoNetworkParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} + 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; + } -export type ActivityListPublicEventsForUserData = Event[]; + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; -export interface ActivityListPublicEventsForUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; -} + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); -export interface ActivityListPublicEventsParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; -} + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; -export type ActivityListPublicOrgEventsData = Event[]; + 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; -export interface ActivityListPublicOrgEventsParams { - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; -} + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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; -export type ActivityListReceivedEventsForUserData = Event[]; + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); -export interface ActivityListReceivedEventsForUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; } -export type ActivityListReceivedPublicEventsForUserData = Event[]; +/** + * @title No title + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient {} +" +`; -export interface ActivityListReceivedPublicEventsForUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; -} +exports[`extended > 'link-example' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ -export type ActivityListRepoEventsData = Event[]; +export type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData = any; -export interface ActivityListRepoEventsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +export interface ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams { + org: string; + repositoryId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type ActivityListRepoNotificationsForAuthenticatedUserData = Thread[]; +export type ActionsAddSelectedRepoToOrgSecretData = any; -export interface ActivityListRepoNotificationsForAuthenticatedUserParams { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; +export interface ActionsAddSelectedRepoToOrgSecretParams { + org: string; + repositoryId: number; + /** secret_name parameter */ + secretName: string; } -export type ActivityListReposStarredByAuthenticatedUserData = Repository[]; +export type ActionsAddSelfHostedRunnerToGroupForOrgData = any; -export interface ActivityListReposStarredByAuthenticatedUserParams { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum17; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: SortEnum20; +export interface ActionsAddSelfHostedRunnerToGroupForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum ActivityListReposStarredByAuthenticatedUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +export interface ActionsBillingUsage { + /** The amount of free GitHub Actions minutes available. */ + included_minutes: number; + minutes_used_breakdown: { + /** Total minutes used on macOS runner machines. */ + MACOS?: number; + /** Total minutes used on Ubuntu runner machines. */ + UBUNTU?: number; + /** Total minutes used on Windows runner machines. */ + WINDOWS?: number; + }; + /** The sum of the free and paid GitHub Actions minutes used. */ + total_minutes_used: number; + /** The total paid GitHub Actions minutes used. */ + total_paid_minutes_used: number; } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum ActivityListReposStarredByAuthenticatedUserParams1SortEnum { - Created = "created", - Updated = "updated", +export type ActionsCancelWorkflowRunData = any; + +export interface ActionsCancelWorkflowRunParams { + owner: string; + repo: string; + runId: number; } -export type ActivityListReposStarredByUserData = Repository[]; +export type ActionsCreateOrUpdateOrgSecretData = any; -export interface ActivityListReposStarredByUserParams { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum19; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; +export interface ActionsCreateOrUpdateOrgSecretParams { + org: string; + /** secret_name parameter */ + secretName: string; +} + +export interface ActionsCreateOrUpdateOrgSecretPayload { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: string[]; /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Configures the access that repositories have to the organization secret. Can be one of: + * \\- \`all\` - All repositories in an organization can access the secret. + * \\- \`private\` - Private repositories in an organization can access the secret. + * \\- \`selected\` - Only specific repositories can access the secret. */ - sort?: SortEnum22; - username: string; + visibility?: ActionsCreateOrUpdateOrgSecretVisibilityEnum; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Configures the access that repositories have to the organization secret. Can be one of: + * \\- \`all\` - All repositories in an organization can access the secret. + * \\- \`private\` - Private repositories in an organization can access the secret. + * \\- \`selected\` - Only specific repositories can access the secret. */ -export enum ActivityListReposStarredByUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +export enum ActionsCreateOrUpdateOrgSecretVisibilityEnum { + All = "all", + Private = "private", + Selected = "selected", } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum ActivityListReposStarredByUserParams1SortEnum { - Created = "created", - Updated = "updated", +export type ActionsCreateOrUpdateRepoSecretData = any; + +export interface ActionsCreateOrUpdateRepoSecretParams { + owner: string; + repo: string; + /** secret_name parameter */ + secretName: string; } -export type ActivityListReposWatchedByUserData = MinimalRepository[]; +export interface ActionsCreateOrUpdateRepoSecretPayload { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; +} -export interface ActivityListReposWatchedByUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; +export type ActionsCreateRegistrationTokenForOrgData = AuthenticationToken; + +export interface ActionsCreateRegistrationTokenForOrgParams { + org: string; } -export type ActivityListStargazersForRepoData = SimpleUser[]; +export type ActionsCreateRegistrationTokenForRepoData = AuthenticationToken; -export interface ActivityListStargazersForRepoParams { +export interface ActionsCreateRegistrationTokenForRepoParams { owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; repo: string; } -export type ActivityListWatchedReposForAuthenticatedUserData = - MinimalRepository[]; +export type ActionsCreateRemoveTokenForOrgData = AuthenticationToken; -export interface ActivityListWatchedReposForAuthenticatedUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; +export interface ActionsCreateRemoveTokenForOrgParams { + org: string; } -export type ActivityListWatchersForRepoData = SimpleUser[]; +export type ActionsCreateRemoveTokenForRepoData = AuthenticationToken; -export interface ActivityListWatchersForRepoParams { +export interface ActionsCreateRemoveTokenForRepoParams { owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; repo: string; } -export interface ActivityMarkNotificationsAsReadData { - message?: string; +export type ActionsCreateSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; + +export interface ActionsCreateSelfHostedRunnerGroupForOrgParams { + org: string; } -export interface ActivityMarkNotificationsAsReadPayload { +export interface ActionsCreateSelfHostedRunnerGroupForOrgPayload { + /** Name of the runner group. */ + name: string; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + /** List of repository IDs that can access the runner group. */ + selected_repository_ids?: number[]; /** - * Describes the last point that notifications were checked. - * @format date-time + * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. + * @default "all" */ - last_read_at?: string; - /** Whether the notification has been read. */ - read?: boolean; + visibility?: ActionsCreateSelfHostedRunnerGroupForOrgVisibilityEnum; } -export type ActivityMarkRepoNotificationsAsReadData = any; +/** + * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. + * @default "all" + */ +export enum ActionsCreateSelfHostedRunnerGroupForOrgVisibilityEnum { + Selected = "selected", + All = "all", + Private = "private", +} -export interface ActivityMarkRepoNotificationsAsReadParams { +export type ActionsCreateWorkflowDispatchData = any; + +export interface ActionsCreateWorkflowDispatchParams { owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -export interface ActivityMarkRepoNotificationsAsReadPayload { - /** Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. Default: The current timestamp. */ - last_read_at?: string; +export interface ActionsCreateWorkflowDispatchPayload { + /** Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when \`inputs\` are omitted. */ + inputs?: Record; + /** The git reference for the workflow. The reference can be a branch or tag name. */ + ref: string; } -export type ActivityMarkThreadAsReadData = any; +export type ActionsDeleteArtifactData = any; -export interface ActivityMarkThreadAsReadParams { - /** thread_id parameter */ - threadId: number; +export interface ActionsDeleteArtifactParams { + /** artifact_id parameter */ + artifactId: number; + owner: string; + repo: string; } -export type ActivitySetRepoSubscriptionData = RepositorySubscription; +export type ActionsDeleteOrgSecretData = any; -export interface ActivitySetRepoSubscriptionParams { +export interface ActionsDeleteOrgSecretParams { + org: string; + /** secret_name parameter */ + secretName: string; +} + +export type ActionsDeleteRepoSecretData = any; + +export interface ActionsDeleteRepoSecretParams { owner: string; repo: string; + /** secret_name parameter */ + secretName: string; } -export interface ActivitySetRepoSubscriptionPayload { - /** Determines if all notifications should be blocked from this repository. */ - ignored?: boolean; - /** Determines if notifications should be received from this repository. */ - subscribed?: boolean; +export type ActionsDeleteSelfHostedRunnerFromOrgData = any; + +export interface ActionsDeleteSelfHostedRunnerFromOrgParams { + org: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -export type ActivitySetThreadSubscriptionData = ThreadSubscription; +export type ActionsDeleteSelfHostedRunnerFromRepoData = any; -export interface ActivitySetThreadSubscriptionParams { - /** thread_id parameter */ - threadId: number; +export interface ActionsDeleteSelfHostedRunnerFromRepoParams { + owner: string; + repo: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -export interface ActivitySetThreadSubscriptionPayload { - /** - * Whether to block all notifications from a thread. - * @default false - */ - ignored?: boolean; +export type ActionsDeleteSelfHostedRunnerGroupFromOrgData = any; + +export interface ActionsDeleteSelfHostedRunnerGroupFromOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type ActivityStarRepoForAuthenticatedUserData = any; +export type ActionsDeleteWorkflowRunData = any; -export interface ActivityStarRepoForAuthenticatedUserParams { +export type ActionsDeleteWorkflowRunLogsData = any; + +export interface ActionsDeleteWorkflowRunLogsParams { owner: string; repo: string; + runId: number; } -export type ActivityUnstarRepoForAuthenticatedUserData = any; - -export interface ActivityUnstarRepoForAuthenticatedUserParams { +export interface ActionsDeleteWorkflowRunParams { owner: string; repo: string; + runId: number; } -/** - * Actor - * Actor - */ -export interface Actor { - /** @format uri */ - avatar_url: string; - display_login?: string; - gravatar_id: string | null; - id: number; - login: string; - /** @format uri */ - url: string; -} +export type ActionsDisableSelectedRepositoryGithubActionsOrganizationData = any; -/** - * Filters the collaborators by their affiliation. Can be one of: - * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. - * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ -export enum AffiliationEnum { - Outside = "outside", - Direct = "direct", - All = "all", +export interface ActionsDisableSelectedRepositoryGithubActionsOrganizationParams { + org: string; + repositoryId: number; } -/** - * Filter collaborators returned by their affiliation. Can be one of: - * \\* \`outside\`: All outside collaborators of an organization-owned repository. - * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ -export enum AffiliationEnum1 { - Outside = "outside", - Direct = "direct", - All = "all", -} +export type ActionsDisableWorkflowData = any; -/** - * The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time - */ -export type AlertCreatedAt = string; - -/** - * The GitHub URL of the alert resource. - * @format uri - */ -export type AlertHtmlUrl = string; - -/** The security alert number. */ -export type AlertNumber = number; - -/** - * The REST API URL of the alert resource. - * @format uri - */ -export type AlertUrl = string; - -/** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ -export enum AllowedActions { - All = "all", - LocalOnly = "local_only", - Selected = "selected", +export interface ActionsDisableWorkflowParams { + owner: string; + repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -/** - * Api Overview - * Api Overview - */ -export interface ApiOverview { - /** @example ["13.64.0.0/16","13.65.0.0/16"] */ - actions?: string[]; - /** @example ["127.0.0.1/32"] */ - api?: string[]; - /** @example ["127.0.0.1/32"] */ - git?: string[]; - /** @example ["127.0.0.1/32"] */ - hooks?: string[]; - /** @example ["54.158.161.132","54.226.70.38"] */ - importer?: string[]; - /** @example ["192.30.252.153/32","192.30.252.154/32"] */ - pages?: string[]; - ssh_key_fingerprints?: { - SHA256_DSA?: string; - SHA256_RSA?: string; - }; - /** @example true */ - verifiable_password_authentication: boolean; - /** @example ["127.0.0.1/32"] */ - web?: string[]; +export interface ActionsDownloadArtifactParams { + archiveFormat: string; + /** artifact_id parameter */ + artifactId: number; + owner: string; + repo: string; } -/** - * App Permissions - * The permissions granted to the user-to-server access token. - * @example {"contents":"read","issues":"read","deployments":"write","single_file":"read"} - */ -export interface AppPermissions { - /** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ - actions?: AppPermissionsActionsEnum; - /** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ - administration?: AppPermissionsAdministrationEnum; - /** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ - checks?: AppPermissionsChecksEnum; - /** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ - content_references?: AppPermissionsContentReferencesEnum; - /** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ - contents?: AppPermissionsContentsEnum; - /** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ - deployments?: AppPermissionsDeploymentsEnum; - /** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ - environments?: AppPermissionsEnvironmentsEnum; - /** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ - issues?: AppPermissionsIssuesEnum; - /** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ - members?: AppPermissionsMembersEnum; - /** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ - metadata?: AppPermissionsMetadataEnum; - /** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ - organization_administration?: AppPermissionsOrganizationAdministrationEnum; - /** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ - organization_hooks?: AppPermissionsOrganizationHooksEnum; - /** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ - organization_plan?: AppPermissionsOrganizationPlanEnum; - /** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ - organization_projects?: AppPermissionsOrganizationProjectsEnum; - /** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ - organization_secrets?: AppPermissionsOrganizationSecretsEnum; - /** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ - organization_self_hosted_runners?: AppPermissionsOrganizationSelfHostedRunnersEnum; - /** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ - organization_user_blocking?: AppPermissionsOrganizationUserBlockingEnum; - /** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ - packages?: AppPermissionsPackagesEnum; - /** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ - pages?: AppPermissionsPagesEnum; - /** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ - pull_requests?: AppPermissionsPullRequestsEnum; - /** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ - repository_hooks?: AppPermissionsRepositoryHooksEnum; - /** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ - repository_projects?: AppPermissionsRepositoryProjectsEnum; - /** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ - secret_scanning_alerts?: AppPermissionsSecretScanningAlertsEnum; - /** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ - secrets?: AppPermissionsSecretsEnum; - /** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ - security_events?: AppPermissionsSecurityEventsEnum; - /** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ - single_file?: AppPermissionsSingleFileEnum; - /** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ - statuses?: AppPermissionsStatusesEnum; - /** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ - team_discussions?: AppPermissionsTeamDiscussionsEnum; - /** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ - vulnerability_alerts?: AppPermissionsVulnerabilityAlertsEnum; - /** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ - workflows?: AppPermissionsWorkflowsEnum; +export interface ActionsDownloadJobLogsForWorkflowRunParams { + /** job_id parameter */ + jobId: number; + owner: string; + repo: string; } -/** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsActionsEnum { - Read = "read", - Write = "write", +export interface ActionsDownloadWorkflowRunLogsParams { + owner: string; + repo: string; + runId: number; } -/** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsAdministrationEnum { - Read = "read", - Write = "write", -} +export type ActionsEnableSelectedRepositoryGithubActionsOrganizationData = any; -/** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsChecksEnum { - Read = "read", - Write = "write", +export interface ActionsEnableSelectedRepositoryGithubActionsOrganizationParams { + org: string; + repositoryId: number; } -/** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsContentReferencesEnum { - Read = "read", - Write = "write", -} +export type ActionsEnableWorkflowData = any; -/** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsContentsEnum { - Read = "read", - Write = "write", +export interface ActionsEnableWorkflowParams { + owner: string; + repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -/** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsDeploymentsEnum { - Read = "read", - Write = "write", -} +/** Whether GitHub Actions is enabled on the repository. */ +export type ActionsEnabled = boolean; -/** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsEnvironmentsEnum { - Read = "read", - Write = "write", +export interface ActionsEnterprisePermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_organizations: EnabledOrganizations; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; + /** The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when \`enabled_organizations\` is set to \`selected\`. */ + selected_organizations_url?: string; } -/** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsIssuesEnum { - Read = "read", - Write = "write", -} +export type ActionsGetAllowedActionsOrganizationData = SelectedActions; -/** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsMembersEnum { - Read = "read", - Write = "write", +export interface ActionsGetAllowedActionsOrganizationParams { + org: string; } -/** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsMetadataEnum { - Read = "read", - Write = "write", -} +export type ActionsGetAllowedActionsRepositoryData = SelectedActions; -/** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsOrganizationAdministrationEnum { - Read = "read", - Write = "write", +export interface ActionsGetAllowedActionsRepositoryParams { + owner: string; + repo: string; } -/** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsOrganizationHooksEnum { - Read = "read", - Write = "write", -} +export type ActionsGetArtifactData = Artifact; -/** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ -export enum AppPermissionsOrganizationPlanEnum { - Read = "read", +export interface ActionsGetArtifactParams { + /** artifact_id parameter */ + artifactId: number; + owner: string; + repo: string; } -/** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ -export enum AppPermissionsOrganizationProjectsEnum { - Read = "read", - Write = "write", - Admin = "admin", +export type ActionsGetGithubActionsPermissionsOrganizationData = + ActionsOrganizationPermissions; + +export interface ActionsGetGithubActionsPermissionsOrganizationParams { + org: string; } -/** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsOrganizationSecretsEnum { - Read = "read", - Write = "write", +export type ActionsGetGithubActionsPermissionsRepositoryData = + ActionsRepositoryPermissions; + +export interface ActionsGetGithubActionsPermissionsRepositoryParams { + owner: string; + repo: string; } -/** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsOrganizationSelfHostedRunnersEnum { - Read = "read", - Write = "write", +export type ActionsGetJobForWorkflowRunData = Job; + +export interface ActionsGetJobForWorkflowRunParams { + /** job_id parameter */ + jobId: number; + owner: string; + repo: string; } -/** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsOrganizationUserBlockingEnum { - Read = "read", - Write = "write", +export type ActionsGetOrgPublicKeyData = ActionsPublicKey; + +export interface ActionsGetOrgPublicKeyParams { + org: string; } -/** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsPackagesEnum { - Read = "read", - Write = "write", +export type ActionsGetOrgSecretData = OrganizationActionsSecret; + +export interface ActionsGetOrgSecretParams { + org: string; + /** secret_name parameter */ + secretName: string; } -/** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsPagesEnum { - Read = "read", - Write = "write", +export type ActionsGetRepoPublicKeyData = ActionsPublicKey; + +export interface ActionsGetRepoPublicKeyParams { + owner: string; + repo: string; } -/** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsPullRequestsEnum { - Read = "read", - Write = "write", +export type ActionsGetRepoSecretData = ActionsSecret; + +export interface ActionsGetRepoSecretParams { + owner: string; + repo: string; + /** secret_name parameter */ + secretName: string; } -/** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsRepositoryHooksEnum { - Read = "read", - Write = "write", +export type ActionsGetSelfHostedRunnerForOrgData = Runner; + +export interface ActionsGetSelfHostedRunnerForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ -export enum AppPermissionsRepositoryProjectsEnum { - Read = "read", - Write = "write", - Admin = "admin", +export type ActionsGetSelfHostedRunnerForRepoData = Runner; + +export interface ActionsGetSelfHostedRunnerForRepoParams { + owner: string; + repo: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsSecretScanningAlertsEnum { - Read = "read", - Write = "write", +export type ActionsGetSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; + +export interface ActionsGetSelfHostedRunnerGroupForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsSecretsEnum { - Read = "read", - Write = "write", +export type ActionsGetWorkflowData = Workflow; + +export interface ActionsGetWorkflowParams { + owner: string; + repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -/** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsSecurityEventsEnum { - Read = "read", - Write = "write", +export type ActionsGetWorkflowRunData = WorkflowRun; + +export interface ActionsGetWorkflowRunParams { + owner: string; + repo: string; + runId: number; } -/** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsSingleFileEnum { - Read = "read", - Write = "write", +export type ActionsGetWorkflowRunUsageData = WorkflowRunUsage; + +export interface ActionsGetWorkflowRunUsageParams { + owner: string; + repo: string; + runId: number; } -/** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsStatusesEnum { - Read = "read", - Write = "write", +export type ActionsGetWorkflowUsageData = WorkflowUsage; + +export interface ActionsGetWorkflowUsageParams { + owner: string; + repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -/** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ -export enum AppPermissionsTeamDiscussionsEnum { - Read = "read", - Write = "write", +export interface ActionsListArtifactsForRepoData { + artifacts: Artifact[]; + total_count: number; } -/** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ -export enum AppPermissionsVulnerabilityAlertsEnum { - Read = "read", +export interface ActionsListArtifactsForRepoParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ -export enum AppPermissionsWorkflowsEnum { - Write = "write", +export interface ActionsListJobsForWorkflowRunData { + jobs: Job[]; + total_count: number; } -/** - * Application Grant - * The authorization associated with an OAuth Access. - */ -export interface ApplicationGrant { - app: { - client_id: string; - name: string; - /** @format uri */ - url: string; - }; +export interface ActionsListJobsForWorkflowRunParams { /** - * @format date-time - * @example "2011-09-06T17:26:27Z" + * Filters jobs by their \`completed_at\` timestamp. Can be one of: + * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. + * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. + * @default "latest" */ - created_at: string; - /** @example 1 */ - id: number; - /** @example ["public_repo"] */ - scopes: string[]; + filter?: FilterEnum4; + owner: string; /** - * @format date-time - * @example "2011-09-06T20:39:23Z" + * Page number of the results to fetch. + * @default 1 */ - updated_at: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/applications/grants/1" + * Results per page (max 100) + * @default 30 */ - url: string; - user?: SimpleUser | null; + per_page?: number; + repo: string; + runId: number; } -export type AppsAddRepoToInstallationData = any; - -export interface AppsAddRepoToInstallationParams { - /** installation_id parameter */ - installationId: number; - repositoryId: number; +/** + * Filters jobs by their \`completed_at\` timestamp. Can be one of: + * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. + * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. + * @default "latest" + */ +export enum ActionsListJobsForWorkflowRunParams1FilterEnum { + Latest = "latest", + All = "all", } -export type AppsCheckAuthorizationData = Authorization | null; - -export interface AppsCheckAuthorizationParams { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; +export interface ActionsListOrgSecretsData { + secrets: OrganizationActionsSecret[]; + total_count: number; } -export type AppsCheckTokenData = Authorization; - -export interface AppsCheckTokenParams { - /** The client ID of your GitHub app. */ - clientId: string; +export interface ActionsListOrgSecretsParams { + org: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export interface AppsCheckTokenPayload { - /** The access_token of the OAuth application. */ - access_token: string; +export interface ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData { + repositories: Repository[]; + total_count: number; } -export type AppsCreateContentAttachmentData = ContentReferenceAttachment; +export interface ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; +} -export interface AppsCreateContentAttachmentParams { - contentReferenceId: number; +export interface ActionsListRepoSecretsData { + secrets: ActionsSecret[]; + total_count: number; } -export interface AppsCreateContentAttachmentPayload { +export interface ActionsListRepoSecretsParams { + owner: string; /** - * The body of the attachment - * @maxLength 262144 - * @example "Body of the attachment" + * Page number of the results to fetch. + * @default 1 */ - body: string; + page?: number; /** - * The title of the attachment - * @maxLength 1024 - * @example "Title of the attachment" + * Results per page (max 100) + * @default 30 */ - title: string; -} - -export type AppsCreateFromManifestData = Integration & { - client_id: string; - client_secret: string; - pem: string; - webhook_secret: string; - [key: string]: any; -}; - -export interface AppsCreateFromManifestParams { - code: string; + per_page?: number; + repo: string; } -export type AppsCreateInstallationAccessTokenData = InstallationToken; - -export interface AppsCreateInstallationAccessTokenParams { - /** installation_id parameter */ - installationId: number; +export interface ActionsListRepoWorkflowsData { + total_count: number; + workflows: Workflow[]; } -export interface AppsCreateInstallationAccessTokenPayload { - /** The permissions granted to the user-to-server access token. */ - permissions?: AppPermissions; - /** List of repository names that the token should have access to */ - repositories?: string[]; +export interface ActionsListRepoWorkflowsParams { + owner: string; /** - * List of repository IDs that the token should have access to - * @example [1] + * Page number of the results to fetch. + * @default 1 */ - repository_ids?: number[]; -} - -export type AppsDeleteAuthorizationData = any; - -export interface AppsDeleteAuthorizationParams { - /** The client ID of your GitHub app. */ - clientId: string; -} - -export interface AppsDeleteAuthorizationPayload { - /** The OAuth access token used to authenticate to the GitHub API. */ - access_token?: string; -} - -export type AppsDeleteInstallationData = any; - -export interface AppsDeleteInstallationParams { - /** installation_id parameter */ - installationId: number; -} - -export type AppsDeleteTokenData = any; - -export interface AppsDeleteTokenParams { - /** The client ID of your GitHub app. */ - clientId: string; -} - -export interface AppsDeleteTokenPayload { - /** The OAuth access token used to authenticate to the GitHub API. */ - access_token?: string; -} - -export type AppsGetAuthenticatedData = Integration; - -export type AppsGetBySlugData = Integration; - -export interface AppsGetBySlugParams { - appSlug: string; -} - -export type AppsGetInstallationData = Installation; - -export interface AppsGetInstallationParams { - /** installation_id parameter */ - installationId: number; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -export type AppsGetOrgInstallationData = Installation; +export type ActionsListRunnerApplicationsForOrgData = RunnerApplication[]; -export interface AppsGetOrgInstallationParams { +export interface ActionsListRunnerApplicationsForOrgParams { org: string; } -export type AppsGetRepoInstallationData = Installation; +export type ActionsListRunnerApplicationsForRepoData = RunnerApplication[]; -export interface AppsGetRepoInstallationParams { +export interface ActionsListRunnerApplicationsForRepoParams { owner: string; repo: string; } -export type AppsGetSubscriptionPlanForAccountData = MarketplacePurchase; - -export type AppsGetSubscriptionPlanForAccountError = BasicError; - -export interface AppsGetSubscriptionPlanForAccountParams { - /** account_id parameter */ - accountId: number; +export interface ActionsListSelectedReposForOrgSecretData { + repositories: MinimalRepository[]; + total_count: number; } -export type AppsGetSubscriptionPlanForAccountStubbedData = MarketplacePurchase; - -export interface AppsGetSubscriptionPlanForAccountStubbedParams { - /** account_id parameter */ - accountId: number; +export interface ActionsListSelectedReposForOrgSecretParams { + org: string; + /** secret_name parameter */ + secretName: string; } -export type AppsGetUserInstallationData = Installation; - -export interface AppsGetUserInstallationParams { - username: string; +export interface ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData { + repositories: Repository[]; + total_count: number; } -export type AppsGetWebhookConfigForAppData = WebhookConfig; - -export type AppsListAccountsForPlanData = MarketplacePurchase[]; - -export interface AppsListAccountsForPlanParams { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: DirectionEnum1; +export interface ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -14069,35 +14581,15 @@ export interface AppsListAccountsForPlanParams { * @default 30 */ per_page?: number; - /** plan_id parameter */ - planId: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: SortEnum1; -} - -/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum AppsListAccountsForPlanParams1DirectionEnum { - Asc = "asc", - Desc = "desc", } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum AppsListAccountsForPlanParams1SortEnum { - Created = "created", - Updated = "updated", +export interface ActionsListSelfHostedRunnerGroupsForOrgData { + runner_groups: RunnerGroupsOrg[]; + total_count: number; } -export type AppsListAccountsForPlanStubbedData = MarketplacePurchase[]; - -export interface AppsListAccountsForPlanStubbedParams { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: DirectionEnum2; +export interface ActionsListSelfHostedRunnerGroupsForOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -14108,39 +14600,15 @@ export interface AppsListAccountsForPlanStubbedParams { * @default 30 */ per_page?: number; - /** plan_id parameter */ - planId: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: SortEnum2; -} - -/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum AppsListAccountsForPlanStubbedParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum AppsListAccountsForPlanStubbedParams1SortEnum { - Created = "created", - Updated = "updated", } -export interface AppsListInstallationReposForAuthenticatedUserData { - repositories: Repository[]; - repository_selection?: string; +export interface ActionsListSelfHostedRunnersForOrgData { + runners: Runner[]; total_count: number; } -export interface AppsListInstallationReposForAuthenticatedUserParams { - /** installation_id parameter */ - installationId: number; +export interface ActionsListSelfHostedRunnersForOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -14153,14 +14621,13 @@ export interface AppsListInstallationReposForAuthenticatedUserParams { per_page?: number; } -export type AppsListInstallationsData = Installation[]; - -export interface AppsListInstallationsForAuthenticatedUserData { - installations: Installation[]; +export interface ActionsListSelfHostedRunnersForRepoData { + runners: Runner[]; total_count: number; } -export interface AppsListInstallationsForAuthenticatedUserParams { +export interface ActionsListSelfHostedRunnersForRepoParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -14171,27 +14638,16 @@ export interface AppsListInstallationsForAuthenticatedUserParams { * @default 30 */ per_page?: number; + repo: string; } -export interface AppsListInstallationsParams { - outdated?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; +export interface ActionsListSelfHostedRunnersInGroupForOrgData { + runners: Runner[]; + total_count: number; } -export type AppsListPlansData = MarketplaceListingPlan[]; - -export interface AppsListPlansParams { +export interface ActionsListSelfHostedRunnersInGroupForOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -14202,11 +14658,17 @@ export interface AppsListPlansParams { * @default 30 */ per_page?: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type AppsListPlansStubbedData = MarketplaceListingPlan[]; +export interface ActionsListWorkflowRunArtifactsData { + artifacts: Artifact[]; + total_count: number; +} -export interface AppsListPlansStubbedParams { +export interface ActionsListWorkflowRunArtifactsParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -14217,16 +14679,28 @@ export interface AppsListPlansStubbedParams { * @default 30 */ per_page?: number; + repo: string; + runId: number; } -export interface AppsListReposAccessibleToInstallationData { - repositories: Repository[]; - /** @example "selected" */ - repository_selection?: string; +export interface ActionsListWorkflowRunsData { total_count: number; + workflow_runs: WorkflowRun[]; } -export interface AppsListReposAccessibleToInstallationParams { +export interface ActionsListWorkflowRunsForRepoData { + total_count: number; + workflow_runs: WorkflowRun[]; +} + +export interface ActionsListWorkflowRunsForRepoParams { + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -14237,12 +14711,26 @@ export interface AppsListReposAccessibleToInstallationParams { * @default 30 */ per_page?: number; + repo: string; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: StatusEnum; } -export type AppsListSubscriptionsForAuthenticatedUserData = - UserMarketplacePurchase[]; +/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ +export enum ActionsListWorkflowRunsForRepoParams1StatusEnum { + Completed = "completed", + Status = "status", + Conclusion = "conclusion", +} -export interface AppsListSubscriptionsForAuthenticatedUserParams { +export interface ActionsListWorkflowRunsParams { + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -14253,3170 +14741,2497 @@ export interface AppsListSubscriptionsForAuthenticatedUserParams { * @default 30 */ per_page?: number; + repo: string; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: StatusEnum1; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; } -export type AppsListSubscriptionsForAuthenticatedUserStubbedData = - UserMarketplacePurchase[]; +/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ +export enum ActionsListWorkflowRunsParams1StatusEnum { + Completed = "completed", + Status = "status", + Conclusion = "conclusion", +} -export interface AppsListSubscriptionsForAuthenticatedUserStubbedParams { +export interface ActionsOrganizationPermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_repositories: EnabledRepositories; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; + /** The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when \`enabled_repositories\` is set to \`selected\`. */ + selected_repositories_url?: string; +} + +/** + * ActionsPublicKey + * The public key used for setting Actions Secrets. + */ +export interface ActionsPublicKey { + /** @example "2011-01-26T19:01:12Z" */ + created_at?: string; + /** @example 2 */ + id?: number; /** - * Page number of the results to fetch. - * @default 1 + * The Base64 encoded public key. + * @example "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=" */ - page?: number; + key: string; /** - * Results per page (max 100) - * @default 30 + * The identifier for the key. + * @example "1234567" */ - per_page?: number; + key_id: string; + /** @example "ssh-rsa AAAAB3NzaC1yc2EAAA" */ + title?: string; + /** @example "https://api.github.com/user/keys/2" */ + url?: string; } -export type AppsRemoveRepoFromInstallationData = any; +export type ActionsReRunWorkflowData = any; -export interface AppsRemoveRepoFromInstallationParams { - /** installation_id parameter */ - installationId: number; - repositoryId: number; +export interface ActionsReRunWorkflowParams { + owner: string; + repo: string; + runId: number; } -export type AppsResetAuthorizationData = Authorization; +export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData = any; -export interface AppsResetAuthorizationParams { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; +export interface ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams { + org: string; + repositoryId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type AppsResetTokenData = Authorization; +export type ActionsRemoveSelectedRepoFromOrgSecretData = any; -export interface AppsResetTokenParams { - /** The client ID of your GitHub app. */ - clientId: string; +export interface ActionsRemoveSelectedRepoFromOrgSecretParams { + org: string; + repositoryId: number; + /** secret_name parameter */ + secretName: string; } -export interface AppsResetTokenPayload { - /** The access_token of the OAuth application. */ - access_token: string; +export type ActionsRemoveSelfHostedRunnerFromGroupForOrgData = any; + +export interface ActionsRemoveSelfHostedRunnerFromGroupForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -export type AppsRevokeAuthorizationForApplicationData = any; +export interface ActionsRepositoryPermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** Whether GitHub Actions is enabled on the repository. */ + enabled: ActionsEnabled; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; +} -export interface AppsRevokeAuthorizationForApplicationParams { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; +/** + * Actions Secret + * Set secrets for GitHub Actions. + */ +export interface ActionsSecret { + /** @format date-time */ + created_at: string; + /** + * The name of the secret. + * @example "SECRET_TOKEN" + */ + name: string; + /** @format date-time */ + updated_at: string; } -export type AppsRevokeGrantForApplicationData = any; +export type ActionsSetAllowedActionsOrganizationData = any; -export interface AppsRevokeGrantForApplicationParams { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; +export interface ActionsSetAllowedActionsOrganizationParams { + org: string; } -export type AppsRevokeInstallationAccessTokenData = any; +export type ActionsSetAllowedActionsRepositoryData = any; -export type AppsScopeTokenData = Authorization; +export interface ActionsSetAllowedActionsRepositoryParams { + owner: string; + repo: string; +} -export interface AppsScopeTokenParams { - /** The client ID of your GitHub app. */ - clientId: string; +export type ActionsSetGithubActionsPermissionsOrganizationData = any; + +export interface ActionsSetGithubActionsPermissionsOrganizationParams { + org: string; } -export interface AppsScopeTokenPayload { - /** - * **Required.** The OAuth access token used to authenticate to the GitHub API. - * @example "e72e16c7e42f292c6912e7710c838347ae178b4a" - */ - access_token?: string; - /** The permissions granted to the user-to-server access token. */ - permissions?: AppPermissions; - /** The list of repository IDs to scope the user-to-server access token to. \`repositories\` may not be specified if \`repository_ids\` is specified. */ - repositories?: string[]; - /** - * The list of repository names to scope the user-to-server access token to. \`repository_ids\` may not be specified if \`repositories\` is specified. - * @example [1] - */ - repository_ids?: number[]; - /** - * The name of the user or organization to scope the user-to-server access token to. **Required** unless \`target_id\` is specified. - * @example "octocat" - */ - target?: string; - /** - * The ID of the user or organization to scope the user-to-server access token to. **Required** unless \`target\` is specified. - * @example 1 - */ - target_id?: number; +export interface ActionsSetGithubActionsPermissionsOrganizationPayload { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_repositories: EnabledRepositories; } -export type AppsSuspendInstallationData = any; +export type ActionsSetGithubActionsPermissionsRepositoryData = any; -export interface AppsSuspendInstallationParams { - /** installation_id parameter */ - installationId: number; +export interface ActionsSetGithubActionsPermissionsRepositoryParams { + owner: string; + repo: string; } -export type AppsUnsuspendInstallationData = any; +export interface ActionsSetGithubActionsPermissionsRepositoryPayload { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** Whether GitHub Actions is enabled on the repository. */ + enabled: ActionsEnabled; +} -export interface AppsUnsuspendInstallationParams { - /** installation_id parameter */ - installationId: number; +export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData = any; + +export interface ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type AppsUpdateWebhookConfigForAppData = WebhookConfig; +export interface ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload { + /** List of repository IDs that can access the runner group. */ + selected_repository_ids: number[]; +} -/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ -export interface AppsUpdateWebhookConfigForAppPayload { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; +export type ActionsSetSelectedReposForOrgSecretData = any; + +export interface ActionsSetSelectedReposForOrgSecretParams { + org: string; + /** secret_name parameter */ + secretName: string; } -/** - * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. - * @default "not_archived" - */ -export enum ArchivedStateEnum { - All = "all", - Archived = "archived", - NotArchived = "not_archived", +export interface ActionsSetSelectedReposForOrgSecretPayload { + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: number[]; } -/** - * Artifact - * An artifact - */ -export interface Artifact { - /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip" */ - archive_download_url: string; - /** @format date-time */ - created_at: string | null; - /** Whether or not the artifact has expired. */ - expired: boolean; - /** @format date-time */ - expires_at: string; - /** @example 5 */ - id: number; - /** - * The name of the artifact. - * @example "AdventureWorks.Framework" - */ - name: string; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - /** - * The size in bytes of the artifact. - * @example 12345 - */ - size_in_bytes: number; - /** @format date-time */ - updated_at: string | null; - /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5" */ - url: string; +export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData = + any; + +export interface ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams { + org: string; } -export interface AuditLogEvent { - /** The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ - "@timestamp"?: number; - /** The name of the action that was performed, for example \`user.login\` or \`repo.create\`. */ - action?: string; - active?: boolean; - active_was?: boolean; - /** The actor who performed the action. */ - actor?: string; - /** The username of the account being blocked. */ - blocked_user?: string; - business?: string; - config?: any[]; - config_was?: any[]; - content_type?: string; - /** The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ - created_at?: number; - deploy_key_fingerprint?: string; - emoji?: string; - events?: any[]; - events_were?: any[]; - explanation?: string; - fingerprint?: string; - hook_id?: number; - limited_availability?: boolean; - message?: string; - name?: string; - old_user?: string; - openssh_public_key?: string; - org?: string; - previous_visibility?: string; - read_only?: boolean; - /** The name of the repository. */ - repo?: string; - /** The name of the repository. */ - repository?: string; - repository_public?: boolean; - target_login?: string; - team?: string; - /** The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ - transport_protocol?: number; - /** A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ - transport_protocol_name?: string; - /** The user that was affected by the action performed (if available). */ - user?: string; - /** The repository visibility, for example \`public\` or \`private\`. */ - visibility?: string; +export interface ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload { + /** List of repository IDs to enable for GitHub Actions. */ + selected_repository_ids: number[]; } -export type AuditLogGetAuditLogData = AuditLogEvent[]; +export type ActionsSetSelfHostedRunnersInGroupForOrgData = any; -export interface AuditLogGetAuditLogParams { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: IncludeEnum; - /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ - order?: OrderEnum; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; +export interface ActionsSetSelfHostedRunnersInGroupForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ -export enum AuditLogGetAuditLogParams1IncludeEnum { - Web = "web", - Git = "git", - All = "all", +export interface ActionsSetSelfHostedRunnersInGroupForOrgPayload { + /** List of runner IDs to add to the runner group. */ + runners: number[]; } -/** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ -export enum AuditLogGetAuditLogParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ActionsUpdateSelfHostedRunnerGroupForOrgData = RunnerGroupsOrg; + +export interface ActionsUpdateSelfHostedRunnerGroupForOrgParams { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * Authentication Token - * Authentication Token - */ -export interface AuthenticationToken { - /** - * The time this token expires - * @format date-time - * @example "2016-07-11T22:14:10Z" - */ - expires_at: string; - /** @example {"issues":"read","deployments":"write"} */ - permissions?: object; - /** The repositories this token has access to */ - repositories?: Repository[]; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection?: AuthenticationTokenRepositorySelectionEnum; - /** @example "config.yaml" */ - single_file?: string | null; - /** - * The token used for authentication - * @example "v1.1f699f1069f60xxx" - */ - token: string; +export interface ActionsUpdateSelfHostedRunnerGroupForOrgPayload { + /** Name of the runner group. */ + name?: string; + /** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ + visibility?: ActionsUpdateSelfHostedRunnerGroupForOrgVisibilityEnum; } -/** Describe whether all repositories have been selected or there's a selection involved */ -export enum AuthenticationTokenRepositorySelectionEnum { - All = "all", +/** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ +export enum ActionsUpdateSelfHostedRunnerGroupForOrgVisibilityEnum { Selected = "selected", + All = "all", + Private = "private", } -/** - * author_association - * How the author is associated with the repository. - * @example "OWNER" - */ -export enum AuthorAssociation { - COLLABORATOR = "COLLABORATOR", - CONTRIBUTOR = "CONTRIBUTOR", - FIRST_TIMER = "FIRST_TIMER", - FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR", - MANNEQUIN = "MANNEQUIN", - MEMBER = "MEMBER", - NONE = "NONE", - OWNER = "OWNER", -} +export type ActivityCheckRepoIsStarredByAuthenticatedUserData = any; -/** - * Authorization - * The authorization for an OAuth app, GitHub App, or a Personal Access Token. - */ -export interface Authorization { - app: { - client_id: string; - name: string; - /** @format uri */ - url: string; - }; - /** @format date-time */ - created_at: string; - fingerprint: string | null; - hashed_token: string | null; - id: number; - installation?: ScopedInstallation | null; - note: string | null; - /** @format uri */ - note_url: string | null; - /** A list of scopes that this authorization is in. */ - scopes: string[] | null; - token: string; - token_last_eight: string | null; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user?: SimpleUser | null; +export type ActivityCheckRepoIsStarredByAuthenticatedUserError = BasicError; + +export interface ActivityCheckRepoIsStarredByAuthenticatedUserParams { + owner: string; + repo: string; } -/** - * Auto merge - * The status of auto merging a pull request. - */ -export type AutoMerge = { - /** Commit message for the merge commit. */ - commit_message: string; - /** Title for the merge commit message. */ - commit_title: string; - /** Simple User */ - enabled_by: SimpleUser; - /** The merge method to use. */ - merge_method: AutoMergeMergeMethodEnum; -} | null; +export type ActivityDeleteRepoSubscriptionData = any; -/** The merge method to use. */ -export enum AutoMergeMergeMethodEnum { - Merge = "merge", - Squash = "squash", - Rebase = "rebase", +export interface ActivityDeleteRepoSubscriptionParams { + owner: string; + repo: string; } -/** Bad Request */ -export type BadRequest = BasicError; +export type ActivityDeleteThreadSubscriptionData = any; -/** - * Base Gist - * Base Gist - */ -export interface BaseGist { - comments: number; - /** @format uri */ - comments_url: string; - /** @format uri */ - commits_url: string; - /** @format date-time */ - created_at: string; - description: string | null; - files: Record< - string, - { - filename?: string; - language?: string; - raw_url?: string; - size?: number; - type?: string; - } - >; - forks?: any[]; - /** @format uri */ - forks_url: string; - /** @format uri */ - git_pull_url: string; - /** @format uri */ - git_push_url: string; - history?: any[]; - /** @format uri */ - html_url: string; - id: string; - node_id: string; - owner?: SimpleUser | null; - public: boolean; - truncated?: boolean; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user: SimpleUser | null; +export interface ActivityDeleteThreadSubscriptionParams { + /** thread_id parameter */ + threadId: number; } -/** - * Basic Error - * Basic Error - */ -export interface BasicError { - documentation_url?: string; - message?: string; +export type ActivityGetFeedsData = Feed; + +export type ActivityGetRepoSubscriptionData = RepositorySubscription; + +export interface ActivityGetRepoSubscriptionParams { + owner: string; + repo: string; } -export type BillingGetGithubActionsBillingGheData = ActionsBillingUsage; +export type ActivityGetThreadData = Thread; -export interface BillingGetGithubActionsBillingGheParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ActivityGetThreadParams { + /** thread_id parameter */ + threadId: number; } -export type BillingGetGithubActionsBillingOrgData = ActionsBillingUsage; +export type ActivityGetThreadSubscriptionForAuthenticatedUserData = + ThreadSubscription; -export interface BillingGetGithubActionsBillingOrgParams { - org: string; +export interface ActivityGetThreadSubscriptionForAuthenticatedUserParams { + /** thread_id parameter */ + threadId: number; } -export type BillingGetGithubActionsBillingUserData = ActionsBillingUsage; +export type ActivityListEventsForAuthenticatedUserData = Event[]; -export interface BillingGetGithubActionsBillingUserParams { +export interface ActivityListEventsForAuthenticatedUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; username: string; } -export type BillingGetGithubPackagesBillingGheData = PackagesBillingUsage; +export type ActivityListNotificationsForAuthenticatedUserData = Thread[]; -export interface BillingGetGithubPackagesBillingGheParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ActivityListNotificationsForAuthenticatedUserParams { + /** + * If \`true\`, show notifications marked as read. + * @default false + */ + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; } -export type BillingGetGithubPackagesBillingOrgData = PackagesBillingUsage; +export type ActivityListOrgEventsForAuthenticatedUserData = Event[]; -export interface BillingGetGithubPackagesBillingOrgParams { +export interface ActivityListOrgEventsForAuthenticatedUserParams { org: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + username: string; } -export type BillingGetGithubPackagesBillingUserData = PackagesBillingUsage; +export type ActivityListPublicEventsData = Event[]; -export interface BillingGetGithubPackagesBillingUserParams { - username: string; +export type ActivityListPublicEventsForRepoNetworkData = Event[]; + +export interface ActivityListPublicEventsForRepoNetworkParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -export type BillingGetSharedStorageBillingGheData = CombinedBillingUsage; +export type ActivityListPublicEventsForUserData = Event[]; -export interface BillingGetSharedStorageBillingGheParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ActivityListPublicEventsForUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + username: string; } -export type BillingGetSharedStorageBillingOrgData = CombinedBillingUsage; +export interface ActivityListPublicEventsParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} -export interface BillingGetSharedStorageBillingOrgParams { +export type ActivityListPublicOrgEventsData = Event[]; + +export interface ActivityListPublicOrgEventsParams { org: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export type BillingGetSharedStorageBillingUserData = CombinedBillingUsage; +export type ActivityListReceivedEventsForUserData = Event[]; -export interface BillingGetSharedStorageBillingUserParams { +export interface ActivityListReceivedEventsForUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; username: string; } -/** - * Blob - * Blob - */ -export interface Blob { - content: string; - encoding: string; - highlighted_content?: string; - node_id: string; - sha: string; - size: number | null; - /** @format uri */ - url: string; +export type ActivityListReceivedPublicEventsForUserData = Event[]; + +export interface ActivityListReceivedPublicEventsForUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + username: string; } -/** - * Branch Protection - * Branch Protection - */ -export interface BranchProtection { - allow_deletions?: { - enabled?: boolean; - }; - allow_force_pushes?: { - enabled?: boolean; - }; - enabled: boolean; - /** Protected Branch Admin Enforced */ - enforce_admins?: ProtectedBranchAdminEnforced; - /** @example ""branch/with/protection"" */ - name?: string; - /** @example ""https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection"" */ - protection_url?: string; - required_linear_history?: { - enabled?: boolean; - }; - /** Protected Branch Pull Request Review */ - required_pull_request_reviews?: ProtectedBranchPullRequestReview; - required_status_checks: { - contexts: string[]; - contexts_url?: string; - enforcement_level: string; - url?: string; - }; - /** Branch Restriction Policy */ - restrictions?: BranchRestrictionPolicy; - url?: string; +export type ActivityListRepoEventsData = Event[]; + +export interface ActivityListRepoEventsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Branch Restriction Policy - * Branch Restriction Policy - */ -export interface BranchRestrictionPolicy { - apps: { - created_at?: string; - description?: string; - events?: string[]; - external_url?: string; - html_url?: string; - id?: number; - name?: string; - node_id?: string; - owner?: { - avatar_url?: string; - description?: string; - events_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers"" */ - followers_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}"" */ - following_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}"" */ - gists_url?: string; - /** @example """" */ - gravatar_id?: string; - hooks_url?: string; - /** @example ""https://github.com/testorg-ea8ec76d71c3af4b"" */ - html_url?: string; - id?: number; - issues_url?: string; - login?: string; - members_url?: string; - node_id?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs"" */ - organizations_url?: string; - public_members_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events"" */ - received_events_url?: string; - repos_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}"" */ - starred_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions"" */ - subscriptions_url?: string; - /** @example ""Organization"" */ - type?: string; - url?: string; - }; - permissions?: { - contents?: string; - issues?: string; - metadata?: string; - single_file?: string; - }; - slug?: string; - updated_at?: string; - }[]; - /** @format uri */ - apps_url: string; - teams: { - description?: string | null; - html_url?: string; - id?: number; - members_url?: string; - name?: string; - node_id?: string; - parent?: string | null; - permission?: string; - privacy?: string; - repositories_url?: string; - slug?: string; - url?: string; - }[]; - /** @format uri */ - teams_url: string; - /** @format uri */ - url: string; - users: { - avatar_url?: string; - events_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string; - html_url?: string; - id?: number; - login?: string; - node_id?: string; - organizations_url?: string; - received_events_url?: string; - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - subscriptions_url?: string; - type?: string; - url?: string; - }[]; - /** @format uri */ - users_url: string; +export type ActivityListRepoNotificationsForAuthenticatedUserData = Thread[]; + +export interface ActivityListRepoNotificationsForAuthenticatedUserParams { + /** + * If \`true\`, show notifications marked as read. + * @default false + */ + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; +} + +export type ActivityListReposStarredByAuthenticatedUserData = Repository[]; + +export interface ActivityListReposStarredByAuthenticatedUserParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum17; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: SortEnum20; } /** - * Branch Short - * Branch Short + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ -export interface BranchShort { - commit: { - sha: string; - url: string; - }; - name: string; - protected: boolean; +export enum ActivityListReposStarredByAuthenticatedUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * Branch With Protection - * Branch With Protection + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export interface BranchWithProtection { - _links: { - html: string; - /** @format uri */ - self: string; - }; - /** Commit */ - commit: Commit; - name: string; - /** @example ""mas*"" */ - pattern?: string; - protected: boolean; - /** Branch Protection */ - protection: BranchProtection; - /** @format uri */ - protection_url: string; - /** @example 1 */ - required_approving_review_count?: number; +export enum ActivityListReposStarredByAuthenticatedUserParams1SortEnum { + Created = "created", + Updated = "updated", +} + +export type ActivityListReposStarredByUserData = Repository[]; + +export interface ActivityListReposStarredByUserParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum19; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: SortEnum22; + username: string; } /** - * Check Annotation - * Check Annotation + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ -export interface CheckAnnotation { - /** @example "warning" */ - annotation_level: string | null; - blob_href: string; - /** @example 10 */ - end_column: number | null; - /** @example 2 */ - end_line: number; - /** @example "Check your spelling for 'banaas'." */ - message: string | null; - /** @example "README.md" */ - path: string; - /** @example "Do you mean 'bananas' or 'banana'?" */ - raw_details: string | null; - /** @example 5 */ - start_column: number | null; - /** @example 2 */ - start_line: number; - /** @example "Spell Checker" */ - title: string | null; +export enum ActivityListReposStarredByUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * CheckRun - * A check performed on the code of a given code change + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export interface CheckRun { - app: Integration | null; - check_suite: { - id: number; - } | null; +export enum ActivityListReposStarredByUserParams1SortEnum { + Created = "created", + Updated = "updated", +} + +export type ActivityListReposWatchedByUserData = MinimalRepository[]; + +export interface ActivityListReposWatchedByUserParams { /** - * @format date-time - * @example "2018-05-04T01:14:52Z" + * Page number of the results to fetch. + * @default 1 */ - completed_at: string | null; - /** @example "neutral" */ - conclusion: CheckRunConclusionEnum | null; - /** @example "https://example.com" */ - details_url: string | null; - /** @example "42" */ - external_id: string | null; + page?: number; /** - * The SHA of the commit that is being checked. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * Results per page (max 100) + * @default 30 */ - head_sha: string; - /** @example "https://github.com/github/hello-world/runs/4" */ - html_url: string | null; + per_page?: number; + username: string; +} + +export type ActivityListStargazersForRepoData = SimpleUser[]; + +export interface ActivityListStargazersForRepoParams { + owner: string; /** - * The id of the check. - * @example 21 + * Page number of the results to fetch. + * @default 1 */ - id: number; + page?: number; /** - * The name of the check. - * @example "test-coverage" + * Results per page (max 100) + * @default 30 */ - name: string; - /** @example "MDg6Q2hlY2tSdW40" */ - node_id: string; - output: { - annotations_count: number; - /** @format uri */ - annotations_url: string; - summary: string | null; - text: string | null; - title: string | null; - }; - pull_requests: PullRequestMinimal[]; + per_page?: number; + repo: string; +} + +export type ActivityListWatchedReposForAuthenticatedUserData = + MinimalRepository[]; + +export interface ActivityListWatchedReposForAuthenticatedUserParams { /** - * @format date-time - * @example "2018-05-04T01:14:52Z" + * Page number of the results to fetch. + * @default 1 */ - started_at: string | null; + page?: number; /** - * The phase of the lifecycle that the check is currently in. - * @example "queued" + * Results per page (max 100) + * @default 30 */ - status: CheckRunStatusEnum; - /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ - url: string; + per_page?: number; } -/** @example "neutral" */ -export enum CheckRunConclusionEnum { - Success = "success", - Failure = "failure", - Neutral = "neutral", - Cancelled = "cancelled", - Skipped = "skipped", - TimedOut = "timed_out", - ActionRequired = "action_required", +export type ActivityListWatchersForRepoData = SimpleUser[]; + +export interface ActivityListWatchersForRepoParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * The phase of the lifecycle that the check is currently in. - * @example "queued" - */ -export enum CheckRunStatusEnum { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +export interface ActivityMarkNotificationsAsReadData { + message?: string; } -/** - * CheckSuite - * A suite of checks performed on the code of a given code change - */ -export interface CheckSuite { - /** @example "d6fde92930d4715a2b49857d24b940956b26d2d3" */ - after: string | null; - app: Integration | null; - /** @example "146e867f55c26428e5f9fade55a9bbf5e95a7912" */ - before: string | null; - check_runs_url: string; - /** @example "neutral" */ - conclusion: CheckSuiteConclusionEnum | null; - /** @format date-time */ - created_at: string | null; - /** @example "master" */ - head_branch: string | null; - /** Simple Commit */ - head_commit: SimpleCommit; +export interface ActivityMarkNotificationsAsReadPayload { /** - * The SHA of the head commit that is being checked. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * Describes the last point that notifications were checked. + * @format date-time */ - head_sha: string; - /** @example 5 */ - id: number; - latest_check_runs_count: number; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - pull_requests: PullRequestMinimal[] | null; - /** Minimal Repository */ - repository: MinimalRepository; - /** @example "completed" */ - status: CheckSuiteStatusEnum | null; - /** @format date-time */ - updated_at: string | null; - /** @example "https://api.github.com/repos/github/hello-world/check-suites/5" */ - url: string | null; + last_read_at?: string; + /** Whether the notification has been read. */ + read?: boolean; } -/** @example "neutral" */ -export enum CheckSuiteConclusionEnum { - Success = "success", - Failure = "failure", - Neutral = "neutral", - Cancelled = "cancelled", - Skipped = "skipped", - TimedOut = "timed_out", - ActionRequired = "action_required", -} +export type ActivityMarkRepoNotificationsAsReadData = any; -/** - * Check Suite Preference - * Check suite configuration preferences for a repository. - */ -export interface CheckSuitePreference { - preferences: { - auto_trigger_checks?: { - app_id: number; - setting: boolean; - }[]; - }; - /** A git repository */ - repository: Repository; +export interface ActivityMarkRepoNotificationsAsReadParams { + owner: string; + repo: string; } -/** @example "completed" */ -export enum CheckSuiteStatusEnum { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +export interface ActivityMarkRepoNotificationsAsReadPayload { + /** Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. Default: The current timestamp. */ + last_read_at?: string; } -/** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ -export enum ChecksCreateAnnotationLevelEnum { - Notice = "notice", - Warning = "warning", - Failure = "failure", -} +export type ActivityMarkThreadAsReadData = any; -/** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. - */ -export enum ChecksCreateConclusionEnum { - Success = "success", - Failure = "failure", - Neutral = "neutral", - Cancelled = "cancelled", - Skipped = "skipped", - TimedOut = "timed_out", - ActionRequired = "action_required", +export interface ActivityMarkThreadAsReadParams { + /** thread_id parameter */ + threadId: number; } -export type ChecksCreateData = CheckRun; +export type ActivitySetRepoSubscriptionData = RepositorySubscription; -export interface ChecksCreateParams { +export interface ActivitySetRepoSubscriptionParams { owner: string; repo: string; } -export type ChecksCreatePayload = ( - | { - status?: ChecksCreateStatusEnum; - [key: string]: any; - } - | { - status?: ChecksCreateStatusEnum1; - [key: string]: any; - } -) & { - /** - * Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [\`check_run.requested_action\` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." - * @maxItems 3 - */ - actions?: { - /** - * A short explanation of what this action would do. The maximum size is 40 characters. - * @maxLength 40 - */ - description: string; - /** - * A reference for the action on the integrator's system. The maximum size is 20 characters. - * @maxLength 20 - */ - identifier: string; - /** - * The text to be displayed on a button in the web UI. The maximum size is 20 characters. - * @maxLength 20 - */ - label: string; - }[]; - /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - completed_at?: string; - /** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. - */ - conclusion?: ChecksCreateConclusionEnum; - /** The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. */ - details_url?: string; - /** A reference for the run on the integrator's system. */ - external_id?: string; - /** The SHA of the commit. */ - head_sha: string; - /** The name of the check. For example, "code-coverage". */ - name: string; - /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object) description. */ - output?: { - /** - * Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter. - * @maxItems 50 - */ - annotations?: { - /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ - annotation_level: ChecksCreateAnnotationLevelEnum; - /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - end_column?: number; - /** The end line of the annotation. */ - end_line: number; - /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ - message: string; - /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ - path: string; - /** Details about this annotation. The maximum size is 64 KB. */ - raw_details?: string; - /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - start_column?: number; - /** The start line of the annotation. */ - start_line: number; - /** The title that represents the annotation. The maximum size is 255 characters. */ - title?: string; - }[]; - /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#images-object) description for details. */ - images?: { - /** The alternative text for the image. */ - alt: string; - /** A short image description. */ - caption?: string; - /** The full URL of the image. */ - image_url: string; - }[]; - /** - * The summary of the check run. This parameter supports Markdown. - * @maxLength 65535 - */ - summary: string; - /** - * The details of the check run. This parameter supports Markdown. - * @maxLength 65535 - */ - text?: string; - /** The title of the check run. */ - title: string; - }; - /** The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - started_at?: string; - /** - * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. - * @default "queued" - */ - status?: ChecksCreateStatusEnum2; -}; - -export enum ChecksCreateStatusEnum { - Completed = "completed", -} - -export enum ChecksCreateStatusEnum1 { - Queued = "queued", - InProgress = "in_progress", -} - -/** - * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. - * @default "queued" - */ -export enum ChecksCreateStatusEnum2 { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +export interface ActivitySetRepoSubscriptionPayload { + /** Determines if all notifications should be blocked from this repository. */ + ignored?: boolean; + /** Determines if notifications should be received from this repository. */ + subscribed?: boolean; } -export type ChecksCreateSuiteData = CheckSuite; +export type ActivitySetThreadSubscriptionData = ThreadSubscription; -export interface ChecksCreateSuiteParams { - owner: string; - repo: string; +export interface ActivitySetThreadSubscriptionParams { + /** thread_id parameter */ + threadId: number; } -export interface ChecksCreateSuitePayload { - /** The sha of the head commit. */ - head_sha: string; +export interface ActivitySetThreadSubscriptionPayload { + /** + * Whether to block all notifications from a thread. + * @default false + */ + ignored?: boolean; } -export type ChecksGetData = CheckRun; +export type ActivityStarRepoForAuthenticatedUserData = any; -export interface ChecksGetParams { - /** check_run_id parameter */ - checkRunId: number; +export interface ActivityStarRepoForAuthenticatedUserParams { owner: string; repo: string; } -export type ChecksGetSuiteData = CheckSuite; +export type ActivityUnstarRepoForAuthenticatedUserData = any; -export interface ChecksGetSuiteParams { - /** check_suite_id parameter */ - checkSuiteId: number; +export interface ActivityUnstarRepoForAuthenticatedUserParams { owner: string; repo: string; } -export type ChecksListAnnotationsData = CheckAnnotation[]; - -export interface ChecksListAnnotationsParams { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +/** + * Actor + * Actor + */ +export interface Actor { + /** @format uri */ + avatar_url: string; + display_login?: string; + gravatar_id: string | null; + id: number; + login: string; + /** @format uri */ + url: string; } -export interface ChecksListForRefData { - check_runs: CheckRun[]; - total_count: number; +/** + * Filters the collaborators by their affiliation. Can be one of: + * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. + * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ +export enum AffiliationEnum { + Outside = "outside", + Direct = "direct", + All = "all", } -export interface ChecksListForRefParams { - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: FilterEnum6; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** ref+ parameter */ - ref: string; - repo: string; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: StatusEnum3; +/** + * Filter collaborators returned by their affiliation. Can be one of: + * \\* \`outside\`: All outside collaborators of an organization-owned repository. + * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ +export enum AffiliationEnum1 { + Outside = "outside", + Direct = "direct", + All = "all", } /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" + * The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ -export enum ChecksListForRefParams1FilterEnum { - Latest = "latest", +export type AlertCreatedAt = string; + +/** + * The GitHub URL of the alert resource. + * @format uri + */ +export type AlertHtmlUrl = string; + +/** The security alert number. */ +export type AlertNumber = number; + +/** + * The REST API URL of the alert resource. + * @format uri + */ +export type AlertUrl = string; + +/** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ +export enum AllowedActions { All = "all", + LocalOnly = "local_only", + Selected = "selected", } -/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ -export enum ChecksListForRefParams1StatusEnum { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +/** + * Api Overview + * Api Overview + */ +export interface ApiOverview { + /** @example ["13.64.0.0/16","13.65.0.0/16"] */ + actions?: string[]; + /** @example ["127.0.0.1/32"] */ + api?: string[]; + /** @example ["127.0.0.1/32"] */ + git?: string[]; + /** @example ["127.0.0.1/32"] */ + hooks?: string[]; + /** @example ["54.158.161.132","54.226.70.38"] */ + importer?: string[]; + /** @example ["192.30.252.153/32","192.30.252.154/32"] */ + pages?: string[]; + ssh_key_fingerprints?: { + SHA256_DSA?: string; + SHA256_RSA?: string; + }; + /** @example true */ + verifiable_password_authentication: boolean; + /** @example ["127.0.0.1/32"] */ + web?: string[]; } -export interface ChecksListForSuiteData { - check_runs: CheckRun[]; - total_count: number; +/** + * App Permissions + * The permissions granted to the user-to-server access token. + * @example {"contents":"read","issues":"read","deployments":"write","single_file":"read"} + */ +export interface AppPermissions { + /** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ + actions?: AppPermissionsActionsEnum; + /** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ + administration?: AppPermissionsAdministrationEnum; + /** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ + checks?: AppPermissionsChecksEnum; + /** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ + content_references?: AppPermissionsContentReferencesEnum; + /** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ + contents?: AppPermissionsContentsEnum; + /** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ + deployments?: AppPermissionsDeploymentsEnum; + /** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ + environments?: AppPermissionsEnvironmentsEnum; + /** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ + issues?: AppPermissionsIssuesEnum; + /** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ + members?: AppPermissionsMembersEnum; + /** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ + metadata?: AppPermissionsMetadataEnum; + /** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ + organization_administration?: AppPermissionsOrganizationAdministrationEnum; + /** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ + organization_hooks?: AppPermissionsOrganizationHooksEnum; + /** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ + organization_plan?: AppPermissionsOrganizationPlanEnum; + /** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ + organization_projects?: AppPermissionsOrganizationProjectsEnum; + /** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ + organization_secrets?: AppPermissionsOrganizationSecretsEnum; + /** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ + organization_self_hosted_runners?: AppPermissionsOrganizationSelfHostedRunnersEnum; + /** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ + organization_user_blocking?: AppPermissionsOrganizationUserBlockingEnum; + /** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ + packages?: AppPermissionsPackagesEnum; + /** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ + pages?: AppPermissionsPagesEnum; + /** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ + pull_requests?: AppPermissionsPullRequestsEnum; + /** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ + repository_hooks?: AppPermissionsRepositoryHooksEnum; + /** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ + repository_projects?: AppPermissionsRepositoryProjectsEnum; + /** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ + secret_scanning_alerts?: AppPermissionsSecretScanningAlertsEnum; + /** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ + secrets?: AppPermissionsSecretsEnum; + /** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ + security_events?: AppPermissionsSecurityEventsEnum; + /** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ + single_file?: AppPermissionsSingleFileEnum; + /** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ + statuses?: AppPermissionsStatusesEnum; + /** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ + team_discussions?: AppPermissionsTeamDiscussionsEnum; + /** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ + vulnerability_alerts?: AppPermissionsVulnerabilityAlertsEnum; + /** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ + workflows?: AppPermissionsWorkflowsEnum; } -export interface ChecksListForSuiteParams { - /** check_suite_id parameter */ - checkSuiteId: number; - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: FilterEnum5; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: StatusEnum2; +/** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsActionsEnum { + Read = "read", + Write = "write", } -/** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ -export enum ChecksListForSuiteParams1FilterEnum { - Latest = "latest", - All = "all", +/** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsAdministrationEnum { + Read = "read", + Write = "write", } -/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ -export enum ChecksListForSuiteParams1StatusEnum { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +/** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsChecksEnum { + Read = "read", + Write = "write", } -export interface ChecksListSuitesForRefData { - check_suites: CheckSuite[]; - total_count: number; +/** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsContentReferencesEnum { + Read = "read", + Write = "write", } -export interface ChecksListSuitesForRefParams { - /** - * Filters check suites by GitHub App \`id\`. - * @example 1 - */ - app_id?: number; - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** ref+ parameter */ - ref: string; - repo: string; +/** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsContentsEnum { + Read = "read", + Write = "write", } -export type ChecksRerequestSuiteData = any; +/** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsDeploymentsEnum { + Read = "read", + Write = "write", +} -export interface ChecksRerequestSuiteParams { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; +/** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsEnvironmentsEnum { + Read = "read", + Write = "write", } -export type ChecksSetSuitesPreferencesData = CheckSuitePreference; +/** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsIssuesEnum { + Read = "read", + Write = "write", +} -export interface ChecksSetSuitesPreferencesParams { - owner: string; - repo: string; +/** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsMembersEnum { + Read = "read", + Write = "write", } -export interface ChecksSetSuitesPreferencesPayload { - /** Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [\`auto_trigger_checks\` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ - auto_trigger_checks?: { - /** The \`id\` of the GitHub App. */ - app_id: number; - /** - * Set to \`true\` to enable automatic creation of CheckSuite events upon pushes to the repository, or \`false\` to disable them. - * @default true - */ - setting: boolean; - }[]; +/** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsMetadataEnum { + Read = "read", + Write = "write", } -/** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ -export enum ChecksUpdateAnnotationLevelEnum { - Notice = "notice", - Warning = "warning", - Failure = "failure", +/** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsOrganizationAdministrationEnum { + Read = "read", + Write = "write", } -/** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. - */ -export enum ChecksUpdateConclusionEnum { - Success = "success", - Failure = "failure", - Neutral = "neutral", - Cancelled = "cancelled", - Skipped = "skipped", - TimedOut = "timed_out", - ActionRequired = "action_required", +/** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsOrganizationHooksEnum { + Read = "read", + Write = "write", } -export type ChecksUpdateData = CheckRun; +/** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ +export enum AppPermissionsOrganizationPlanEnum { + Read = "read", +} -export interface ChecksUpdateParams { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; +/** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ +export enum AppPermissionsOrganizationProjectsEnum { + Read = "read", + Write = "write", + Admin = "admin", } -export type ChecksUpdatePayload = ( - | { - status?: ChecksUpdateStatusEnum; - [key: string]: any; - } - | { - status?: ChecksUpdateStatusEnum1; - [key: string]: any; - } -) & { - /** - * Possible further actions the integrator can perform, which a user may trigger. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." - * @maxItems 3 - */ - actions?: { - /** - * A short explanation of what this action would do. The maximum size is 40 characters. - * @maxLength 40 - */ - description: string; - /** - * A reference for the action on the integrator's system. The maximum size is 20 characters. - * @maxLength 20 - */ - identifier: string; - /** - * The text to be displayed on a button in the web UI. The maximum size is 20 characters. - * @maxLength 20 - */ - label: string; - }[]; - /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - completed_at?: string; - /** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. - */ - conclusion?: ChecksUpdateConclusionEnum; - /** The URL of the integrator's site that has the full details of the check. */ - details_url?: string; - /** A reference for the run on the integrator's system. */ - external_id?: string; - /** The name of the check. For example, "code-coverage". */ - name?: string; - /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object-1) description. */ - output?: { - /** - * Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. - * @maxItems 50 - */ - annotations?: { - /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ - annotation_level: ChecksUpdateAnnotationLevelEnum; - /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - end_column?: number; - /** The end line of the annotation. */ - end_line: number; - /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ - message: string; - /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ - path: string; - /** Details about this annotation. The maximum size is 64 KB. */ - raw_details?: string; - /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - start_column?: number; - /** The start line of the annotation. */ - start_line: number; - /** The title that represents the annotation. The maximum size is 255 characters. */ - title?: string; - }[]; - /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ - images?: { - /** The alternative text for the image. */ - alt: string; - /** A short image description. */ - caption?: string; - /** The full URL of the image. */ - image_url: string; - }[]; - /** - * Can contain Markdown. - * @maxLength 65535 - */ - summary: string; - /** - * Can contain Markdown. - * @maxLength 65535 - */ - text?: string; - /** **Required**. */ - title?: string; - }; - /** This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - started_at?: string; - /** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: ChecksUpdateStatusEnum2; -}; - -export enum ChecksUpdateStatusEnum { - Completed = "completed", +/** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsOrganizationSecretsEnum { + Read = "read", + Write = "write", } -export enum ChecksUpdateStatusEnum1 { - Queued = "queued", - InProgress = "in_progress", +/** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsOrganizationSelfHostedRunnersEnum { + Read = "read", + Write = "write", } -/** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ -export enum ChecksUpdateStatusEnum2 { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +/** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsOrganizationUserBlockingEnum { + Read = "read", + Write = "write", } -/** - * Clone Traffic - * Clone Traffic - */ -export interface CloneTraffic { - clones: Traffic[]; - /** @example 173 */ - count: number; - /** @example 128 */ - uniques: number; +/** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsPackagesEnum { + Read = "read", + Write = "write", } -/** - * Code Frequency Stat - * Code Frequency Stat - */ -export type CodeFrequencyStat = number[]; - -/** - * Code Of Conduct - * Code Of Conduct - */ -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; - /** @format uri */ - html_url: string | null; - /** @example "contributor_covenant" */ - key: string; - /** @example "Contributor Covenant" */ - name: string; - /** - * @format uri - * @example "https://api.github.com/codes_of_conduct/contributor_covenant" - */ - url: string; +/** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsPagesEnum { + Read = "read", + Write = "write", } -/** - * Code Of Conduct Simple - * Code of Conduct Simple - */ -export interface CodeOfConductSimple { - /** @format uri */ - html_url: string | null; - /** @example "citizen_code_of_conduct" */ - key: string; - /** @example "Citizen Code of Conduct" */ - name: string; - /** - * @format uri - * @example "https://api.github.com/codes_of_conduct/citizen_code_of_conduct" - */ - url: string; +/** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsPullRequestsEnum { + Read = "read", + Write = "write", } -export interface CodeScanningAlertCodeScanningAlert { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: AlertCreatedAt; - /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - dismissed_at: CodeScanningAlertDismissedAt; - /** Simple User */ - dismissed_by: SimpleUser; - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason: CodeScanningAlertDismissedReason; - /** The GitHub URL of the alert resource. */ - html_url: AlertHtmlUrl; - instances: CodeScanningAlertInstances; - /** The security alert number. */ - number: AlertNumber; - rule: CodeScanningAlertRule; - /** State of a code scanning alert. */ - state: CodeScanningAlertState; - tool: CodeScanningAnalysisTool; - /** The REST API URL of the alert resource. */ - url: AlertUrl; +/** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsRepositoryHooksEnum { + Read = "read", + Write = "write", } -export interface CodeScanningAlertCodeScanningAlertItems { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: AlertCreatedAt; - /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - dismissed_at: CodeScanningAlertDismissedAt; - /** Simple User */ - dismissed_by: SimpleUser; - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason: CodeScanningAlertDismissedReason; - /** The GitHub URL of the alert resource. */ - html_url: AlertHtmlUrl; - /** The security alert number. */ - number: AlertNumber; - rule: CodeScanningAlertRule; - /** State of a code scanning alert. */ - state: CodeScanningAlertState; - tool: CodeScanningAnalysisTool; - /** The REST API URL of the alert resource. */ - url: AlertUrl; +/** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ +export enum AppPermissionsRepositoryProjectsEnum { + Read = "read", + Write = "write", + Admin = "admin", } -/** - * The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time - */ -export type CodeScanningAlertDismissedAt = string | null; - -/** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ -export type CodeScanningAlertDismissedReason = - CodeScanningAlertDismissedReasonEnum | null; - -export enum CodeScanningAlertDismissedReasonEnum { - FalsePositive = "false positive", - WontFix = "won't fix", - UsedInTests = "used in tests", +/** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsSecretScanningAlertsEnum { + Read = "read", + Write = "write", } -/** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ -export type CodeScanningAlertEnvironment = string; - -export type CodeScanningAlertInstances = - | { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key?: CodeScanningAnalysisAnalysisKey; - /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ - environment?: CodeScanningAlertEnvironment; - matrix_vars?: string | null; - /** The full Git reference, formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** State of a code scanning alert. */ - state?: CodeScanningAlertState; - }[] - | null; - -/** The full Git reference, formatted as \`refs/heads/\`. */ -export type CodeScanningAlertRef = string; - -export interface CodeScanningAlertRule { - /** A short description of the rule used to detect the alert. */ - description?: string; - /** A unique identifier for the rule used to detect the alert. */ - id?: string | null; - /** The severity of the alert. */ - severity?: CodeScanningAlertRuleSeverityEnum | null; +/** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsSecretsEnum { + Read = "read", + Write = "write", } -/** The severity of the alert. */ -export enum CodeScanningAlertRuleSeverityEnum { - None = "none", - Note = "note", - Warning = "warning", - Error = "error", +/** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsSecurityEventsEnum { + Read = "read", + Write = "write", } -/** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ -export enum CodeScanningAlertSetState { - Open = "open", - Dismissed = "dismissed", +/** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsSingleFileEnum { + Read = "read", + Write = "write", } -/** State of a code scanning alert. */ -export enum CodeScanningAlertState { - Open = "open", - Dismissed = "dismissed", - Fixed = "fixed", +/** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsStatusesEnum { + Read = "read", + Write = "write", } -/** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ -export type CodeScanningAnalysisAnalysisKey = string; +/** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ +export enum AppPermissionsTeamDiscussionsEnum { + Read = "read", + Write = "write", +} -export interface CodeScanningAnalysisCodeScanningAnalysis { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key: CodeScanningAnalysisAnalysisKey; - /** The commit SHA of the code scanning analysis file. */ - commit_sha: CodeScanningAnalysisCommitSha; - /** The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: CodeScanningAnalysisCreatedAt; - /** Identifies the variable values associated with the environment in which this analysis was performed. */ - environment: CodeScanningAnalysisEnvironment; - /** @example "error reading field xyz" */ - error: string; - /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ - ref: CodeScanningAnalysisRef; - /** The name of the tool used to generate the code scanning analysis alert. */ - tool_name: CodeScanningAnalysisToolName; +/** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ +export enum AppPermissionsVulnerabilityAlertsEnum { + Read = "read", } -/** - * The commit SHA of the code scanning analysis file. - * @minLength 40 - * @maxLength 40 - * @pattern ^[0-9a-fA-F]+$ - */ -export type CodeScanningAnalysisCommitSha = string; +/** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ +export enum AppPermissionsWorkflowsEnum { + Write = "write", +} /** - * The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time + * Application Grant + * The authorization associated with an OAuth Access. */ -export type CodeScanningAnalysisCreatedAt = string; - -/** Identifies the variable values associated with the environment in which this analysis was performed. */ -export type CodeScanningAnalysisEnvironment = string; - -/** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ -export type CodeScanningAnalysisRef = string; - -/** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ -export type CodeScanningAnalysisSarifFile = string; - -export interface CodeScanningAnalysisTool { - /** The name of the tool used to generate the code scanning analysis alert. */ - name?: CodeScanningAnalysisToolName; - /** The version of the tool used to detect the alert. */ - version?: string | null; -} - -/** The name of the tool used to generate the code scanning analysis alert. */ -export type CodeScanningAnalysisToolName = string; - -export type CodeScanningGetAlertData = CodeScanningAlertCodeScanningAlert; - -export interface CodeScanningGetAlertParams { - alertNumber: number; - owner: string; - repo: string; +export interface ApplicationGrant { + app: { + client_id: string; + name: string; + /** @format uri */ + url: string; + }; + /** + * @format date-time + * @example "2011-09-06T17:26:27Z" + */ + created_at: string; + /** @example 1 */ + id: number; + /** @example ["public_repo"] */ + scopes: string[]; + /** + * @format date-time + * @example "2011-09-06T20:39:23Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/applications/grants/1" + */ + url: string; + user?: SimpleUser | null; } -export type CodeScanningListAlertsForRepoData = - CodeScanningAlertCodeScanningAlertItems[]; +export type AppsAddRepoToInstallationData = any; -export interface CodeScanningListAlertsForRepoParams { - owner: string; - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - repo: string; - /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ - state?: CodeScanningAlertState; +export interface AppsAddRepoToInstallationParams { + /** installation_id parameter */ + installationId: number; + repositoryId: number; } -export type CodeScanningListRecentAnalysesData = - CodeScanningAnalysisCodeScanningAnalysis[]; +export type AppsCheckAuthorizationData = Authorization | null; -export interface CodeScanningListRecentAnalysesParams { - owner: string; - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAnalysisRef; - repo: string; - /** Set a single code scanning tool name to filter alerts by tool. */ - tool_name?: CodeScanningAnalysisToolName; +export interface AppsCheckAuthorizationParams { + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; } -export type CodeScanningUpdateAlertData = CodeScanningAlertCodeScanningAlert; +export type AppsCheckTokenData = Authorization; -export interface CodeScanningUpdateAlertParams { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; - owner: string; - repo: string; +export interface AppsCheckTokenParams { + /** The client ID of your GitHub app. */ + clientId: string; } -export interface CodeScanningUpdateAlertPayload { - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason?: CodeScanningAlertDismissedReason; - /** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ - state: CodeScanningAlertSetState; +export interface AppsCheckTokenPayload { + /** The access_token of the OAuth application. */ + access_token: string; } -export type CodeScanningUploadSarifData = any; +export type AppsCreateContentAttachmentData = ContentReferenceAttachment; -export interface CodeScanningUploadSarifParams { - owner: string; - repo: string; +export interface AppsCreateContentAttachmentParams { + contentReferenceId: number; } -export interface CodeScanningUploadSarifPayload { +export interface AppsCreateContentAttachmentPayload { /** - * The base directory used in the analysis, as it appears in the SARIF file. - * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. - * @format uri - * @example "file:///github/workspace/" + * The body of the attachment + * @maxLength 262144 + * @example "Body of the attachment" */ - checkout_uri?: string; - /** The commit SHA of the code scanning analysis file. */ - commit_sha: CodeScanningAnalysisCommitSha; - /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ - ref: CodeScanningAnalysisRef; - /** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ - sarif: CodeScanningAnalysisSarifFile; + body: string; /** - * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date + * The title of the attachment + * @maxLength 1024 + * @example "Title of the attachment" */ - started_at?: string; - /** The name of the tool used to generate the code scanning analysis alert. */ - tool_name: CodeScanningAnalysisToolName; + title: string; } -/** - * Code Search Result Item - * Code Search Result Item - */ -export interface CodeSearchResultItem { - file_size?: number; - /** @format uri */ - git_url: string; - /** @format uri */ - html_url: string; - language?: string | null; - /** @format date-time */ - last_modified_at?: string; - /** @example ["73..77","77..78"] */ - line_numbers?: string[]; - name: string; - path: string; - /** Minimal Repository */ - repository: MinimalRepository; - score: number; - sha: string; - text_matches?: SearchResultTextMatches; - /** @format uri */ - url: string; +export type AppsCreateFromManifestData = Integration & { + client_id: string; + client_secret: string; + pem: string; + webhook_secret: string; + [key: string]: any; +}; + +export interface AppsCreateFromManifestParams { + code: string; } -export type CodesOfConductGetAllCodesOfConductData = CodeOfConduct[]; +export type AppsCreateInstallationAccessTokenData = InstallationToken; -export type CodesOfConductGetConductCodeData = CodeOfConduct; +export interface AppsCreateInstallationAccessTokenParams { + /** installation_id parameter */ + installationId: number; +} -export interface CodesOfConductGetConductCodeParams { - key: string; +export interface AppsCreateInstallationAccessTokenPayload { + /** The permissions granted to the user-to-server access token. */ + permissions?: AppPermissions; + /** List of repository names that the token should have access to */ + repositories?: string[]; + /** + * List of repository IDs that the token should have access to + * @example [1] + */ + repository_ids?: number[]; } -export type CodesOfConductGetForRepoData = CodeOfConduct; +export type AppsDeleteAuthorizationData = any; -export interface CodesOfConductGetForRepoParams { +export interface AppsDeleteAuthorizationParams { + /** The client ID of your GitHub app. */ + clientId: string; +} + +export interface AppsDeleteAuthorizationPayload { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; +} + +export type AppsDeleteInstallationData = any; + +export interface AppsDeleteInstallationParams { + /** installation_id parameter */ + installationId: number; +} + +export type AppsDeleteTokenData = any; + +export interface AppsDeleteTokenParams { + /** The client ID of your GitHub app. */ + clientId: string; +} + +export interface AppsDeleteTokenPayload { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; +} + +export type AppsGetAuthenticatedData = Integration; + +export type AppsGetBySlugData = Integration; + +export interface AppsGetBySlugParams { + appSlug: string; +} + +export type AppsGetInstallationData = Installation; + +export interface AppsGetInstallationParams { + /** installation_id parameter */ + installationId: number; +} + +export type AppsGetOrgInstallationData = Installation; + +export interface AppsGetOrgInstallationParams { + org: string; +} + +export type AppsGetRepoInstallationData = Installation; + +export interface AppsGetRepoInstallationParams { owner: string; repo: string; } -/** - * Collaborator - * Collaborator - */ -export interface Collaborator { - /** - * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" - */ - avatar_url: string; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ - events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/followers" - */ - followers_url: string; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; +export type AppsGetSubscriptionPlanForAccountData = MarketplacePurchase; + +export type AppsGetSubscriptionPlanForAccountError = BasicError; + +export interface AppsGetSubscriptionPlanForAccountParams { + /** account_id parameter */ + accountId: number; +} + +export type AppsGetSubscriptionPlanForAccountStubbedData = MarketplacePurchase; + +export interface AppsGetSubscriptionPlanForAccountStubbedParams { + /** account_id parameter */ + accountId: number; +} + +export type AppsGetUserInstallationData = Installation; + +export interface AppsGetUserInstallationParams { + username: string; +} + +export type AppsGetWebhookConfigForAppData = WebhookConfig; + +export type AppsListAccountsForPlanData = MarketplacePurchase[]; + +export interface AppsListAccountsForPlanParams { + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: DirectionEnum1; /** - * @format uri - * @example "https://github.com/octocat" + * Page number of the results to fetch. + * @default 1 */ - html_url: string; - /** @example 1 */ - id: number; - /** @example "octocat" */ - login: string; - /** @example "MDQ6VXNlcjE=" */ - node_id: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/users/octocat/orgs" + * Results per page (max 100) + * @default 30 */ - organizations_url: string; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; + per_page?: number; + /** plan_id parameter */ + planId: number; /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ - received_events_url: string; + sort?: SortEnum1; +} + +/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum AppsListAccountsForPlanParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} + +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum AppsListAccountsForPlanParams1SortEnum { + Created = "created", + Updated = "updated", +} + +export type AppsListAccountsForPlanStubbedData = MarketplacePurchase[]; + +export interface AppsListAccountsForPlanStubbedParams { + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: DirectionEnum2; /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" + * Page number of the results to fetch. + * @default 1 */ - repos_url: string; - site_admin: boolean; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" + * Results per page (max 100) + * @default 30 */ - subscriptions_url: string; - /** @example "User" */ - type: string; + per_page?: number; + /** plan_id parameter */ + planId: number; /** - * @format uri - * @example "https://api.github.com/users/octocat" + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ - url: string; + sort?: SortEnum2; } -export interface CombinedBillingUsage { - /** Numbers of days left in billing cycle. */ - days_left_in_billing_cycle: number; - /** Estimated storage space (GB) used in billing cycle. */ - estimated_paid_storage_for_month: number; - /** Estimated sum of free and paid storage space (GB) used in billing cycle. */ - estimated_storage_for_month: number; +/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum AppsListAccountsForPlanStubbedParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * Combined Commit Status - * Combined Commit Status + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export interface CombinedCommitStatus { - /** @format uri */ - commit_url: string; - /** Minimal Repository */ - repository: MinimalRepository; - sha: string; - state: string; - statuses: SimpleCommitStatus[]; +export enum AppsListAccountsForPlanStubbedParams1SortEnum { + Created = "created", + Updated = "updated", +} + +export interface AppsListInstallationReposForAuthenticatedUserData { + repositories: Repository[]; + repository_selection?: string; total_count: number; - /** @format uri */ - url: string; } -/** - * Commit - * Commit - */ -export interface Commit { - author: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments" - */ - comments_url: string; - commit: { - author: GitUser | null; - /** @example 0 */ - comment_count: number; - committer: GitUser | null; - /** @example "Fix all the bugs" */ - message: string; - tree: { - /** @example "827efc6d56897b048c772eb4087f854f46256132" */ - sha: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" - */ - url: string; - }; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - url: string; - verification?: Verification; - }; - committer: SimpleUser | null; - files?: { - additions?: number; - blob_url?: string; - changes?: number; - /** @example ""https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573"" */ - contents_url?: string; - deletions?: number; - filename?: string; - patch?: string; - /** @example ""subdir/before_name.txt"" */ - previous_filename?: string; - raw_url?: string; - /** @example ""1e8e60ce9733d5283f7836fa602b6365a66b2567"" */ - sha?: string; - status?: string; - }[]; +export interface AppsListInstallationReposForAuthenticatedUserParams { + /** installation_id parameter */ + installationId: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * Page number of the results to fetch. + * @default 1 */ - html_url: string; - /** @example "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==" */ - node_id: string; - parents: { - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd" - */ - html_url?: string; - /** @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ - sha: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd" - */ - url: string; - }[]; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - sha: string; - stats?: { - additions?: number; - deletions?: number; - total?: number; - }; + page?: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * Results per page (max 100) + * @default 30 */ - url: string; + per_page?: number; } -/** - * Commit Activity - * Commit Activity - */ -export interface CommitActivity { - /** @example [0,3,26,20,39,1,0] */ - days: number[]; - /** @example 89 */ - total: number; - /** @example 1336280400 */ - week: number; +export type AppsListInstallationsData = Installation[]; + +export interface AppsListInstallationsForAuthenticatedUserData { + installations: Installation[]; + total_count: number; } -/** - * Commit Comment - * Commit Comment - */ -export interface CommitComment { - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - body: string; - commit_id: string; - /** @format date-time */ - created_at: string; - /** @format uri */ - html_url: string; - id: number; - line: number | null; - node_id: string; - path: string | null; - position: number | null; - reactions?: ReactionRollup; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user: SimpleUser | null; +export interface AppsListInstallationsForAuthenticatedUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** - * Commit Comparison - * Commit Comparison - */ -export interface CommitComparison { - /** @example 4 */ - ahead_by: number; - /** Commit */ - base_commit: Commit; - /** @example 5 */ - behind_by: number; - commits: Commit[]; +export interface AppsListInstallationsParams { + outdated?: string; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic.diff" + * Page number of the results to fetch. + * @default 1 */ - diff_url: string; - files: DiffEntry[]; + page?: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic" + * Results per page (max 100) + * @default 30 */ - html_url: string; - /** Commit */ - merge_base_commit: Commit; + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; +} + +export type AppsListPlansData = MarketplaceListingPlan[]; + +export interface AppsListPlansParams { /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic.patch" + * Page number of the results to fetch. + * @default 1 */ - patch_url: string; + page?: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17" + * Results per page (max 100) + * @default 30 */ - permalink_url: string; - /** @example "ahead" */ - status: CommitComparisonStatusEnum; - /** @example 6 */ - total_commits: number; + per_page?: number; +} + +export type AppsListPlansStubbedData = MarketplaceListingPlan[]; + +export interface AppsListPlansStubbedParams { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/compare/master...topic" + * Page number of the results to fetch. + * @default 1 */ - url: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** @example "ahead" */ -export enum CommitComparisonStatusEnum { - Diverged = "diverged", - Ahead = "ahead", - Behind = "behind", - Identical = "identical", +export interface AppsListReposAccessibleToInstallationData { + repositories: Repository[]; + /** @example "selected" */ + repository_selection?: string; + total_count: number; } -/** - * Commit Search Result Item - * Commit Search Result Item - */ -export interface CommitSearchResultItem { - author: SimpleUser | null; - /** @format uri */ - comments_url: string; - commit: { - author: { - /** @format date-time */ - date: string; - email: string; - name: string; - }; - comment_count: number; - committer: GitUser | null; - message: string; - tree: { - sha: string; - /** @format uri */ - url: string; - }; - /** @format uri */ - url: string; - verification?: Verification; - }; - committer: GitUser | null; - /** @format uri */ - html_url: string; - node_id: string; - parents: { - html_url?: string; - sha?: string; - url?: string; - }[]; - /** Minimal Repository */ - repository: MinimalRepository; - score: number; - sha: string; - text_matches?: SearchResultTextMatches; - /** @format uri */ - url: string; +export interface AppsListReposAccessibleToInstallationParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** Community Health File */ -export interface CommunityHealthFile { - /** @format uri */ - html_url: string; - /** @format uri */ - url: string; -} +export type AppsListSubscriptionsForAuthenticatedUserData = + UserMarketplacePurchase[]; -/** - * Community Profile - * Community Profile - */ -export interface CommunityProfile { - /** @example true */ - content_reports_enabled?: boolean; - /** @example "My first repository on GitHub!" */ - description: string | null; - /** @example "example.com" */ - documentation: string | null; - files: { - code_of_conduct: CodeOfConductSimple | null; - contributing: CommunityHealthFile | null; - issue_template: CommunityHealthFile | null; - license: LicenseSimple | null; - pull_request_template: CommunityHealthFile | null; - readme: CommunityHealthFile | null; - }; - /** @example 100 */ - health_percentage: number; +export interface AppsListSubscriptionsForAuthenticatedUserParams { /** - * @format date-time - * @example "2017-02-28T19:09:29Z" + * Page number of the results to fetch. + * @default 1 */ - updated_at: string | null; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** Conflict */ -export type Conflict = BasicError; - -/** - * Content Directory - * A list of directory items - */ -export type ContentDirectory = { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content?: string; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; -}[]; +export type AppsListSubscriptionsForAuthenticatedUserStubbedData = + UserMarketplacePurchase[]; -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ -export enum ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface AppsListSubscriptionsForAuthenticatedUserStubbedParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ -export enum ContentEnum1 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} +export type AppsRemoveRepoFromInstallationData = any; -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ -export enum ContentEnum2 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface AppsRemoveRepoFromInstallationParams { + /** installation_id parameter */ + installationId: number; + repositoryId: number; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ -export enum ContentEnum3 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export type AppsResetAuthorizationData = Authorization; + +export interface AppsResetAuthorizationParams { + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ -export enum ContentEnum4 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export type AppsResetTokenData = Authorization; + +export interface AppsResetTokenParams { + /** The client ID of your GitHub app. */ + clientId: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ -export enum ContentEnum5 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface AppsResetTokenPayload { + /** The access_token of the OAuth application. */ + access_token: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ -export enum ContentEnum6 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export type AppsRevokeAuthorizationForApplicationData = any; + +export interface AppsRevokeAuthorizationForApplicationParams { + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ -export enum ContentEnum7 { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export type AppsRevokeGrantForApplicationData = any; + +export interface AppsRevokeGrantForApplicationParams { + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; } -/** - * Content File - * Content File - */ -export interface ContentFile { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content: string; - /** @format uri */ - download_url: string | null; - encoding: string; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - /** @example ""git://example.com/defunkt/dotjs.git"" */ - submodule_git_url?: string; - /** @example ""actual/actual.md"" */ - target?: string; - type: string; - /** @format uri */ - url: string; +export type AppsRevokeInstallationAccessTokenData = any; + +export type AppsScopeTokenData = Authorization; + +export interface AppsScopeTokenParams { + /** The client ID of your GitHub app. */ + clientId: string; } -/** - * ContentReferenceAttachment - * Content Reference attachments allow you to provide context around URLs posted in comments - */ -export interface ContentReferenceAttachment { +export interface AppsScopeTokenPayload { /** - * The body of the attachment - * @maxLength 262144 - * @example "Body of the attachment" + * **Required.** The OAuth access token used to authenticate to the GitHub API. + * @example "e72e16c7e42f292c6912e7710c838347ae178b4a" */ - body: string; + access_token?: string; + /** The permissions granted to the user-to-server access token. */ + permissions?: AppPermissions; + /** The list of repository IDs to scope the user-to-server access token to. \`repositories\` may not be specified if \`repository_ids\` is specified. */ + repositories?: string[]; /** - * The ID of the attachment - * @example 21 + * The list of repository names to scope the user-to-server access token to. \`repository_ids\` may not be specified if \`repositories\` is specified. + * @example [1] */ - id: number; + repository_ids?: number[]; /** - * The node_id of the content attachment - * @example "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=" + * The name of the user or organization to scope the user-to-server access token to. **Required** unless \`target_id\` is specified. + * @example "octocat" */ - node_id?: string; + target?: string; /** - * The title of the attachment - * @maxLength 1024 - * @example "Title of the attachment" + * The ID of the user or organization to scope the user-to-server access token to. **Required** unless \`target\` is specified. + * @example 1 */ - title: string; + target_id?: number; } -/** - * Symlink Content - * An object describing a symlink - */ -export interface ContentSubmodule { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - /** @format uri */ - submodule_git_url: string; - type: string; - /** @format uri */ - url: string; +export type AppsSuspendInstallationData = any; + +export interface AppsSuspendInstallationParams { + /** installation_id parameter */ + installationId: number; } -/** - * Symlink Content - * An object describing a symlink - */ -export interface ContentSymlink { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - target: string; - type: string; - /** @format uri */ - url: string; +export type AppsUnsuspendInstallationData = any; + +export interface AppsUnsuspendInstallationParams { + /** installation_id parameter */ + installationId: number; +} + +export type AppsUpdateWebhookConfigForAppData = WebhookConfig; + +/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ +export interface AppsUpdateWebhookConfigForAppPayload { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; } /** - * Content Traffic - * Content Traffic + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" */ -export interface ContentTraffic { - /** @example 3542 */ - count: number; - /** @example "/github/hubot" */ - path: string; - /** @example "github/hubot: A customizable life embetterment robot." */ - title: string; - /** @example 2225 */ - uniques: number; +export enum ArchivedStateEnum { + All = "all", + Archived = "archived", + NotArchived = "not_archived", } /** - * Content Tree - * Content Tree + * Artifact + * An artifact */ -export interface ContentTree { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - /** @format uri */ - download_url: string | null; - entries?: { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content?: string; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; - }[]; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; +export interface Artifact { + /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip" */ + archive_download_url: string; + /** @format date-time */ + created_at: string | null; + /** Whether or not the artifact has expired. */ + expired: boolean; + /** @format date-time */ + expires_at: string; + /** @example 5 */ + id: number; + /** + * The name of the artifact. + * @example "AdventureWorks.Framework" + */ name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ + /** @example "MDEwOkNoZWNrU3VpdGU1" */ + node_id: string; + /** + * The size in bytes of the artifact. + * @example 12345 + */ + size_in_bytes: number; + /** @format date-time */ + updated_at: string | null; + /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5" */ url: string; } -/** - * Contributor - * Contributor - */ -export interface Contributor { - /** @format uri */ - avatar_url?: string; - contributions: number; - email?: string; - events_url?: string; - /** @format uri */ - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string | null; - /** @format uri */ - html_url?: string; - id?: number; - login?: string; - name?: string; - node_id?: string; - /** @format uri */ - organizations_url?: string; - /** @format uri */ - received_events_url?: string; - /** @format uri */ - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - /** @format uri */ - subscriptions_url?: string; - type: string; - /** @format uri */ - url?: string; +export interface AuditLogEvent { + /** The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + "@timestamp"?: number; + /** The name of the action that was performed, for example \`user.login\` or \`repo.create\`. */ + action?: string; + active?: boolean; + active_was?: boolean; + /** The actor who performed the action. */ + actor?: string; + /** The username of the account being blocked. */ + blocked_user?: string; + business?: string; + config?: any[]; + config_was?: any[]; + content_type?: string; + /** The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + created_at?: number; + deploy_key_fingerprint?: string; + emoji?: string; + events?: any[]; + events_were?: any[]; + explanation?: string; + fingerprint?: string; + hook_id?: number; + limited_availability?: boolean; + message?: string; + name?: string; + old_user?: string; + openssh_public_key?: string; + org?: string; + previous_visibility?: string; + read_only?: boolean; + /** The name of the repository. */ + repo?: string; + /** The name of the repository. */ + repository?: string; + repository_public?: boolean; + target_login?: string; + team?: string; + /** The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol?: number; + /** A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol_name?: string; + /** The user that was affected by the action performed (if available). */ + user?: string; + /** The repository visibility, for example \`public\` or \`private\`. */ + visibility?: string; } -/** - * Contributor Activity - * Contributor Activity - */ -export interface ContributorActivity { - author: SimpleUser | null; - /** @example 135 */ - total: number; - /** @example [{"w":"1367712000","a":6898,"d":77,"c":10}] */ - weeks: { - a?: number; - c?: number; - d?: number; - w?: string; - }[]; -} +export type AuditLogGetAuditLogData = AuditLogEvent[]; -/** - * Credential Authorization - * Credential Authorization - */ -export interface CredentialAuthorization { - /** @example 12345678 */ - authorized_credential_id?: number | null; - /** - * The note given to the token. This will only be present when the credential is a token. - * @example "my token" - */ - authorized_credential_note?: string | null; - /** - * The title given to the ssh key. This will only be present when the credential is an ssh key. - * @example "my ssh key" - */ - authorized_credential_title?: string | null; - /** - * Date when the credential was last accessed. May be null if it was never accessed - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - credential_accessed_at?: string | null; - /** - * Date when the credential was authorized for use. - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - credential_authorized_at: string; - /** - * Unique identifier for the credential. - * @example 1 - */ - credential_id: number; - /** - * Human-readable description of the credential type. - * @example "SSH Key" - */ - credential_type: string; - /** - * Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. - * @example "jklmnop12345678" - */ - fingerprint?: string; +export interface AuditLogGetAuditLogParams { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * User login that owns the underlying credential. - * @example "monalisa" + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. */ - login: string; + include?: IncludeEnum; /** - * List of oauth scopes the token has been granted. - * @example ["user","repo"] + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ - scopes?: string[]; + order?: OrderEnum; /** - * Last eight characters of the credential. Only included in responses with credential_type of personal access token. - * @example "12345678" + * Results per page (max 100) + * @default 30 */ - token_last_eight?: string; + per_page?: number; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; } /** - * Deploy Key - * An SSH key granting access to a single repository. + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. */ -export interface DeployKey { - created_at: string; - id: number; - key: string; - read_only: boolean; - title: string; - url: string; - verified: boolean; +export enum AuditLogGetAuditLogParams1IncludeEnum { + Web = "web", + Git = "git", + All = "all", } /** - * Deployment - * A request for a specific ref(branch,sha,tag) to be deployed + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ -export interface Deployment { - /** - * @format date-time - * @example "2012-07-20T01:19:13Z" - */ - created_at: string; - creator: SimpleUser | null; - /** @example "Deploy request from hubot" */ - description: string | null; - /** - * Name for the target deployment environment. - * @example "production" - */ - environment: string; - /** - * Unique identifier of the deployment - * @example 42 - */ - id: number; - /** @example "MDEwOkRlcGxveW1lbnQx" */ - node_id: string; - /** @example "staging" */ - original_environment?: string; - payload: object; - performed_via_github_app?: Integration | null; - /** - * Specifies if the given environment is one that end-users directly interact with. Default: false. - * @example true - */ - production_environment?: boolean; - /** - * The ref to deploy. This can be a branch, tag, or sha. - * @example "topic-branch" - */ - ref: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example" - */ - repository_url: string; - /** @example "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d" */ - sha: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/1/statuses" - */ - statuses_url: string; - /** - * Parameter to specify a task to execute - * @example "deploy" - */ - task: string; - /** - * Specifies if the given environment is will no longer exist at some point in the future. Default: false. - * @example true - */ - transient_environment?: boolean; +export enum AuditLogGetAuditLogParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} + +/** + * Authentication Token + * Authentication Token + */ +export interface AuthenticationToken { /** + * The time this token expires * @format date-time - * @example "2012-07-20T01:19:13Z" + * @example "2016-07-11T22:14:10Z" */ - updated_at: string; + expires_at: string; + /** @example {"issues":"read","deployments":"write"} */ + permissions?: object; + /** The repositories this token has access to */ + repositories?: Repository[]; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection?: AuthenticationTokenRepositorySelectionEnum; + /** @example "config.yaml" */ + single_file?: string | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/1" + * The token used for authentication + * @example "v1.1f699f1069f60xxx" */ - url: string; + token: string; +} + +/** Describe whether all repositories have been selected or there's a selection involved */ +export enum AuthenticationTokenRepositorySelectionEnum { + All = "all", + Selected = "selected", } /** - * Deployment Status - * The status of a deployment. + * author_association + * How the author is associated with the repository. + * @example "OWNER" */ -export interface DeploymentStatus { - /** - * @format date-time - * @example "2012-07-20T01:19:13Z" - */ +export enum AuthorAssociation { + COLLABORATOR = "COLLABORATOR", + CONTRIBUTOR = "CONTRIBUTOR", + FIRST_TIMER = "FIRST_TIMER", + FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR", + MANNEQUIN = "MANNEQUIN", + MEMBER = "MEMBER", + NONE = "NONE", + OWNER = "OWNER", +} + +/** + * Authorization + * The authorization for an OAuth app, GitHub App, or a Personal Access Token. + */ +export interface Authorization { + app: { + client_id: string; + name: string; + /** @format uri */ + url: string; + }; + /** @format date-time */ created_at: string; - creator: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/42" - */ - deployment_url: string; - /** - * A short description of the status. - * @maxLength 140 - * @default "" - * @example "Deployment finished successfully." - */ - description: string; - /** - * The environment of the deployment that the status is for. - * @default "" - * @example "production" - */ - environment?: string; - /** - * The URL for accessing your environment. - * @format uri - * @default "" - * @example "https://staging.example.com/" - */ - environment_url?: string; - /** @example 1 */ + fingerprint: string | null; + hashed_token: string | null; id: number; - /** - * The URL to associate with this status. - * @format uri - * @default "" - * @example "https://example.com/deployment/42/output" - */ - log_url?: string; - /** @example "MDE2OkRlcGxveW1lbnRTdGF0dXMx" */ - node_id: string; - performed_via_github_app?: Integration | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example" - */ - repository_url: string; - /** - * The state of the status. - * @example "success" - */ - state: DeploymentStatusStateEnum; - /** - * Deprecated: the URL to associate with this status. - * @format uri - * @default "" - * @example "https://example.com/deployment/42/output" - */ - target_url: string; - /** - * @format date-time - * @example "2012-07-20T01:19:13Z" - */ + installation?: ScopedInstallation | null; + note: string | null; + /** @format uri */ + note_url: string | null; + /** A list of scopes that this authorization is in. */ + scopes: string[] | null; + token: string; + token_last_eight: string | null; + /** @format date-time */ updated_at: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/42/statuses/1" - */ + /** @format uri */ url: string; + user?: SimpleUser | null; } /** - * The state of the status. - * @example "success" + * Auto merge + * The status of auto merging a pull request. */ -export enum DeploymentStatusStateEnum { - Error = "error", - Failure = "failure", - Inactive = "inactive", - Pending = "pending", - Success = "success", - Queued = "queued", - InProgress = "in_progress", +export type AutoMerge = { + /** Commit message for the merge commit. */ + commit_message: string; + /** Title for the merge commit message. */ + commit_title: string; + /** Simple User */ + enabled_by: SimpleUser; + /** The merge method to use. */ + merge_method: AutoMergeMergeMethodEnum; +} | null; + +/** The merge method to use. */ +export enum AutoMergeMergeMethodEnum { + Merge = "merge", + Squash = "squash", + Rebase = "rebase", } +/** Bad Request */ +export type BadRequest = BasicError; + /** - * Diff Entry - * Diff Entry + * Base Gist + * Base Gist */ -export interface DiffEntry { - /** @example 103 */ - additions: number; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" - */ - blob_url: string; - /** @example 124 */ - changes: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - contents_url: string; - /** @example 21 */ - deletions: number; - /** @example "file1.txt" */ - filename: string; - /** @example "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" */ - patch?: string; - /** @example "file.txt" */ - previous_filename?: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" - */ - raw_url: string; - /** @example "bbcd538c8e72b8c175046e27cc8f907076331401" */ - sha: string; - /** @example "added" */ - status: string; +export interface BaseGist { + comments: number; + /** @format uri */ + comments_url: string; + /** @format uri */ + commits_url: string; + /** @format date-time */ + created_at: string; + description: string | null; + files: Record< + string, + { + filename?: string; + language?: string; + raw_url?: string; + size?: number; + type?: string; + } + >; + forks?: any[]; + /** @format uri */ + forks_url: string; + /** @format uri */ + git_pull_url: string; + /** @format uri */ + git_push_url: string; + history?: any[]; + /** @format uri */ + html_url: string; + id: string; + node_id: string; + owner?: SimpleUser | null; + public: boolean; + truncated?: boolean; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + user: SimpleUser | null; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Basic Error + * Basic Error */ -export enum DirectionEnum { - Asc = "asc", - Desc = "desc", +export interface BasicError { + documentation_url?: string; + message?: string; } -/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum DirectionEnum1 { - Asc = "asc", - Desc = "desc", -} +export type BillingGetGithubActionsBillingGheData = ActionsBillingUsage; -/** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ -export enum DirectionEnum10 { - Asc = "asc", - Desc = "desc", +export interface BillingGetGithubActionsBillingGheParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ -export enum DirectionEnum11 { - Asc = "asc", - Desc = "desc", -} +export type BillingGetGithubActionsBillingOrgData = ActionsBillingUsage; -/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ -export enum DirectionEnum12 { - Asc = "asc", - Desc = "desc", +export interface BillingGetGithubActionsBillingOrgParams { + org: string; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum13 { - Asc = "asc", - Desc = "desc", -} +export type BillingGetGithubActionsBillingUserData = ActionsBillingUsage; -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum14 { - Asc = "asc", - Desc = "desc", +export interface BillingGetGithubActionsBillingUserParams { + username: string; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum15 { - Asc = "asc", - Desc = "desc", -} +export type BillingGetGithubPackagesBillingGheData = PackagesBillingUsage; -/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ -export enum DirectionEnum16 { - Asc = "asc", - Desc = "desc", +export interface BillingGetGithubPackagesBillingGheParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum17 { - Asc = "asc", - Desc = "desc", -} +export type BillingGetGithubPackagesBillingOrgData = PackagesBillingUsage; -/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ -export enum DirectionEnum18 { - Asc = "asc", - Desc = "desc", +export interface BillingGetGithubPackagesBillingOrgParams { + org: string; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum19 { - Asc = "asc", - Desc = "desc", +export type BillingGetGithubPackagesBillingUserData = PackagesBillingUsage; + +export interface BillingGetGithubPackagesBillingUserParams { + username: string; } -/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum DirectionEnum2 { - Asc = "asc", - Desc = "desc", +export type BillingGetSharedStorageBillingGheData = CombinedBillingUsage; + +export interface BillingGetSharedStorageBillingGheParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum DirectionEnum3 { - Asc = "asc", - Desc = "desc", +export type BillingGetSharedStorageBillingOrgData = CombinedBillingUsage; + +export interface BillingGetSharedStorageBillingOrgParams { + org: string; } -/** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ -export enum DirectionEnum4 { - Asc = "asc", - Desc = "desc", +export type BillingGetSharedStorageBillingUserData = CombinedBillingUsage; + +export interface BillingGetSharedStorageBillingUserParams { + username: string; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Blob + * Blob */ -export enum DirectionEnum5 { - Asc = "asc", - Desc = "desc", +export interface Blob { + content: string; + encoding: string; + highlighted_content?: string; + node_id: string; + sha: string; + size: number | null; + /** @format uri */ + url: string; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Branch Protection + * Branch Protection */ -export enum DirectionEnum6 { - Asc = "asc", - Desc = "desc", +export interface BranchProtection { + allow_deletions?: { + enabled?: boolean; + }; + allow_force_pushes?: { + enabled?: boolean; + }; + enabled: boolean; + /** Protected Branch Admin Enforced */ + enforce_admins?: ProtectedBranchAdminEnforced; + /** @example ""branch/with/protection"" */ + name?: string; + /** @example ""https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection"" */ + protection_url?: string; + required_linear_history?: { + enabled?: boolean; + }; + /** Protected Branch Pull Request Review */ + required_pull_request_reviews?: ProtectedBranchPullRequestReview; + required_status_checks: { + contexts: string[]; + contexts_url?: string; + enforcement_level: string; + url?: string; + }; + /** Branch Restriction Policy */ + restrictions?: BranchRestrictionPolicy; + url?: string; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Branch Restriction Policy + * Branch Restriction Policy */ -export enum DirectionEnum7 { - Asc = "asc", - Desc = "desc", -} - -/** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum DirectionEnum8 { - Asc = "asc", - Desc = "desc", +export interface BranchRestrictionPolicy { + apps: { + created_at?: string; + description?: string; + events?: string[]; + external_url?: string; + html_url?: string; + id?: number; + name?: string; + node_id?: string; + owner?: { + avatar_url?: string; + description?: string; + events_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers"" */ + followers_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}"" */ + following_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}"" */ + gists_url?: string; + /** @example """" */ + gravatar_id?: string; + hooks_url?: string; + /** @example ""https://github.com/testorg-ea8ec76d71c3af4b"" */ + html_url?: string; + id?: number; + issues_url?: string; + login?: string; + members_url?: string; + node_id?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs"" */ + organizations_url?: string; + public_members_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events"" */ + received_events_url?: string; + repos_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}"" */ + starred_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions"" */ + subscriptions_url?: string; + /** @example ""Organization"" */ + type?: string; + url?: string; + }; + permissions?: { + contents?: string; + issues?: string; + metadata?: string; + single_file?: string; + }; + slug?: string; + updated_at?: string; + }[]; + /** @format uri */ + apps_url: string; + teams: { + description?: string | null; + html_url?: string; + id?: number; + members_url?: string; + name?: string; + node_id?: string; + parent?: string | null; + permission?: string; + privacy?: string; + repositories_url?: string; + slug?: string; + url?: string; + }[]; + /** @format uri */ + teams_url: string; + /** @format uri */ + url: string; + users: { + avatar_url?: string; + events_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string; + html_url?: string; + id?: number; + login?: string; + node_id?: string; + organizations_url?: string; + received_events_url?: string; + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + subscriptions_url?: string; + type?: string; + url?: string; + }[]; + /** @format uri */ + users_url: string; } /** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" + * Branch Short + * Branch Short */ -export enum DirectionEnum9 { - Asc = "asc", - Desc = "desc", +export interface BranchShort { + commit: { + sha: string; + url: string; + }; + name: string; + protected: boolean; } /** - * Email - * Email + * Branch With Protection + * Branch With Protection */ -export interface Email { - /** - * @format email - * @example "octocat@github.com" - */ - email: string; - /** @example true */ - primary: boolean; - /** @example true */ - verified: boolean; - /** @example "public" */ - visibility: string | null; -} - -export type EmojisGetData = Record; - -/** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ -export enum EnabledOrganizations { - All = "all", - None = "none", - Selected = "selected", +export interface BranchWithProtection { + _links: { + html: string; + /** @format uri */ + self: string; + }; + /** Commit */ + commit: Commit; + name: string; + /** @example ""mas*"" */ + pattern?: string; + protected: boolean; + /** Branch Protection */ + protection: BranchProtection; + /** @format uri */ + protection_url: string; + /** @example 1 */ + required_approving_review_count?: number; } -/** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ -export enum EnabledRepositories { - All = "all", - None = "none", - Selected = "selected", +/** + * Check Annotation + * Check Annotation + */ +export interface CheckAnnotation { + /** @example "warning" */ + annotation_level: string | null; + blob_href: string; + /** @example 10 */ + end_column: number | null; + /** @example 2 */ + end_line: number; + /** @example "Check your spelling for 'banaas'." */ + message: string | null; + /** @example "README.md" */ + path: string; + /** @example "Do you mean 'bananas' or 'banana'?" */ + raw_details: string | null; + /** @example 5 */ + start_column: number | null; + /** @example 2 */ + start_line: number; + /** @example "Spell Checker" */ + title: string | null; } /** - * Enterprise - * An enterprise account + * CheckRun + * A check performed on the code of a given code change */ -export interface Enterprise { - /** @format uri */ - avatar_url: string; +export interface CheckRun { + app: Integration | null; + check_suite: { + id: number; + } | null; /** * @format date-time - * @example "2019-01-26T19:01:12Z" + * @example "2018-05-04T01:14:52Z" */ - created_at: string | null; - /** A short description of the enterprise. */ - description?: string | null; + completed_at: string | null; + /** @example "neutral" */ + conclusion: CheckRunConclusionEnum | null; + /** @example "https://example.com" */ + details_url: string | null; + /** @example "42" */ + external_id: string | null; /** - * @format uri - * @example "https://github.com/enterprises/octo-business" + * The SHA of the commit that is being checked. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" */ - html_url: string; + head_sha: string; + /** @example "https://github.com/github/hello-world/runs/4" */ + html_url: string | null; /** - * Unique identifier of the enterprise - * @example 42 + * The id of the check. + * @example 21 */ id: number; /** - * The name of the enterprise. - * @example "Octo Business" + * The name of the check. + * @example "test-coverage" */ name: string; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + /** @example "MDg6Q2hlY2tSdW40" */ node_id: string; - /** - * The slug url identifier for the enterprise. - * @example "octo-business" - */ - slug: string; + output: { + annotations_count: number; + /** @format uri */ + annotations_url: string; + summary: string | null; + text: string | null; + title: string | null; + }; + pull_requests: PullRequestMinimal[]; /** * @format date-time - * @example "2019-01-26T19:14:43Z" + * @example "2018-05-04T01:14:52Z" */ - updated_at: string | null; + started_at: string | null; /** - * The enterprise's website URL. - * @format uri + * The phase of the lifecycle that the check is currently in. + * @example "queued" */ - website_url?: string | null; + status: CheckRunStatusEnum; + /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ + url: string; } -export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData = - any; - -export interface EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +/** @example "neutral" */ +export enum CheckRunConclusionEnum { + Success = "success", + Failure = "failure", + Neutral = "neutral", + Cancelled = "cancelled", + Skipped = "skipped", + TimedOut = "timed_out", + ActionRequired = "action_required", } -export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData = any; - -export interface EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; +/** + * The phase of the lifecycle that the check is currently in. + * @example "queued" + */ +export enum CheckRunStatusEnum { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export type EnterpriseAdminCreateRegistrationTokenForEnterpriseData = - AuthenticationToken; - -export interface EnterpriseAdminCreateRegistrationTokenForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +/** + * CheckSuite + * A suite of checks performed on the code of a given code change + */ +export interface CheckSuite { + /** @example "d6fde92930d4715a2b49857d24b940956b26d2d3" */ + after: string | null; + app: Integration | null; + /** @example "146e867f55c26428e5f9fade55a9bbf5e95a7912" */ + before: string | null; + check_runs_url: string; + /** @example "neutral" */ + conclusion: CheckSuiteConclusionEnum | null; + /** @format date-time */ + created_at: string | null; + /** @example "master" */ + head_branch: string | null; + /** Simple Commit */ + head_commit: SimpleCommit; + /** + * The SHA of the head commit that is being checked. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + */ + head_sha: string; + /** @example 5 */ + id: number; + latest_check_runs_count: number; + /** @example "MDEwOkNoZWNrU3VpdGU1" */ + node_id: string; + pull_requests: PullRequestMinimal[] | null; + /** Minimal Repository */ + repository: MinimalRepository; + /** @example "completed" */ + status: CheckSuiteStatusEnum | null; + /** @format date-time */ + updated_at: string | null; + /** @example "https://api.github.com/repos/github/hello-world/check-suites/5" */ + url: string | null; } -export type EnterpriseAdminCreateRemoveTokenForEnterpriseData = - AuthenticationToken; - -export interface EnterpriseAdminCreateRemoveTokenForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +/** @example "neutral" */ +export enum CheckSuiteConclusionEnum { + Success = "success", + Failure = "failure", + Neutral = "neutral", + Cancelled = "cancelled", + Skipped = "skipped", + TimedOut = "timed_out", + ActionRequired = "action_required", } -export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData = - RunnerGroupsEnterprise; - -export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; -} - -export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload { - /** Name of the runner group. */ - name: string; - /** List of runner IDs to add to the runner group. */ - runners?: number[]; - /** List of organization IDs that can access the runner group. */ - selected_organization_ids?: number[]; - /** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ - visibility?: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVisibilityEnum; -} - -/** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ -export enum EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVisibilityEnum { - Selected = "selected", - All = "all", -} - -export type EnterpriseAdminDeleteScimGroupFromEnterpriseData = any; - -export interface EnterpriseAdminDeleteScimGroupFromEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; +/** + * Check Suite Preference + * Check suite configuration preferences for a repository. + */ +export interface CheckSuitePreference { + preferences: { + auto_trigger_checks?: { + app_id: number; + setting: boolean; + }[]; + }; + /** A git repository */ + repository: Repository; } -export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData = any; - -export interface EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; +/** @example "completed" */ +export enum CheckSuiteStatusEnum { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData = any; - -export interface EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +/** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ +export enum ChecksCreateAnnotationLevelEnum { + Notice = "notice", + Warning = "warning", + Failure = "failure", } -export type EnterpriseAdminDeleteUserFromEnterpriseData = any; - -export interface EnterpriseAdminDeleteUserFromEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; +/** + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + */ +export enum ChecksCreateConclusionEnum { + Success = "success", + Failure = "failure", + Neutral = "neutral", + Cancelled = "cancelled", + Skipped = "skipped", + TimedOut = "timed_out", + ActionRequired = "action_required", } -export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData = - any; +export type ChecksCreateData = CheckRun; -export interface EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; +export interface ChecksCreateParams { + owner: string; + repo: string; } -export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData = - any; +export type ChecksCreatePayload = ( + | { + status?: ChecksCreateStatusEnum; + [key: string]: any; + } + | { + status?: ChecksCreateStatusEnum1; + [key: string]: any; + } +) & { + /** + * Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [\`check_run.requested_action\` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." + * @maxItems 3 + */ + actions?: { + /** + * A short explanation of what this action would do. The maximum size is 40 characters. + * @maxLength 40 + */ + description: string; + /** + * A reference for the action on the integrator's system. The maximum size is 20 characters. + * @maxLength 20 + */ + identifier: string; + /** + * The text to be displayed on a button in the web UI. The maximum size is 20 characters. + * @maxLength 20 + */ + label: string; + }[]; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + completed_at?: string; + /** + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + */ + conclusion?: ChecksCreateConclusionEnum; + /** The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** The SHA of the commit. */ + head_sha: string; + /** The name of the check. For example, "code-coverage". */ + name: string; + /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object) description. */ + output?: { + /** + * Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter. + * @maxItems 50 + */ + annotations?: { + /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ + annotation_level: ChecksCreateAnnotationLevelEnum; + /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + end_column?: number; + /** The end line of the annotation. */ + end_line: number; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ + path: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + start_column?: number; + /** The start line of the annotation. */ + start_line: number; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#images-object) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** A short image description. */ + caption?: string; + /** The full URL of the image. */ + image_url: string; + }[]; + /** + * The summary of the check run. This parameter supports Markdown. + * @maxLength 65535 + */ + summary: string; + /** + * The details of the check run. This parameter supports Markdown. + * @maxLength 65535 + */ + text?: string; + /** The title of the check run. */ + title: string; + }; + /** The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + started_at?: string; + /** + * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. + * @default "queued" + */ + status?: ChecksCreateStatusEnum2; +}; -export interface EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; +export enum ChecksCreateStatusEnum { + Completed = "completed", } -export type EnterpriseAdminGetAllowedActionsEnterpriseData = SelectedActions; - -export interface EnterpriseAdminGetAllowedActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export enum ChecksCreateStatusEnum1 { + Queued = "queued", + InProgress = "in_progress", } -export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseData = - ActionsEnterprisePermissions; - -export interface EnterpriseAdminGetGithubActionsPermissionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +/** + * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. + * @default "queued" + */ +export enum ChecksCreateStatusEnum2 { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData = - ScimEnterpriseGroup; +export type ChecksCreateSuiteData = CheckSuite; -export interface EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; +export interface ChecksCreateSuiteParams { + owner: string; + repo: string; } -export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserData = - ScimEnterpriseUser; - -export interface EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; +export interface ChecksCreateSuitePayload { + /** The sha of the head commit. */ + head_sha: string; } -export type EnterpriseAdminGetSelfHostedRunnerForEnterpriseData = Runner; +export type ChecksGetData = CheckRun; -export interface EnterpriseAdminGetSelfHostedRunnerForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; +export interface ChecksGetParams { + /** check_run_id parameter */ + checkRunId: number; + owner: string; + repo: string; } -export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData = - RunnerGroupsEnterprise; +export type ChecksGetSuiteData = CheckSuite; -export interface EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +export interface ChecksGetSuiteParams { + /** check_suite_id parameter */ + checkSuiteId: number; + owner: string; + repo: string; } -export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData { - organizations: OrganizationSimple[]; - total_count: number; -} +export type ChecksListAnnotationsData = CheckAnnotation[]; -export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksListAnnotationsParams { + /** check_run_id parameter */ + checkRunId: number; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -17427,50 +17242,23 @@ export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise * @default 30 */ per_page?: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} - -export type EnterpriseAdminListProvisionedGroupsEnterpriseData = - ScimGroupListEnterprise; - -export interface EnterpriseAdminListProvisionedGroupsEnterpriseParams { - /** Used for pagination: the number of results to return. */ - count?: number; - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; -} - -export type EnterpriseAdminListProvisionedIdentitiesEnterpriseData = - ScimUserListEnterprise; - -export interface EnterpriseAdminListProvisionedIdentitiesEnterpriseParams { - /** Used for pagination: the number of results to return. */ - count?: number; - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; -} - -export type EnterpriseAdminListRunnerApplicationsForEnterpriseData = - RunnerApplication[]; - -export interface EnterpriseAdminListRunnerApplicationsForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; + repo: string; } -export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData { - organizations: OrganizationSimple[]; +export interface ChecksListForRefData { + check_runs: CheckRun[]; total_count: number; } -export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksListForRefParams { + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: FilterEnum6; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -17481,16 +17269,45 @@ export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnt * @default 30 */ per_page?: number; + /** ref+ parameter */ + ref: string; + repo: string; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: StatusEnum3; } -export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData { - runner_groups: RunnerGroupsEnterprise[]; +/** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ +export enum ChecksListForRefParams1FilterEnum { + Latest = "latest", + All = "all", +} + +/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ +export enum ChecksListForRefParams1StatusEnum { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", +} + +export interface ChecksListForSuiteData { + check_runs: CheckRun[]; total_count: number; } -export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksListForSuiteParams { + /** check_suite_id parameter */ + checkSuiteId: number; + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: FilterEnum5; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -17501,36 +17318,41 @@ export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams { * @default 30 */ per_page?: number; + repo: string; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: StatusEnum2; } -export interface EnterpriseAdminListSelfHostedRunnersForEnterpriseData { - runners?: Runner[]; - total_count?: number; +/** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ +export enum ChecksListForSuiteParams1FilterEnum { + Latest = "latest", + All = "all", } -export interface EnterpriseAdminListSelfHostedRunnersForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; +/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ +export enum ChecksListForSuiteParams1StatusEnum { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData { - runners: Runner[]; +export interface ChecksListSuitesForRefData { + check_suites: CheckSuite[]; total_count: number; } -export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksListSuitesForRefParams { + /** + * Filters check suites by GitHub App \`id\`. + * @example 1 + */ + app_id?: number; + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -17541,3014 +17363,2510 @@ export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams * @default 30 */ per_page?: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; + /** ref+ parameter */ + ref: string; + repo: string; } -export type EnterpriseAdminProvisionAndInviteEnterpriseGroupData = - ScimEnterpriseGroup; - -export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; -} +export type ChecksRerequestSuiteData = any; -export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload { - /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ - displayName: string; - members?: { - /** The SCIM user ID for a user. */ - value: string; - }[]; - /** The SCIM schema URIs. */ - schemas: string[]; +export interface ChecksRerequestSuiteParams { + /** check_suite_id parameter */ + checkSuiteId: number; + owner: string; + repo: string; } -export type EnterpriseAdminProvisionAndInviteEnterpriseUserData = - ScimEnterpriseUser; +export type ChecksSetSuitesPreferencesData = CheckSuitePreference; -export interface EnterpriseAdminProvisionAndInviteEnterpriseUserParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksSetSuitesPreferencesParams { + owner: string; + repo: string; } -export interface EnterpriseAdminProvisionAndInviteEnterpriseUserPayload { - /** List of user emails. */ - emails: { - /** Whether this email address is the primary address. */ - primary: boolean; - /** The type of email address. */ - type: string; - /** The email address. */ - value: string; - }[]; - /** List of SCIM group IDs the user is a member of. */ - groups?: { - value?: string; +export interface ChecksSetSuitesPreferencesPayload { + /** Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [\`auto_trigger_checks\` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ + auto_trigger_checks?: { + /** The \`id\` of the GitHub App. */ + app_id: number; + /** + * Set to \`true\` to enable automatic creation of CheckSuite events upon pushes to the repository, or \`false\` to disable them. + * @default true + */ + setting: boolean; }[]; - name: { - /** The last name of the user. */ - familyName: string; - /** The first name of the user. */ - givenName: string; - }; - /** The SCIM schema URIs. */ - schemas: string[]; - /** The username for the user. */ - userName: string; } -export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData = - any; - -export interface EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +/** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ +export enum ChecksUpdateAnnotationLevelEnum { + Notice = "notice", + Warning = "warning", + Failure = "failure", } -export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData = - any; - -export interface EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; +/** + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + */ +export enum ChecksUpdateConclusionEnum { + Success = "success", + Failure = "failure", + Neutral = "neutral", + Cancelled = "cancelled", + Skipped = "skipped", + TimedOut = "timed_out", + ActionRequired = "action_required", } -export type EnterpriseAdminSetAllowedActionsEnterpriseData = any; +export type ChecksUpdateData = CheckRun; -export interface EnterpriseAdminSetAllowedActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export interface ChecksUpdateParams { + /** check_run_id parameter */ + checkRunId: number; + owner: string; + repo: string; } -export type EnterpriseAdminSetGithubActionsPermissionsEnterpriseData = any; +export type ChecksUpdatePayload = ( + | { + status?: ChecksUpdateStatusEnum; + [key: string]: any; + } + | { + status?: ChecksUpdateStatusEnum1; + [key: string]: any; + } +) & { + /** + * Possible further actions the integrator can perform, which a user may trigger. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." + * @maxItems 3 + */ + actions?: { + /** + * A short explanation of what this action would do. The maximum size is 40 characters. + * @maxLength 40 + */ + description: string; + /** + * A reference for the action on the integrator's system. The maximum size is 20 characters. + * @maxLength 20 + */ + identifier: string; + /** + * The text to be displayed on a button in the web UI. The maximum size is 20 characters. + * @maxLength 20 + */ + label: string; + }[]; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + completed_at?: string; + /** + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + */ + conclusion?: ChecksUpdateConclusionEnum; + /** The URL of the integrator's site that has the full details of the check. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** The name of the check. For example, "code-coverage". */ + name?: string; + /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object-1) description. */ + output?: { + /** + * Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. + * @maxItems 50 + */ + annotations?: { + /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ + annotation_level: ChecksUpdateAnnotationLevelEnum; + /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + end_column?: number; + /** The end line of the annotation. */ + end_line: number; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ + path: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + start_column?: number; + /** The start line of the annotation. */ + start_line: number; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** A short image description. */ + caption?: string; + /** The full URL of the image. */ + image_url: string; + }[]; + /** + * Can contain Markdown. + * @maxLength 65535 + */ + summary: string; + /** + * Can contain Markdown. + * @maxLength 65535 + */ + text?: string; + /** **Required**. */ + title?: string; + }; + /** This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + started_at?: string; + /** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: ChecksUpdateStatusEnum2; +}; -export interface EnterpriseAdminSetGithubActionsPermissionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; +export enum ChecksUpdateStatusEnum { + Completed = "completed", } -export interface EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_organizations: EnabledOrganizations; +export enum ChecksUpdateStatusEnum1 { + Queued = "queued", + InProgress = "in_progress", } -export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData = - ScimEnterpriseGroup; - -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; +/** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ +export enum ChecksUpdateStatusEnum2 { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload { - /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ - displayName: string; - members?: { - /** The SCIM user ID for a user. */ - value: string; - }[]; - /** The SCIM schema URIs. */ - schemas: string[]; +/** + * Clone Traffic + * Clone Traffic + */ +export interface CloneTraffic { + clones: Traffic[]; + /** @example 173 */ + count: number; + /** @example 128 */ + uniques: number; } -export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserData = - ScimEnterpriseUser; +/** + * Code Frequency Stat + * Code Frequency Stat + */ +export type CodeFrequencyStat = number[]; -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; +/** + * Code Of Conduct + * Code Of Conduct + */ +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; + /** @format uri */ + html_url: string | null; + /** @example "contributor_covenant" */ + key: string; + /** @example "Contributor Covenant" */ + name: string; + /** + * @format uri + * @example "https://api.github.com/codes_of_conduct/contributor_covenant" + */ + url: string; } -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload { - /** List of user emails. */ - emails: { - /** Whether this email address is the primary address. */ - primary: boolean; - /** The type of email address. */ - type: string; - /** The email address. */ - value: string; - }[]; - /** List of SCIM group IDs the user is a member of. */ - groups?: { - value?: string; - }[]; - name: { - /** The last name of the user. */ - familyName: string; - /** The first name of the user. */ - givenName: string; - }; - /** The SCIM schema URIs. */ - schemas: string[]; - /** The username for the user. */ - userName: string; +/** + * Code Of Conduct Simple + * Code of Conduct Simple + */ +export interface CodeOfConductSimple { + /** @format uri */ + html_url: string | null; + /** @example "citizen_code_of_conduct" */ + key: string; + /** @example "Citizen Code of Conduct" */ + name: string; + /** + * @format uri + * @example "https://api.github.com/codes_of_conduct/citizen_code_of_conduct" + */ + url: string; } -export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData = - any; - -export interface EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; +export interface CodeScanningAlertCodeScanningAlert { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: AlertCreatedAt; + /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + dismissed_at: CodeScanningAlertDismissedAt; + /** Simple User */ + dismissed_by: SimpleUser; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason: CodeScanningAlertDismissedReason; + /** The GitHub URL of the alert resource. */ + html_url: AlertHtmlUrl; + instances: CodeScanningAlertInstances; + /** The security alert number. */ + number: AlertNumber; + rule: CodeScanningAlertRule; + /** State of a code scanning alert. */ + state: CodeScanningAlertState; + tool: CodeScanningAnalysisTool; + /** The REST API URL of the alert resource. */ + url: AlertUrl; } -export interface EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload { - /** List of organization IDs that can access the runner group. */ - selected_organization_ids: number[]; +export interface CodeScanningAlertCodeScanningAlertItems { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: AlertCreatedAt; + /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + dismissed_at: CodeScanningAlertDismissedAt; + /** Simple User */ + dismissed_by: SimpleUser; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason: CodeScanningAlertDismissedReason; + /** The GitHub URL of the alert resource. */ + html_url: AlertHtmlUrl; + /** The security alert number. */ + number: AlertNumber; + rule: CodeScanningAlertRule; + /** State of a code scanning alert. */ + state: CodeScanningAlertState; + tool: CodeScanningAnalysisTool; + /** The REST API URL of the alert resource. */ + url: AlertUrl; } -export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData = - any; +/** + * The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time + */ +export type CodeScanningAlertDismissedAt = string | null; -export interface EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; -} +/** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ +export type CodeScanningAlertDismissedReason = + CodeScanningAlertDismissedReasonEnum | null; -export interface EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload { - /** List of organization IDs to enable for GitHub Actions. */ - selected_organization_ids: number[]; +export enum CodeScanningAlertDismissedReasonEnum { + FalsePositive = "false positive", + WontFix = "won't fix", + UsedInTests = "used in tests", } -export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData = any; - -export interface EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} +/** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ +export type CodeScanningAlertEnvironment = string; -export interface EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload { - /** List of runner IDs to add to the runner group. */ - runners: number[]; -} +export type CodeScanningAlertInstances = + | { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key?: CodeScanningAnalysisAnalysisKey; + /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ + environment?: CodeScanningAlertEnvironment; + matrix_vars?: string | null; + /** The full Git reference, formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** State of a code scanning alert. */ + state?: CodeScanningAlertState; + }[] + | null; -export type EnterpriseAdminUpdateAttributeForEnterpriseGroupData = - ScimEnterpriseGroup; +/** The full Git reference, formatted as \`refs/heads/\`. */ +export type CodeScanningAlertRef = string; -export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; +export interface CodeScanningAlertRule { + /** A short description of the rule used to detect the alert. */ + description?: string; + /** A unique identifier for the rule used to detect the alert. */ + id?: string | null; + /** The severity of the alert. */ + severity?: CodeScanningAlertRuleSeverityEnum | null; } -export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload { - /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ - Operations: object[]; - /** The SCIM schema URIs. */ - schemas: string[]; +/** The severity of the alert. */ +export enum CodeScanningAlertRuleSeverityEnum { + None = "none", + Note = "note", + Warning = "warning", + Error = "error", } -export type EnterpriseAdminUpdateAttributeForEnterpriseUserData = - ScimEnterpriseUser; - -export interface EnterpriseAdminUpdateAttributeForEnterpriseUserParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; +/** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ +export enum CodeScanningAlertSetState { + Open = "open", + Dismissed = "dismissed", } -export interface EnterpriseAdminUpdateAttributeForEnterpriseUserPayload { - /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ - Operations: object[]; - /** The SCIM schema URIs. */ - schemas: string[]; +/** State of a code scanning alert. */ +export enum CodeScanningAlertState { + Open = "open", + Dismissed = "dismissed", + Fixed = "fixed", } -export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData = - RunnerGroupsEnterprise; - -export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseParams { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; -} +/** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ +export type CodeScanningAnalysisAnalysisKey = string; -export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload { - /** Name of the runner group. */ - name?: string; - /** - * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` - * @default "all" - */ - visibility?: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVisibilityEnum; +export interface CodeScanningAnalysisCodeScanningAnalysis { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key: CodeScanningAnalysisAnalysisKey; + /** The commit SHA of the code scanning analysis file. */ + commit_sha: CodeScanningAnalysisCommitSha; + /** The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: CodeScanningAnalysisCreatedAt; + /** Identifies the variable values associated with the environment in which this analysis was performed. */ + environment: CodeScanningAnalysisEnvironment; + /** @example "error reading field xyz" */ + error: string; + /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ + ref: CodeScanningAnalysisRef; + /** The name of the tool used to generate the code scanning analysis alert. */ + tool_name: CodeScanningAnalysisToolName; } /** - * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` - * @default "all" + * The commit SHA of the code scanning analysis file. + * @minLength 40 + * @maxLength 40 + * @pattern ^[0-9a-fA-F]+$ */ -export enum EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVisibilityEnum { - Selected = "selected", - All = "all", -} +export type CodeScanningAnalysisCommitSha = string; /** - * Event - * Event + * The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ -export interface Event { - /** Actor */ - actor: Actor; - /** @format date-time */ - created_at: string | null; - id: string; - /** Actor */ - org?: Actor; - payload: { - action: string; - /** Comments provide a way for people to collaborate on an issue. */ - comment?: IssueComment; - /** Issue Simple */ - issue?: IssueSimple; - pages?: { - action?: string; - html_url?: string; - page_name?: string; - sha?: string; - summary?: string | null; - title?: string; - }[]; - }; - public: boolean; - repo: { - id: number; - name: string; - /** @format uri */ - url: string; - }; - type: string | null; -} +export type CodeScanningAnalysisCreatedAt = string; -/** - * Feed - * Feed - */ -export interface Feed { - _links: { - /** Hypermedia Link with Type */ - current_user?: LinkWithType; - /** Hypermedia Link with Type */ - current_user_actor?: LinkWithType; - /** Hypermedia Link with Type */ - current_user_organization?: LinkWithType; - current_user_organizations?: LinkWithType[]; - /** Hypermedia Link with Type */ - current_user_public?: LinkWithType; - /** Hypermedia Link with Type */ - security_advisories?: LinkWithType; - /** Hypermedia Link with Type */ - timeline: LinkWithType; - /** Hypermedia Link with Type */ - user: LinkWithType; - }; - /** @example "https://github.com/octocat.private.actor?token=abc123" */ - current_user_actor_url?: string; - /** @example "https://github.com/octocat-org" */ - current_user_organization_url?: string; - /** @example ["https://github.com/organizations/github/octocat.private.atom?token=abc123"] */ - current_user_organization_urls?: string[]; - /** @example "https://github.com/octocat" */ - current_user_public_url?: string; - /** @example "https://github.com/octocat.private?token=abc123" */ - current_user_url?: string; - /** @example "https://github.com/security-advisories" */ - security_advisories_url?: string; - /** @example "https://github.com/timeline" */ - timeline_url: string; - /** @example "https://github.com/{user}" */ - user_url: string; -} +/** Identifies the variable values associated with the environment in which this analysis was performed. */ +export type CodeScanningAnalysisEnvironment = string; -/** - * File Commit - * File Commit - */ -export interface FileCommit { - commit: { - author?: { - date?: string; - email?: string; - name?: string; - }; - committer?: { - date?: string; - email?: string; - name?: string; - }; - html_url?: string; - message?: string; - node_id?: string; - parents?: { - html_url?: string; - sha?: string; - url?: string; - }[]; - sha?: string; - tree?: { - sha?: string; - url?: string; - }; - url?: string; - verification?: { - payload?: string | null; - reason?: string; - signature?: string | null; - verified?: boolean; - }; - }; - content: { - _links?: { - git?: string; - html?: string; - self?: string; - }; - download_url?: string; - git_url?: string; - html_url?: string; - name?: string; - path?: string; - sha?: string; - size?: number; - type?: string; - url?: string; - } | null; +/** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ +export type CodeScanningAnalysisRef = string; + +/** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ +export type CodeScanningAnalysisSarifFile = string; + +export interface CodeScanningAnalysisTool { + /** The name of the tool used to generate the code scanning analysis alert. */ + name?: CodeScanningAnalysisToolName; + /** The version of the tool used to detect the alert. */ + version?: string | null; } -/** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ -export enum FilterEnum { - Assigned = "assigned", - Created = "created", - Mentioned = "mentioned", - Subscribed = "subscribed", - All = "all", +/** The name of the tool used to generate the code scanning analysis alert. */ +export type CodeScanningAnalysisToolName = string; + +export type CodeScanningGetAlertData = CodeScanningAlertCodeScanningAlert; + +export interface CodeScanningGetAlertParams { + alertNumber: number; + owner: string; + repo: string; } -/** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ -export enum FilterEnum1 { - Assigned = "assigned", - Created = "created", - Mentioned = "mentioned", - Subscribed = "subscribed", - All = "all", +export type CodeScanningListAlertsForRepoData = + CodeScanningAlertCodeScanningAlertItems[]; + +export interface CodeScanningListAlertsForRepoParams { + owner: string; + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + repo: string; + /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ + state?: CodeScanningAlertState; } -/** - * Filter members returned in the list. Can be one of: - * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \\* \`all\` - All members the authenticated user can see. - * @default "all" - */ -export enum FilterEnum2 { - Value2FaDisabled = "2fa_disabled", - All = "all", +export type CodeScanningListRecentAnalysesData = + CodeScanningAnalysisCodeScanningAnalysis[]; + +export interface CodeScanningListRecentAnalysesParams { + owner: string; + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAnalysisRef; + repo: string; + /** Set a single code scanning tool name to filter alerts by tool. */ + tool_name?: CodeScanningAnalysisToolName; } -/** - * Filter the list of outside collaborators. Can be one of: - * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \\* \`all\`: All outside collaborators. - * @default "all" - */ -export enum FilterEnum3 { - Value2FaDisabled = "2fa_disabled", - All = "all", +export type CodeScanningUpdateAlertData = CodeScanningAlertCodeScanningAlert; + +export interface CodeScanningUpdateAlertParams { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; } -/** - * Filters jobs by their \`completed_at\` timestamp. Can be one of: - * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. - * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. - * @default "latest" - */ -export enum FilterEnum4 { - Latest = "latest", - All = "all", +export interface CodeScanningUpdateAlertPayload { + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason?: CodeScanningAlertDismissedReason; + /** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ + state: CodeScanningAlertSetState; } -/** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ -export enum FilterEnum5 { - Latest = "latest", - All = "all", +export type CodeScanningUploadSarifData = any; + +export interface CodeScanningUploadSarifParams { + owner: string; + repo: string; } -/** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ -export enum FilterEnum6 { - Latest = "latest", - All = "all", +export interface CodeScanningUploadSarifPayload { + /** + * The base directory used in the analysis, as it appears in the SARIF file. + * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. + * @format uri + * @example "file:///github/workspace/" + */ + checkout_uri?: string; + /** The commit SHA of the code scanning analysis file. */ + commit_sha: CodeScanningAnalysisCommitSha; + /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ + ref: CodeScanningAnalysisRef; + /** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ + sarif: CodeScanningAnalysisSarifFile; + /** + * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date + */ + started_at?: string; + /** The name of the tool used to generate the code scanning analysis alert. */ + tool_name: CodeScanningAnalysisToolName; } /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" + * Code Search Result Item + * Code Search Result Item */ -export enum FilterEnum7 { - Assigned = "assigned", - Created = "created", - Mentioned = "mentioned", - Subscribed = "subscribed", - All = "all", +export interface CodeSearchResultItem { + file_size?: number; + /** @format uri */ + git_url: string; + /** @format uri */ + html_url: string; + language?: string | null; + /** @format date-time */ + last_modified_at?: string; + /** @example ["73..77","77..78"] */ + line_numbers?: string[]; + name: string; + path: string; + /** Minimal Repository */ + repository: MinimalRepository; + score: number; + sha: string; + text_matches?: SearchResultTextMatches; + /** @format uri */ + url: string; } -/** Forbidden */ -export type Forbidden = BasicError; +export type CodesOfConductGetAllCodesOfConductData = CodeOfConduct[]; -/** Forbidden Gist */ -export interface ForbiddenGist { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; +export type CodesOfConductGetConductCodeData = CodeOfConduct; + +export interface CodesOfConductGetConductCodeParams { + key: string; } -/** Found */ -export type Found = any; +export type CodesOfConductGetForRepoData = CodeOfConduct; + +export interface CodesOfConductGetForRepoParams { + owner: string; + repo: string; +} /** - * Full Repository - * Full Repository + * Collaborator + * Collaborator */ -export interface FullRepository { - /** @example true */ - allow_merge_commit?: boolean; - /** @example true */ - allow_rebase_merge?: boolean; - /** @example true */ - allow_squash_merge?: boolean; - /** - * Whether anonymous git access is allowed. - * @default true - */ - anonymous_access_enabled?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at: string; - /** @example "master" */ - default_branch: string; - /** @example false */ - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; +export interface Collaborator { /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" + * @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** @example true */ - has_downloads: boolean; - /** @example true */ - has_issues: boolean; - has_pages: boolean; - /** @example true */ - has_projects: boolean; - /** @example true */ - has_wiki: boolean; - /** - * @format uri - * @example "https://github.com" - */ - homepage: string | null; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @example "https://api.github.com/users/octocat/followers" */ - hooks_url: string; + followers_url: string; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; /** * @format uri - * @example "https://github.com/octocat/Hello-World" + * @example "https://github.com/octocat" */ html_url: string; - /** @example 1296269 */ + /** @example 1 */ id: number; - /** @example true */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" - */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" - */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; + /** @example "octocat" */ + login: string; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; /** * @format uri - * @example "git:git.example.com/octocat/Hello-World" + * @example "https://api.github.com/users/octocat/orgs" */ - mirror_url: string | null; - /** @example "Hello-World" */ - name: string; - /** @example 0 */ - network_count: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ - node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - organization?: SimpleUser | null; - owner: SimpleUser | null; - /** A git repository */ - parent?: Repository; + organizations_url: string; permissions?: { admin: boolean; pull: boolean; push: boolean; }; - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; /** - * @format date-time - * @example "2011-01-26T19:06:43Z" + * @format uri + * @example "https://api.github.com/users/octocat/received_events" */ - pushed_at: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** A git repository */ - source?: Repository; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; + received_events_url: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + * @example "https://api.github.com/users/octocat/repos" */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - /** @example 42 */ - subscribers_count: number; + repos_url: string; + site_admin: boolean; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + * @example "https://api.github.com/users/octocat/subscriptions" */ - subscribers_url: string; + subscriptions_url: string; + /** @example "User" */ + type: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + * @example "https://api.github.com/users/octocat" */ - subscription_url: string; - /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; + url: string; +} + +export interface CombinedBillingUsage { + /** Numbers of days left in billing cycle. */ + days_left_in_billing_cycle: number; + /** Estimated storage space (GB) used in billing cycle. */ + estimated_paid_storage_for_month: number; + /** Estimated sum of free and paid storage space (GB) used in billing cycle. */ + estimated_storage_for_month: number; +} + +/** + * Combined Commit Status + * Combined Commit Status + */ +export interface CombinedCommitStatus { + /** @format uri */ + commit_url: string; + /** Minimal Repository */ + repository: MinimalRepository; + sha: string; + state: string; + statuses: SimpleCommitStatus[]; + total_count: number; + /** @format uri */ + url: string; +} + +/** + * Commit + * Commit + */ +export interface Commit { + author: SimpleUser | null; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments" */ - tags_url: string; + comments_url: string; + commit: { + author: GitUser | null; + /** @example 0 */ + comment_count: number; + committer: GitUser | null; + /** @example "Fix all the bugs" */ + message: string; + tree: { + /** @example "827efc6d56897b048c772eb4087f854f46256132" */ + sha: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" + */ + url: string; + }; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + url: string; + verification?: Verification; + }; + committer: SimpleUser | null; + files?: { + additions?: number; + blob_url?: string; + changes?: number; + /** @example ""https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573"" */ + contents_url?: string; + deletions?: number; + filename?: string; + patch?: string; + /** @example ""subdir/before_name.txt"" */ + previous_filename?: string; + raw_url?: string; + /** @example ""1e8e60ce9733d5283f7836fa602b6365a66b2567"" */ + sha?: string; + status?: string; + }[]; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string | null; - template_repository?: Repository | null; - /** @example ["octocat","atom","electron","API"] */ - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" + * @example "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - updated_at: string; + html_url: string; + /** @example "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==" */ + node_id: string; + parents: { + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd" + */ + html_url?: string; + /** @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ + sha: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd" + */ + url: string; + }[]; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + sha: string; + stats?: { + additions?: number; + deletions?: number; + total?: number; + }; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ url: string; - /** - * The repository visibility: public, private, or internal. - * @example "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; } /** - * Gist Comment - * A comment made to a gist. + * Commit Activity + * Commit Activity */ -export interface GistComment { +export interface CommitActivity { + /** @example [0,3,26,20,39,1,0] */ + days: number[]; + /** @example 89 */ + total: number; + /** @example 1336280400 */ + week: number; +} + +/** + * Commit Comment + * Commit Comment + */ +export interface CommitComment { /** How the author is associated with the repository. */ author_association: AuthorAssociation; - /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" - */ body: string; - /** - * @format date-time - * @example "2011-04-18T23:23:56Z" - */ + commit_id: string; + /** @format date-time */ created_at: string; - /** @example 1 */ + /** @format uri */ + html_url: string; id: number; - /** @example "MDExOkdpc3RDb21tZW50MQ==" */ + line: number | null; node_id: string; - /** - * @format date-time - * @example "2011-04-18T23:23:56Z" - */ + path: string | null; + position: number | null; + reactions?: ReactionRollup; + /** @format date-time */ updated_at: string; - /** - * @format uri - * @example "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1" - */ + /** @format uri */ url: string; user: SimpleUser | null; } /** - * Gist Commit - * Gist Commit + * Commit Comparison + * Commit Comparison */ -export interface GistCommit { - change_status: { - additions?: number; - deletions?: number; - total?: number; - }; +export interface CommitComparison { + /** @example 4 */ + ahead_by: number; + /** Commit */ + base_commit: Commit; + /** @example 5 */ + behind_by: number; + commits: Commit[]; /** - * @format date-time - * @example "2010-04-14T02:15:15Z" + * @format uri + * @example "https://github.com/octocat/Hello-World/compare/master...topic.diff" */ - committed_at: string; + diff_url: string; + files: DiffEntry[]; /** * @format uri - * @example "https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f" + * @example "https://github.com/octocat/Hello-World/compare/master...topic" + */ + html_url: string; + /** Commit */ + merge_base_commit: Commit; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/compare/master...topic.patch" + */ + patch_url: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17" + */ + permalink_url: string; + /** @example "ahead" */ + status: CommitComparisonStatusEnum; + /** @example 6 */ + total_commits: number; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/compare/master...topic" */ url: string; - user: SimpleUser | null; - /** @example "57a7f021a713b1c5a6a199b54cc514735d2d462f" */ - version: string; } -/** - * Gist Simple - * Gist Simple - */ -export interface GistSimple { - comments?: number; - comments_url?: string; - commits_url?: string; - created_at?: string; - description?: string | null; - files?: Record< - string, - { - content?: string; - filename?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - type?: string; - } | null - >; - forks_url?: string; - git_pull_url?: string; - git_push_url?: string; - html_url?: string; - id?: string; - node_id?: string; - /** Simple User */ - owner?: SimpleUser; - public?: boolean; - truncated?: boolean; - updated_at?: string; - url?: string; - user?: string | null; +/** @example "ahead" */ +export enum CommitComparisonStatusEnum { + Diverged = "diverged", + Ahead = "ahead", + Behind = "behind", + Identical = "identical", } -export type GistsCheckIsStarredData = any; - -export type GistsCheckIsStarredError = object; - -export interface GistsCheckIsStarredParams { - /** gist_id parameter */ - gistId: string; +/** + * Commit Search Result Item + * Commit Search Result Item + */ +export interface CommitSearchResultItem { + author: SimpleUser | null; + /** @format uri */ + comments_url: string; + commit: { + author: { + /** @format date-time */ + date: string; + email: string; + name: string; + }; + comment_count: number; + committer: GitUser | null; + message: string; + tree: { + sha: string; + /** @format uri */ + url: string; + }; + /** @format uri */ + url: string; + verification?: Verification; + }; + committer: GitUser | null; + /** @format uri */ + html_url: string; + node_id: string; + parents: { + html_url?: string; + sha?: string; + url?: string; + }[]; + /** Minimal Repository */ + repository: MinimalRepository; + score: number; + sha: string; + text_matches?: SearchResultTextMatches; + /** @format uri */ + url: string; } -export type GistsCreateCommentData = GistComment; - -export interface GistsCreateCommentParams { - /** gist_id parameter */ - gistId: string; +/** Community Health File */ +export interface CommunityHealthFile { + /** @format uri */ + html_url: string; + /** @format uri */ + url: string; } -export interface GistsCreateCommentPayload { +/** + * Community Profile + * Community Profile + */ +export interface CommunityProfile { + /** @example true */ + content_reports_enabled?: boolean; + /** @example "My first repository on GitHub!" */ + description: string | null; + /** @example "example.com" */ + documentation: string | null; + files: { + code_of_conduct: CodeOfConductSimple | null; + contributing: CommunityHealthFile | null; + issue_template: CommunityHealthFile | null; + license: LicenseSimple | null; + pull_request_template: CommunityHealthFile | null; + readme: CommunityHealthFile | null; + }; + /** @example 100 */ + health_percentage: number; /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" + * @format date-time + * @example "2017-02-28T19:09:29Z" */ - body: string; + updated_at: string | null; } -export type GistsCreateData = GistSimple; - -export interface GistsCreatePayload { - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names and content for the files that make up the gist - * @example {"hello.rb":{"content":"puts \\"Hello, World!\\""}} - */ - files: Record< - string, - { - /** Content of the file */ - content: string; - } - >; - /** Flag indicating whether the gist is public */ - public?: boolean | GistsCreatePublicEnum; -} +/** Conflict */ +export type Conflict = BasicError; /** - * @default "false" - * @example "true" + * Content Directory + * A list of directory items */ -export enum GistsCreatePublicEnum { - True = "true", - False = "false", -} - -export type GistsDeleteCommentData = any; +export type ContentDirectory = { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content?: string; + /** @format uri */ + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; + /** @format uri */ + url: string; +}[]; -export interface GistsDeleteCommentParams { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ +export enum ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsDeleteData = any; - -export interface GistsDeleteParams { - /** gist_id parameter */ - gistId: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ +export enum ContentEnum1 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsForkData = BaseGist; - -export interface GistsForkParams { - /** gist_id parameter */ - gistId: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ +export enum ContentEnum2 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsGetCommentData = GistComment; - -export interface GistsGetCommentParams { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ +export enum ContentEnum3 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsGetData = GistSimple; - -export interface GistsGetParams { - /** gist_id parameter */ - gistId: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ +export enum ContentEnum4 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsGetRevisionData = GistSimple; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ +export enum ContentEnum5 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", +} -export interface GistsGetRevisionParams { - /** gist_id parameter */ - gistId: string; - sha: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ +export enum ContentEnum6 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type GistsListCommentsData = GistComment[]; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ +export enum ContentEnum7 { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", +} -export interface GistsListCommentsParams { - /** gist_id parameter */ - gistId: string; +/** + * Content File + * Content File + */ +export interface ContentFile { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content: string; + /** @format uri */ + download_url: string | null; + encoding: string; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + /** @example ""git://example.com/defunkt/dotjs.git"" */ + submodule_git_url?: string; + /** @example ""actual/actual.md"" */ + target?: string; + type: string; + /** @format uri */ + url: string; +} + +/** + * ContentReferenceAttachment + * Content Reference attachments allow you to provide context around URLs posted in comments + */ +export interface ContentReferenceAttachment { /** - * Page number of the results to fetch. - * @default 1 + * The body of the attachment + * @maxLength 262144 + * @example "Body of the attachment" */ - page?: number; + body: string; /** - * Results per page (max 100) - * @default 30 + * The ID of the attachment + * @example 21 */ - per_page?: number; -} - -export type GistsListCommitsData = GistCommit[]; - -export interface GistsListCommitsParams { - /** gist_id parameter */ - gistId: string; + id: number; /** - * Page number of the results to fetch. - * @default 1 + * The node_id of the content attachment + * @example "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=" */ - page?: number; + node_id?: string; /** - * Results per page (max 100) - * @default 30 + * The title of the attachment + * @maxLength 1024 + * @example "Title of the attachment" */ - per_page?: number; + title: string; } -export type GistsListData = BaseGist[]; +/** + * Symlink Content + * An object describing a symlink + */ +export interface ContentSubmodule { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + /** @format uri */ + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + /** @format uri */ + submodule_git_url: string; + type: string; + /** @format uri */ + url: string; +} -export type GistsListForUserData = BaseGist[]; +/** + * Symlink Content + * An object describing a symlink + */ +export interface ContentSymlink { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + /** @format uri */ + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + target: string; + type: string; + /** @format uri */ + url: string; +} -export interface GistsListForUserParams { +/** + * Content Traffic + * Content Traffic + */ +export interface ContentTraffic { + /** @example 3542 */ + count: number; + /** @example "/github/hubot" */ + path: string; + /** @example "github/hubot: A customizable life embetterment robot." */ + title: string; + /** @example 2225 */ + uniques: number; +} + +/** + * Content Tree + * Content Tree + */ +export interface ContentTree { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + /** @format uri */ + download_url: string | null; + entries?: { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content?: string; + /** @format uri */ + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; + /** @format uri */ + url: string; + }[]; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; + /** @format uri */ + url: string; +} + +/** + * Contributor + * Contributor + */ +export interface Contributor { + /** @format uri */ + avatar_url?: string; + contributions: number; + email?: string; + events_url?: string; + /** @format uri */ + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string | null; + /** @format uri */ + html_url?: string; + id?: number; + login?: string; + name?: string; + node_id?: string; + /** @format uri */ + organizations_url?: string; + /** @format uri */ + received_events_url?: string; + /** @format uri */ + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + /** @format uri */ + subscriptions_url?: string; + type: string; + /** @format uri */ + url?: string; +} + +/** + * Contributor Activity + * Contributor Activity + */ +export interface ContributorActivity { + author: SimpleUser | null; + /** @example 135 */ + total: number; + /** @example [{"w":"1367712000","a":6898,"d":77,"c":10}] */ + weeks: { + a?: number; + c?: number; + d?: number; + w?: string; + }[]; +} + +/** + * Credential Authorization + * Credential Authorization + */ +export interface CredentialAuthorization { + /** @example 12345678 */ + authorized_credential_id?: number | null; /** - * Page number of the results to fetch. - * @default 1 + * The note given to the token. This will only be present when the credential is a token. + * @example "my token" */ - page?: number; + authorized_credential_note?: string | null; /** - * Results per page (max 100) - * @default 30 + * The title given to the ssh key. This will only be present when the credential is an ssh key. + * @example "my ssh key" */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - username: string; -} - -export type GistsListForksData = GistSimple[]; - -export interface GistsListForksParams { - /** gist_id parameter */ - gistId: string; + authorized_credential_title?: string | null; /** - * Page number of the results to fetch. - * @default 1 + * Date when the credential was last accessed. May be null if it was never accessed + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - page?: number; + credential_accessed_at?: string | null; /** - * Results per page (max 100) - * @default 30 + * Date when the credential was authorized for use. + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - per_page?: number; -} - -export interface GistsListParams { + credential_authorized_at: string; /** - * Page number of the results to fetch. - * @default 1 + * Unique identifier for the credential. + * @example 1 */ - page?: number; + credential_id: number; /** - * Results per page (max 100) - * @default 30 + * Human-readable description of the credential type. + * @example "SSH Key" */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; -} - -export type GistsListPublicData = BaseGist[]; - -export interface GistsListPublicParams { + credential_type: string; /** - * Page number of the results to fetch. - * @default 1 + * Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. + * @example "jklmnop12345678" */ - page?: number; + fingerprint?: string; /** - * Results per page (max 100) - * @default 30 + * User login that owns the underlying credential. + * @example "monalisa" */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; -} - -export type GistsListStarredData = BaseGist[]; - -export interface GistsListStarredParams { + login: string; /** - * Page number of the results to fetch. - * @default 1 + * List of oauth scopes the token has been granted. + * @example ["user","repo"] */ - page?: number; + scopes?: string[]; /** - * Results per page (max 100) - * @default 30 + * Last eight characters of the credential. Only included in responses with credential_type of personal access token. + * @example "12345678" */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; -} - -export type GistsStarData = any; - -export interface GistsStarParams { - /** gist_id parameter */ - gistId: string; -} - -export type GistsUnstarData = any; - -export interface GistsUnstarParams { - /** gist_id parameter */ - gistId: string; + token_last_eight?: string; } -export type GistsUpdateCommentData = GistComment; - -export interface GistsUpdateCommentParams { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; +/** + * Deploy Key + * An SSH key granting access to a single repository. + */ +export interface DeployKey { + created_at: string; + id: number; + key: string; + read_only: boolean; + title: string; + url: string; + verified: boolean; } -export interface GistsUpdateCommentPayload { +/** + * Deployment + * A request for a specific ref(branch,sha,tag) to be deployed + */ +export interface Deployment { /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" + * @format date-time + * @example "2012-07-20T01:19:13Z" */ - body: string; -} - -export type GistsUpdateData = GistSimple; - -export interface GistsUpdateParams { - /** gist_id parameter */ - gistId: string; -} - -export type GistsUpdatePayload = null & { + created_at: string; + creator: SimpleUser | null; + /** @example "Deploy request from hubot" */ + description: string | null; /** - * Description of the gist - * @example "Example Ruby script" + * Name for the target deployment environment. + * @example "production" */ - description?: string; + environment: string; /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + * Unique identifier of the deployment + * @example 42 */ - files?: Record< - string, - (object | null) & - ({ - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } | null) - >; -}; + id: number; + /** @example "MDEwOkRlcGxveW1lbnQx" */ + node_id: string; + /** @example "staging" */ + original_environment?: string; + payload: object; + performed_via_github_app?: Integration | null; + /** + * Specifies if the given environment is one that end-users directly interact with. Default: false. + * @example true + */ + production_environment?: boolean; + /** + * The ref to deploy. This can be a branch, tag, or sha. + * @example "topic-branch" + */ + ref: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example" + */ + repository_url: string; + /** @example "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d" */ + sha: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/deployments/1/statuses" + */ + statuses_url: string; + /** + * Parameter to specify a task to execute + * @example "deploy" + */ + task: string; + /** + * Specifies if the given environment is will no longer exist at some point in the future. Default: false. + * @example true + */ + transient_environment?: boolean; + /** + * @format date-time + * @example "2012-07-20T01:19:13Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/deployments/1" + */ + url: string; +} /** - * Git Commit - * Low-level Git commit operations within a repository + * Deployment Status + * The status of a deployment. */ -export interface GitCommit { - /** Identifying information for the git-user */ - author: { - /** - * Timestamp of the commit - * @format date-time - * @example "2014-08-09T08:02:04+12:00" - */ - date: string; - /** - * Git email address of the user - * @example "monalisa.octocat@example.com" - */ - email: string; - /** - * Name of the git user - * @example "Monalisa Octocat" - */ - name: string; - }; - /** Identifying information for the git-user */ - committer: { - /** - * Timestamp of the commit - * @format date-time - * @example "2014-08-09T08:02:04+12:00" - */ - date: string; - /** - * Git email address of the user - * @example "monalisa.octocat@example.com" - */ - email: string; - /** - * Name of the git user - * @example "Monalisa Octocat" - */ - name: string; - }; - /** @format uri */ - html_url: string; +export interface DeploymentStatus { /** - * Message describing the purpose of the commit - * @example "Fix #42" + * @format date-time + * @example "2012-07-20T01:19:13Z" */ - message: string; + created_at: string; + creator: SimpleUser | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/deployments/42" + */ + deployment_url: string; + /** + * A short description of the status. + * @maxLength 140 + * @default "" + * @example "Deployment finished successfully." + */ + description: string; + /** + * The environment of the deployment that the status is for. + * @default "" + * @example "production" + */ + environment?: string; + /** + * The URL for accessing your environment. + * @format uri + * @default "" + * @example "https://staging.example.com/" + */ + environment_url?: string; + /** @example 1 */ + id: number; + /** + * The URL to associate with this status. + * @format uri + * @default "" + * @example "https://example.com/deployment/42/output" + */ + log_url?: string; + /** @example "MDE2OkRlcGxveW1lbnRTdGF0dXMx" */ node_id: string; - parents: { - /** @format uri */ - html_url: string; - /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - /** @format uri */ - url: string; - }[]; + performed_via_github_app?: Integration | null; /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + * @format uri + * @example "https://api.github.com/repos/octocat/example" + */ + repository_url: string; + /** + * The state of the status. + * @example "success" + */ + state: DeploymentStatusStateEnum; + /** + * Deprecated: the URL to associate with this status. + * @format uri + * @default "" + * @example "https://example.com/deployment/42/output" + */ + target_url: string; + /** + * @format date-time + * @example "2012-07-20T01:19:13Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/deployments/42/statuses/1" */ - sha: string; - tree: { - /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - /** @format uri */ - url: string; - }; - /** @format uri */ url: string; - verification: { - payload: string | null; - reason: string; - signature: string | null; - verified: boolean; - }; } -export type GitCreateBlobData = ShortBlob; - -export interface GitCreateBlobParams { - owner: string; - repo: string; +/** + * The state of the status. + * @example "success" + */ +export enum DeploymentStatusStateEnum { + Error = "error", + Failure = "failure", + Inactive = "inactive", + Pending = "pending", + Success = "success", + Queued = "queued", + InProgress = "in_progress", } -export interface GitCreateBlobPayload { - /** The new blob's content. */ - content: string; +/** + * Diff Entry + * Diff Entry + */ +export interface DiffEntry { + /** @example 103 */ + additions: number; /** - * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. - * @default "utf-8" + * @format uri + * @example "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" */ - encoding?: string; + blob_url: string; + /** @example 124 */ + changes: number; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + contents_url: string; + /** @example 21 */ + deletions: number; + /** @example "file1.txt" */ + filename: string; + /** @example "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" */ + patch?: string; + /** @example "file.txt" */ + previous_filename?: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" + */ + raw_url: string; + /** @example "bbcd538c8e72b8c175046e27cc8f907076331401" */ + sha: string; + /** @example "added" */ + status: string; } -export type GitCreateCommitData = GitCommit; - -export interface GitCreateCommitParams { - owner: string; - repo: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum { + Asc = "asc", + Desc = "desc", } -export interface GitCreateCommitPayload { - /** Information about the author of the commit. By default, the \`author\` will be the authenticated user and the current date. See the \`author\` and \`committer\` object below for details. */ - author?: { - /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** Information about the person who is making the commit. By default, \`committer\` will use the information set in \`author\`. See the \`author\` and \`committer\` object below for details. */ - committer?: { - /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The commit message */ - message: string; - /** The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ - parents?: string[]; - /** The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the \`gpgsig\` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a \`signature\` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ - signature?: string; - /** The SHA of the tree object this commit points to */ - tree: string; +/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum DirectionEnum1 { + Asc = "asc", + Desc = "desc", } -export type GitCreateRefData = GitRef; - -export interface GitCreateRefParams { - owner: string; - repo: string; +/** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ +export enum DirectionEnum10 { + Asc = "asc", + Desc = "desc", } -export interface GitCreateRefPayload { - /** @example ""refs/heads/newbranch"" */ - key?: string; - /** The name of the fully qualified reference (ie: \`refs/heads/master\`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ - ref: string; - /** The SHA1 value for this reference. */ - sha: string; +/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ +export enum DirectionEnum11 { + Asc = "asc", + Desc = "desc", } -export type GitCreateTagData = GitTag; - -export interface GitCreateTagParams { - owner: string; - repo: string; +/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ +export enum DirectionEnum12 { + Asc = "asc", + Desc = "desc", } -export interface GitCreateTagPayload { - /** The tag message. */ - message: string; - /** 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; - /** An object with information about the individual creating the tag. */ - tagger?: { - /** When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author of the tag */ - email?: string; - /** The name of the author of the tag */ - name?: string; - }; - /** The type of the object we're tagging. Normally this is a \`commit\` but it can also be a \`tree\` or a \`blob\`. */ - type: GitCreateTagTypeEnum; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum13 { + Asc = "asc", + Desc = "desc", } -/** The type of the object we're tagging. Normally this is a \`commit\` but it can also be a \`tree\` or a \`blob\`. */ -export enum GitCreateTagTypeEnum { - Commit = "commit", - Tree = "tree", - Blob = "blob", +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum14 { + Asc = "asc", + Desc = "desc", } -export type GitCreateTreeData = GitTree; - -/** The file mode; 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. */ -export enum GitCreateTreeModeEnum { - Value100644 = "100644", - Value100755 = "100755", - Value040000 = "040000", - Value160000 = "160000", - Value120000 = "120000", +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum15 { + Asc = "asc", + Desc = "desc", } -export interface GitCreateTreeParams { - owner: string; - repo: string; +/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ +export enum DirectionEnum16 { + Asc = "asc", + Desc = "desc", } -export interface GitCreateTreePayload { - /** - * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by \`base_tree\` and entries defined in the \`tree\` parameter. Entries defined in the \`tree\` parameter will overwrite items from \`base_tree\` with the same \`path\`. If you're creating new changes on a branch, then normally you'd set \`base_tree\` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. - * If not provided, GitHub will create a new Git tree object from only the entries defined in the \`tree\` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the \`tree\` parameter will be listed as deleted by the new commit. - */ - base_tree?: string; - /** Objects (of \`path\`, \`mode\`, \`type\`, and \`sha\`) specifying a tree structure. */ - tree: { - /** - * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or \`tree.sha\`. - * - * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. - */ - content?: string; - /** The file mode; 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. */ - mode?: GitCreateTreeModeEnum; - /** The file referenced in the tree. */ - path?: string; - /** - * The SHA1 checksum ID of the object in the tree. Also called \`tree.sha\`. If the value is \`null\` then the file will be deleted. - * - * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. - */ - sha?: string | null; - /** Either \`blob\`, \`tree\`, or \`commit\`. */ - type?: GitCreateTreeTypeEnum; - }[]; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum17 { + Asc = "asc", + Desc = "desc", } -/** Either \`blob\`, \`tree\`, or \`commit\`. */ -export enum GitCreateTreeTypeEnum { - Blob = "blob", - Tree = "tree", - Commit = "commit", +/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ +export enum DirectionEnum18 { + Asc = "asc", + Desc = "desc", } -export type GitDeleteRefData = any; - -export interface GitDeleteRefParams { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum19 { + Asc = "asc", + Desc = "desc", } -export type GitGetBlobData = Blob; - -export interface GitGetBlobParams { - fileSha: string; - owner: string; - repo: string; +/** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum DirectionEnum2 { + Asc = "asc", + Desc = "desc", } -export type GitGetCommitData = GitCommit; - -export interface GitGetCommitParams { - /** commit_sha parameter */ - commitSha: string; - owner: string; - repo: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum3 { + Asc = "asc", + Desc = "desc", } -export type GitGetRefData = GitRef; - -export interface GitGetRefParams { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; +/** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ +export enum DirectionEnum4 { + Asc = "asc", + Desc = "desc", } -export type GitGetTagData = GitTag; - -export interface GitGetTagParams { - owner: string; - repo: string; - tagSha: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum5 { + Asc = "asc", + Desc = "desc", } -export type GitGetTreeData = GitTree; - -export interface GitGetTreeParams { - owner: string; - /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ - recursive?: string; - repo: string; - treeSha: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum6 { + Asc = "asc", + Desc = "desc", } -export type GitListMatchingRefsData = GitRef[]; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum DirectionEnum7 { + Asc = "asc", + Desc = "desc", +} -export interface GitListMatchingRefsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** ref+ parameter */ - ref: string; - repo: string; +/** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum DirectionEnum8 { + Asc = "asc", + Desc = "desc", } /** - * Git Reference - * Git references within a repository + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" */ -export interface GitRef { - node_id: string; - object: { - /** - * SHA for the reference - * @minLength 40 - * @maxLength 40 - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - type: string; - /** @format uri */ - url: string; - }; - ref: string; - /** @format uri */ - url: string; +export enum DirectionEnum9 { + Asc = "asc", + Desc = "desc", } /** - * Git Tag - * Metadata for a Git tag + * Email + * Email */ -export interface GitTag { +export interface Email { /** - * Message describing the purpose of the tag - * @example "Initial public release" + * @format email + * @example "octocat@github.com" */ - message: string; - /** @example "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==" */ - node_id: string; - object: { - sha: string; - type: string; - /** @format uri */ - url: string; - }; - /** @example "940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ - sha: string; - /** - * Name of the tag - * @example "v0.0.1" - */ - tag: string; - tagger: { - date: string; - email: string; - name: string; - }; - /** - * URL for the tag - * @format uri - * @example "https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" - */ - url: string; - verification?: Verification; -} - -/** - * Git Tree - * The hierarchy between files in a Git repository. - */ -export interface GitTree { - sha: string; - /** - * Objects specifying a tree structure - * @example [{"path":"file.rb","mode":"100644","type":"blob","size":30,"sha":"44b4fc6d56897b048c772eb4087f854f46256132","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132","properties":{"path":{"type":"string"},"mode":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"sha":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"]}] - */ - tree: { - /** @example "040000" */ - mode?: string; - /** @example "test/file.rb" */ - path?: string; - /** @example "23f6827669e43831def8a7ad935069c8bd418261" */ - sha?: string; - /** @example 12 */ - size?: number; - /** @example "tree" */ - type?: string; - /** @example "https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261" */ - url?: string; - }[]; - truncated: boolean; - /** @format uri */ - url: string; -} - -export type GitUpdateRefData = GitRef; - -export interface GitUpdateRefParams { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; -} - -export interface GitUpdateRefPayload { - /** - * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to \`false\` will make sure you're not overwriting work. - * @default false - */ - force?: boolean; - /** The SHA1 value to set this reference to */ - sha: string; -} - -/** - * Git User - * Metaproperties for Git author/committer information. - */ -export interface GitUser { - /** @example ""2007-10-29T02:42:39.000-07:00"" */ - date?: string; - /** @example ""chris@ozmm.org"" */ - email?: string; - /** @example ""Chris Wanstrath"" */ - name?: string; -} - -export type GitignoreGetAllTemplatesData = string[]; - -export type GitignoreGetTemplateData = GitignoreTemplate; - -export interface GitignoreGetTemplateParams { - name: string; -} - -/** - * Gitignore Template - * Gitignore Template - */ -export interface GitignoreTemplate { - /** @example "C" */ - name: string; - /** - * @example "# Object files - * *.o - * - * # Libraries - * *.lib - * *.a - * - * # Shared objects (inc. Windows DLLs) - * *.dll - * *.so - * *.so.* - * *.dylib - * - * # Executables - * *.exe - * *.out - * *.app - * " - */ - source: string; + email: string; + /** @example true */ + primary: boolean; + /** @example true */ + verified: boolean; + /** @example "public" */ + visibility: string | null; } -/** Gone */ -export type Gone = BasicError; +export type EmojisGetData = Record; -/** - * GPG Key - * A unique encryption key - */ -export interface GpgKey { - /** @example true */ - can_certify: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - /** @example true */ - can_sign: boolean; - /** - * @format date-time - * @example "2016-03-24T11:31:04-06:00" - */ - created_at: string; - /** @example [{"email":"mastahyeti@users.noreply.github.com","verified":true}] */ - emails: { - email?: string; - verified?: boolean; - }[]; - /** @format date-time */ - expires_at: string | null; - /** @example 3 */ - id: number; - /** @example "3262EFF25BA0D270" */ - key_id: string; - primary_key_id: number | null; - /** @example "xsBNBFayYZ..." */ - public_key: string; - raw_key: string | null; - /** @example [{"id":4,"primary_key_id":3,"key_id":"4A595D4C72EE49C7","public_key":"zsBNBFayYZ...","emails":[],"subkeys":[],"can_sign":false,"can_encrypt_comms":true,"can_encrypt_storage":true,"can_certify":false,"created_at":"2016-03-24T11:31:04-06:00","expires_at":null}] */ - subkeys: { - can_certify?: boolean; - can_encrypt_comms?: boolean; - can_encrypt_storage?: boolean; - can_sign?: boolean; - created_at?: string; - emails?: any[]; - expires_at?: string | null; - id?: number; - key_id?: string; - primary_key_id?: number; - public_key?: string; - raw_key?: string | null; - subkeys?: any[]; - }[]; +/** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ +export enum EnabledOrganizations { + All = "all", + None = "none", + Selected = "selected", } -/** - * GroupMapping - * External Groups to be mapped to a team for membership - */ -export interface GroupMapping { - /** - * a description of the group - * @example "A group of Developers working on AzureAD SAML SSO" - */ - group_description?: string; - /** - * The ID of the group - * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" - */ - group_id?: string; - /** - * The name of the group - * @example "saml-azuread-test" - */ - group_name?: string; - /** - * Array of groups to be mapped to this team - * @example [{"group_id":"111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa","group_name":"saml-azuread-test","group_description":"A group of Developers working on AzureAD SAML SSO"},{"group_id":"2bb2bb2b-bb22-22bb-2bb2-bb2bbb2bb2b2","group_name":"saml-azuread-test2","group_description":"Another group of Developers working on AzureAD SAML SSO"}] - */ - groups?: { - /** - * a description of the group - * @example "A group of Developers working on AzureAD SAML SSO" - */ - group_description: string; - /** - * The ID of the group - * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" - */ - group_id: string; - /** - * The name of the group - * @example "saml-azuread-test" - */ - group_name: string; - }[]; - /** - * synchronization status for this group mapping - * @example "unsynced" - */ - status?: string; - /** - * the time of the last sync for this group-mapping - * @example "2019-06-03 22:27:15:000 -700" - */ - synced_at?: string; +/** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ +export enum EnabledRepositories { + All = "all", + None = "none", + Selected = "selected", } /** - * Webhook - * Webhooks for repositories. + * Enterprise + * An enterprise account */ -export interface Hook { - /** - * Determines whether the hook is actually triggered on pushes. - * @example true - */ - active: boolean; - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** @example ""sha256"" */ - digest?: string; - /** @example ""foo@bar.com"" */ - email?: string; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""foo"" */ - password?: string; - /** @example ""roomer"" */ - room?: string; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** @example ""foo"" */ - subdomain?: string; - /** @example ""abc"" */ - token?: string; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; - }; +export interface Enterprise { + /** @format uri */ + avatar_url: string; /** * @format date-time - * @example "2011-09-06T17:26:27Z" + * @example "2019-01-26T19:01:12Z" */ - created_at: string; + created_at: string | null; + /** A short description of the enterprise. */ + description?: string | null; /** - * Determines what events the hook is triggered for. Default: ['push']. - * @example ["push","pull_request"] + * @format uri + * @example "https://github.com/enterprises/octo-business" */ - events: string[]; + html_url: string; /** - * Unique identifier of the webhook. + * Unique identifier of the enterprise * @example 42 */ id: number; - last_response: HookResponse; /** - * The name of a valid service, use 'web' for a webhook. - * @example "web" + * The name of the enterprise. + * @example "Octo Business" */ name: string; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings" - */ - ping_url: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/test" + * The slug url identifier for the enterprise. + * @example "octo-business" */ - test_url: string; - type: string; + slug: string; /** * @format date-time - * @example "2011-09-06T20:39:23Z" + * @example "2019-01-26T19:14:43Z" */ - updated_at: string; + updated_at: string | null; /** + * The enterprise's website URL. * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1" */ - url: string; + website_url?: string | null; } -/** Hook Response */ -export interface HookResponse { - code: number | null; - message: string | null; - status: string | null; +export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; + +export interface EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * Hovercard - * Hovercard - */ -export interface Hovercard { - contexts: { - message: string; - octicon: string; - }[]; +export type EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData = any; + +export interface EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** - * Import - * A repository import from an external source. - */ -export interface Import { - authors_count?: number | null; - /** @format uri */ - authors_url: string; - commit_count?: number | null; - error_message?: string | null; - failed_step?: string | null; - has_large_files?: boolean; - /** @format uri */ - html_url: string; - import_percent?: number | null; - large_files_count?: number; - large_files_size?: number; - message?: string; - project_choices?: { - human_name?: string; - tfvc_project?: string; - vcs?: string; - }[]; - push_percent?: number | null; - /** @format uri */ - repository_url: string; - status: ImportStatusEnum; - status_text?: string | null; - svc_root?: string; - svn_root?: string; - tfvc_project?: string; - /** @format uri */ - url: string; - use_lfs?: string; - vcs: string | null; - /** The URL of the originating repository. */ - vcs_url: string; +export type EnterpriseAdminCreateRegistrationTokenForEnterpriseData = + AuthenticationToken; + +export interface EnterpriseAdminCreateRegistrationTokenForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export enum ImportStatusEnum { - Auth = "auth", - Error = "error", - None = "none", - Detecting = "detecting", - Choose = "choose", - AuthFailed = "auth_failed", - Importing = "importing", - Mapping = "mapping", - WaitingToPush = "waiting_to_push", - Pushing = "pushing", - Complete = "complete", - Setup = "setup", - Unknown = "unknown", - DetectionFoundMultiple = "detection_found_multiple", - DetectionFoundNothing = "detection_found_nothing", - DetectionNeedsAuth = "detection_needs_auth", +export type EnterpriseAdminCreateRemoveTokenForEnterpriseData = + AuthenticationToken; + +export interface EnterpriseAdminCreateRemoveTokenForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ -export enum IncludeEnum { - Web = "web", - Git = "git", - All = "all", +export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; + +export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ -export enum IncludeEnum1 { - Web = "web", - Git = "git", +export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload { + /** Name of the runner group. */ + name: string; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + /** List of organization IDs that can access the runner group. */ + selected_organization_ids?: number[]; + /** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ + visibility?: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVisibilityEnum; +} + +/** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ +export enum EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseVisibilityEnum { + Selected = "selected", All = "all", } -/** - * Installation - * Installation - */ -export interface Installation { - /** - * @format uri - * @example "https://api.github.com/installations/1/access_tokens" - */ - access_tokens_url: string; - account: SimpleUser | Enterprise | null; - /** @example 1 */ - app_id: number; - /** @example "github-actions" */ - app_slug: string; - /** @example ""test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"" */ - contact_email?: string | null; - /** @format date-time */ - created_at: string; - events: string[]; - /** @example true */ - has_multiple_single_files?: boolean; - /** - * @format uri - * @example "https://github.com/organizations/github/settings/installations/1" - */ - html_url: string; - /** - * The ID of the installation. - * @example 1 - */ - id: number; - /** @example {"issues":"read","deployments":"write"} */ - permissions: { - checks?: string; - contents?: string; - deployments?: string; - /** @example ""read"" */ - issues?: string; - metadata?: string; - /** @example ""read"" */ - organization_administration?: string; - pull_requests?: string; - statuses?: string; - }; - /** - * @format uri - * @example "https://api.github.com/installation/repositories" - */ - repositories_url: string; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection: InstallationRepositorySelectionEnum; - /** @example "config.yaml" */ - single_file_name: string | null; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; - /** @format date-time */ - suspended_at?: string | null; - suspended_by?: SimpleUser | null; - /** The ID of the user or organization this token is being scoped to. */ - target_id: number; - /** @example "Organization" */ - target_type: string; - /** @format date-time */ - updated_at: string; -} +export type EnterpriseAdminDeleteScimGroupFromEnterpriseData = any; -/** Describe whether all repositories have been selected or there's a selection involved */ -export enum InstallationRepositorySelectionEnum { - All = "all", - Selected = "selected", +export interface EnterpriseAdminDeleteScimGroupFromEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; } -/** - * Installation Token - * Authentication token for a GitHub App installed on a user or org. - */ -export interface InstallationToken { - expires_at: string; - /** @example true */ - has_multiple_single_files?: boolean; - permissions?: { - contents?: string; - issues?: string; - /** @example "read" */ - metadata?: string; - /** @example "read" */ - single_file?: string; - }; - repositories?: Repository[]; - repository_selection?: InstallationTokenRepositorySelectionEnum; - /** @example "README.md" */ - single_file?: string; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; - token: string; -} +export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData = any; -export enum InstallationTokenRepositorySelectionEnum { - All = "all", - Selected = "selected", +export interface EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** - * GitHub app - * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. - */ -export interface Integration { - /** @example ""Iv1.25b5d1e65ffc4022"" */ - client_id?: string; - /** @example ""1d4b2097ac622ba702d19de498f005747a8b21d3"" */ - client_secret?: string; - /** - * @format date-time - * @example "2017-07-08T16:18:44-04:00" - */ - created_at: string; - /** @example "The description of the app." */ - description: string | null; - /** - * The list of events for the GitHub app - * @example ["label","deployment"] - */ - events: string[]; - /** - * @format uri - * @example "https://example.com" - */ - external_url: string; - /** - * @format uri - * @example "https://github.com/apps/super-ci" - */ - html_url: string; - /** - * Unique identifier of the GitHub app - * @example 37 - */ - id: number; - /** - * The number of installations associated with the GitHub app - * @example 5 - */ - installations_count?: number; - /** - * The name of the GitHub app - * @example "Probot Owners" - */ - name: string; - /** @example "MDExOkludGVncmF0aW9uMQ==" */ - node_id: string; - owner: SimpleUser | null; - /** @example ""-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\n-----END RSA PRIVATE KEY-----\\n"" */ - pem?: string; - /** - * The set of permissions for the GitHub app - * @example {"issues":"read","deployments":"write"} - */ - permissions: { - checks?: string; - contents?: string; - deployments?: string; - issues?: string; - metadata?: string; - [key: string]: any; - }; - /** - * The slug name of the GitHub app - * @example "probot-owners" - */ - slug?: string; - /** - * @format date-time - * @example "2017-07-08T16:18:44-04:00" - */ - updated_at: string; - /** @example ""6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b"" */ - webhook_secret?: string; - [key: string]: any; -} +export type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData = any; -/** - * The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. - * @example "one_month" - */ -export enum InteractionExpiry { - OneDay = "one_day", - ThreeDays = "three_days", - OneWeek = "one_week", - OneMonth = "one_month", - SixMonths = "six_months", +export interface EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. - * @example "collaborators_only" - */ -export enum InteractionGroup { - ExistingUsers = "existing_users", - ContributorsOnly = "contributors_only", - CollaboratorsOnly = "collaborators_only", -} +export type EnterpriseAdminDeleteUserFromEnterpriseData = any; -/** - * Interaction Restrictions - * Limit interactions to a specific type of user for a specified duration - */ -export interface InteractionLimit { - /** The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. */ - expiry?: InteractionExpiry; - /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ - limit: InteractionGroup; +export interface EnterpriseAdminDeleteUserFromEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; } -/** - * Interaction Limits - * Interaction limit settings. - */ -export interface InteractionLimitResponse { - /** - * @format date-time - * @example "2018-08-17T04:18:39Z" - */ - expires_at: string; - /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ - limit: InteractionGroup; - /** @example "repository" */ - origin: string; -} +export type EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData = + any; -export type InteractionsGetRestrictionsForAuthenticatedUserData = - InteractionLimitResponse; +export interface EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; +} -export type InteractionsGetRestrictionsForOrgData = InteractionLimitResponse; +export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData = + any; -export interface InteractionsGetRestrictionsForOrgParams { - org: string; +export interface EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; } -export type InteractionsGetRestrictionsForRepoData = InteractionLimitResponse; +export type EnterpriseAdminGetAllowedActionsEnterpriseData = SelectedActions; -export interface InteractionsGetRestrictionsForRepoParams { - owner: string; - repo: string; +export interface EnterpriseAdminGetAllowedActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export type InteractionsRemoveRestrictionsForAuthenticatedUserData = any; - -export type InteractionsRemoveRestrictionsForOrgData = any; +export type EnterpriseAdminGetGithubActionsPermissionsEnterpriseData = + ActionsEnterprisePermissions; -export interface InteractionsRemoveRestrictionsForOrgParams { - org: string; +export interface EnterpriseAdminGetGithubActionsPermissionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export type InteractionsRemoveRestrictionsForRepoData = any; +export type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData = + ScimEnterpriseGroup; -export interface InteractionsRemoveRestrictionsForRepoParams { - owner: string; - repo: string; +export interface EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; } -export type InteractionsSetRestrictionsForAuthenticatedUserData = - InteractionLimitResponse; +export type EnterpriseAdminGetProvisioningInformationForEnterpriseUserData = + ScimEnterpriseUser; -export type InteractionsSetRestrictionsForOrgData = InteractionLimitResponse; +export interface EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; +} -export interface InteractionsSetRestrictionsForOrgParams { - org: string; +export type EnterpriseAdminGetSelfHostedRunnerForEnterpriseData = Runner; + +export interface EnterpriseAdminGetSelfHostedRunnerForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -export type InteractionsSetRestrictionsForRepoData = InteractionLimitResponse; +export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; -export interface InteractionsSetRestrictionsForRepoParams { - owner: string; - repo: string; +export interface EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** Internal Error */ -export type InternalError = BasicError; +export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData { + organizations: OrganizationSimple[]; + total_count: number; +} -/** - * Issue - * Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. - */ -export interface Issue { - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; +export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * Contents of the issue - * @example "It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?" + * Page number of the results to fetch. + * @default 1 */ - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - closed_by?: SimpleUser | null; - comments: number; - /** @format uri */ - comments_url: string; - /** @format date-time */ - created_at: string; - /** @format uri */ - events_url: string; - /** @format uri */ - html_url: string; - id: number; + page?: number; /** - * Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository - * @example ["bug","registration"] + * Results per page (max 100) + * @default 30 */ - labels: ( - | string - | { - color?: string | null; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - /** @format uri */ - url?: string; - } - )[]; - labels_url: string; - locked: boolean; - milestone: Milestone | null; - node_id: string; + per_page?: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; +} + +export type EnterpriseAdminListProvisionedGroupsEnterpriseData = + ScimGroupListEnterprise; + +export interface EnterpriseAdminListProvisionedGroupsEnterpriseParams { + /** Used for pagination: the number of results to return. */ + count?: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; +} + +export type EnterpriseAdminListProvisionedIdentitiesEnterpriseData = + ScimUserListEnterprise; + +export interface EnterpriseAdminListProvisionedIdentitiesEnterpriseParams { + /** Used for pagination: the number of results to return. */ + count?: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; +} + +export type EnterpriseAdminListRunnerApplicationsForEnterpriseData = + RunnerApplication[]; + +export interface EnterpriseAdminListRunnerApplicationsForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; +} + +export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData { + organizations: OrganizationSimple[]; + total_count: number; +} + +export interface EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * Number uniquely identifying the issue within its repository - * @example 42 + * Page number of the results to fetch. + * @default 1 */ - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { - /** @format uri */ - diff_url: string | null; - /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; - /** @format uri */ - patch_url: string | null; - /** @format uri */ - url: string | null; - }; - reactions?: ReactionRollup; - /** A git repository */ - repository?: Repository; - /** @format uri */ - repository_url: string; + page?: number; /** - * State of the issue; either 'open' or 'closed' - * @example "open" + * Results per page (max 100) + * @default 30 */ - state: string; - /** @format uri */ - timeline_url?: string; + per_page?: number; +} + +export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData { + runner_groups: RunnerGroupsEnterprise[]; + total_count: number; +} + +export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * Title of the issue - * @example "Widget creation fails in Safari on OS X 10.8" + * Page number of the results to fetch. + * @default 1 */ - title: string; - /** @format date-time */ - updated_at: string; + page?: number; /** - * URL for the issue - * @format uri - * @example "https://api.github.com/repositories/42/issues/1" + * Results per page (max 100) + * @default 30 */ - url: string; - user: SimpleUser | null; + per_page?: number; } -/** - * Issue Comment - * Comments provide a way for people to collaborate on an issue. - */ -export interface IssueComment { - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** - * Contents of the issue comment - * @example "What version of Safari were you using when you observed this bug?" - */ - body?: string; - body_html?: string; - body_text?: string; +export interface EnterpriseAdminListSelfHostedRunnersForEnterpriseData { + runners?: Runner[]; + total_count?: number; +} + +export interface EnterpriseAdminListSelfHostedRunnersForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * Page number of the results to fetch. + * @default 1 */ - created_at: string; - /** @format uri */ - html_url: string; + page?: number; /** - * Unique identifier of the issue comment - * @example 42 + * Results per page (max 100) + * @default 30 */ - id: number; - /** @format uri */ - issue_url: string; - node_id: string; - performed_via_github_app?: Integration | null; - reactions?: ReactionRollup; + per_page?: number; +} + +export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData { + runners: Runner[]; + total_count: number; +} + +export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * Page number of the results to fetch. + * @default 1 */ - updated_at: string; + page?: number; /** - * URL for the issue comment - * @format uri - * @example "https://api.github.com/repositories/42/issues/comments/1" + * Results per page (max 100) + * @default 30 */ - url: string; - user: SimpleUser | null; + per_page?: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * Issue Event - * Issue Event - */ -export interface IssueEvent { - actor: SimpleUser | null; - assignee?: SimpleUser | null; - assigner?: SimpleUser | null; - /** How the author is associated with the repository. */ - author_association?: AuthorAssociation; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_id: string | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_url: string | null; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - created_at: string; - dismissed_review?: IssueEventDismissedReview; - /** @example "closed" */ - event: string; - /** @example 1 */ - id: number; - /** Issue Simple */ - issue?: IssueSimple; - /** Issue Event Label */ - label?: IssueEventLabel; - lock_reason?: string | null; - /** Issue Event Milestone */ - milestone?: IssueEventMilestone; - /** @example "MDEwOklzc3VlRXZlbnQx" */ - node_id: string; - /** Issue Event Project Card */ - project_card?: IssueEventProjectCard; - /** Issue Event Rename */ - rename?: IssueEventRename; - requested_reviewer?: SimpleUser | null; - /** Groups of organization members that gives permissions on specified repositories. */ - requested_team?: Team; - review_requester?: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/events/1" - */ - url: string; -} +export type EnterpriseAdminProvisionAndInviteEnterpriseGroupData = + ScimEnterpriseGroup; -/** Issue Event Dismissed Review */ -export interface IssueEventDismissedReview { - dismissal_commit_id?: string | null; - dismissal_message: string | null; - review_id: number; - state: string; +export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * Issue Event for Issue - * Issue Event for Issue - */ -export interface IssueEventForIssue { - /** Simple User */ - actor?: SimpleUser; - /** How the author is associated with the repository. */ - author_association?: AuthorAssociation; - /** @example "":+1:"" */ - body?: string; - /** @example ""

Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam.

"" */ - body_html?: string; - /** @example ""Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam."" */ - body_text?: string; - commit_id?: string | null; - commit_url?: string | null; - created_at?: string; - event?: string; - /** @example ""https://github.com/owner-3906e11a33a3d55ba449d63f/BBB_Private_Repo/commit/480d4f47447129f015cb327536c522ca683939a1"" */ - html_url?: string; - id?: number; - /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/issues/1"" */ - issue_url?: string; - /** @example ""off-topic"" */ - lock_reason?: string; - /** @example ""add a bunch of files"" */ - message?: string; - node_id?: string; - /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/pulls/2"" */ - pull_request_url?: string; - /** @example ""480d4f47447129f015cb327536c522ca683939a1"" */ - sha?: string; - /** @example ""commented"" */ - state?: string; - /** @example ""2020-07-09T00:17:51Z"" */ - submitted_at?: string; - /** @example ""2020-07-09T00:17:36Z"" */ - updated_at?: string; - url?: string; +export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload { + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + /** The SCIM schema URIs. */ + schemas: string[]; } -/** - * Issue Event Label - * Issue Event Label - */ -export interface IssueEventLabel { - color: string | null; - name: string | null; -} +export type EnterpriseAdminProvisionAndInviteEnterpriseUserData = + ScimEnterpriseUser; -/** - * Issue Event Milestone - * Issue Event Milestone - */ -export interface IssueEventMilestone { - title: string; +export interface EnterpriseAdminProvisionAndInviteEnterpriseUserParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -/** - * Issue Event Project Card - * Issue Event Project Card - */ -export interface IssueEventProjectCard { - column_name: string; - id: number; - previous_column_name?: string; - project_id: number; - /** @format uri */ - project_url: string; - /** @format uri */ - url: string; +export interface EnterpriseAdminProvisionAndInviteEnterpriseUserPayload { + /** List of user emails. */ + emails: { + /** Whether this email address is the primary address. */ + primary: boolean; + /** The type of email address. */ + type: string; + /** The email address. */ + value: string; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + name: { + /** The last name of the user. */ + familyName: string; + /** The first name of the user. */ + givenName: string; + }; + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; } -/** - * Issue Event Rename - * Issue Event Rename - */ -export interface IssueEventRename { - from: string; - to: string; +export type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; + +export interface EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -/** - * Issue Search Result Item - * Issue Search Result Item - */ -export interface IssueSearchResultItem { - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - comments: number; - /** @format uri */ - comments_url: string; - /** @format date-time */ - created_at: string; - draft?: boolean; - /** @format uri */ - events_url: string; - /** @format uri */ - html_url: string; - id: number; - labels: { - color?: string; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; - labels_url: string; - locked: boolean; - milestone: Milestone | null; - node_id: string; - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { - /** @format uri */ - diff_url: string | null; - /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; - /** @format uri */ - patch_url: string | null; - /** @format uri */ - url: string | null; - }; - /** A git repository */ - repository?: Repository; - /** @format uri */ - repository_url: string; - score: number; - state: string; - text_matches?: SearchResultTextMatches; - /** @format uri */ - timeline_url?: string; - title: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user: SimpleUser | null; +export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData = + any; + +export interface EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; } -/** - * Issue Simple - * Issue Simple - */ -export interface IssueSimple { - /** @example "too heated" */ - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** @example "I'm having a problem with this." */ - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - /** @example 0 */ - comments: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" - */ - comments_url: string; - /** - * @format date-time - * @example "2011-04-22T13:33:48Z" - */ - created_at: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/events" - */ - events_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/issues/1347" - */ - html_url: string; - /** @example 1 */ - id: number; - labels: Label[]; - /** @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}" */ - labels_url: string; - /** @example true */ - locked: boolean; - milestone: Milestone | null; - /** @example "MDU6SXNzdWUx" */ - node_id: string; - /** @example 1347 */ - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { - /** @format uri */ - diff_url: string | null; - /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; - /** @format uri */ - patch_url: string | null; - /** @format uri */ - url: string | null; - }; - /** A git repository */ - repository?: Repository; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - repository_url: string; - /** @example "open" */ - state: string; - /** @format uri */ - timeline_url?: string; - /** @example "Found a bug" */ - title: string; - /** - * @format date-time - * @example "2011-04-22T13:33:48Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" - */ - url: string; - user: SimpleUser | null; +export type EnterpriseAdminSetAllowedActionsEnterpriseData = any; + +export interface EnterpriseAdminSetAllowedActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export type IssuesAddAssigneesData = IssueSimple; +export type EnterpriseAdminSetGithubActionsPermissionsEnterpriseData = any; -export interface IssuesAddAssigneesParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface EnterpriseAdminSetGithubActionsPermissionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export interface IssuesAddAssigneesPayload { - /** Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ - assignees?: string[]; +export interface EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_organizations: EnabledOrganizations; } -export type IssuesAddLabelsData = Label[]; +export type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData = + ScimEnterpriseGroup; -export interface IssuesAddLabelsParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; } -export interface IssuesAddLabelsPayload { - /** The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ - labels: string[]; +export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload { + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + /** The SCIM schema URIs. */ + schemas: string[]; } -export type IssuesCheckUserCanBeAssignedData = any; +export type EnterpriseAdminSetInformationForProvisionedEnterpriseUserData = + ScimEnterpriseUser; -export type IssuesCheckUserCanBeAssignedError = BasicError; +export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; +} -export interface IssuesCheckUserCanBeAssignedParams { - assignee: string; - owner: string; - repo: string; +export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload { + /** List of user emails. */ + emails: { + /** Whether this email address is the primary address. */ + primary: boolean; + /** The type of email address. */ + type: string; + /** The email address. */ + value: string; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + name: { + /** The last name of the user. */ + familyName: string; + /** The first name of the user. */ + givenName: string; + }; + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; } -export type IssuesCreateCommentData = IssueComment; +export type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData = + any; -export interface IssuesCreateCommentParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export interface IssuesCreateCommentPayload { - /** The contents of the comment. */ - body: string; +export interface EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload { + /** List of organization IDs that can access the runner group. */ + selected_organization_ids: number[]; } -export type IssuesCreateData = Issue; - -export type IssuesCreateLabelData = Label; +export type EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData = + any; -export interface IssuesCreateLabelParams { - owner: string; - repo: string; +export interface EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; } -export interface IssuesCreateLabelPayload { - /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ - color?: string; - /** A short description of the label. */ - description?: string; - /** The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ - name: string; +export interface EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload { + /** List of organization IDs to enable for GitHub Actions. */ + selected_organization_ids: number[]; } -export type IssuesCreateMilestoneData = Milestone; +export type EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData = any; -export interface IssuesCreateMilestoneParams { - owner: string; - repo: string; +export interface EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export interface IssuesCreateMilestonePayload { - /** A description of the milestone. */ - description?: string; - /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - due_on?: string; - /** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" - */ - state?: IssuesCreateMilestoneStateEnum; - /** The title of the milestone. */ - title: string; +export interface EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload { + /** List of runner IDs to add to the runner group. */ + runners: number[]; } -/** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" - */ -export enum IssuesCreateMilestoneStateEnum { - Open = "open", - Closed = "closed", +export type EnterpriseAdminUpdateAttributeForEnterpriseGroupData = + ScimEnterpriseGroup; + +export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; } -export interface IssuesCreateParams { - owner: string; - repo: string; +export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload { + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: object[]; + /** The SCIM schema URIs. */ + schemas: string[]; } -export interface IssuesCreatePayload { - /** Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ - assignee?: string | null; - /** Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ - assignees?: string[]; - /** The contents of the issue. */ - body?: string; - /** Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ - labels?: ( - | string - | { - color?: string | null; - description?: string | null; - id?: number; - name?: string; - } - )[]; - /** The \`number\` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ */ - milestone?: string | number | null; - /** The title of the issue. */ - title: string | number; -} - -export type IssuesDeleteCommentData = any; - -export interface IssuesDeleteCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; -} - -export type IssuesDeleteLabelData = any; - -export interface IssuesDeleteLabelParams { - name: string; - owner: string; - repo: string; -} - -export type IssuesDeleteMilestoneData = any; - -export interface IssuesDeleteMilestoneParams { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; -} - -export type IssuesGetCommentData = IssueComment; - -export interface IssuesGetCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; -} - -export type IssuesGetData = Issue; - -export type IssuesGetEventData = IssueEvent; - -export interface IssuesGetEventParams { - eventId: number; - owner: string; - repo: string; -} - -export type IssuesGetLabelData = Label; - -export interface IssuesGetLabelParams { - name: string; - owner: string; - repo: string; -} - -export type IssuesGetMilestoneData = Milestone; +export type EnterpriseAdminUpdateAttributeForEnterpriseUserData = + ScimEnterpriseUser; -export interface IssuesGetMilestoneParams { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; +export interface EnterpriseAdminUpdateAttributeForEnterpriseUserParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; } -export interface IssuesGetParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface EnterpriseAdminUpdateAttributeForEnterpriseUserPayload { + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: object[]; + /** The SCIM schema URIs. */ + schemas: string[]; } -export type IssuesListAssigneesData = SimpleUser[]; +export type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData = + RunnerGroupsEnterprise; -export interface IssuesListAssigneesParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseParams { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; } -export type IssuesListCommentsData = IssueComment[]; - -export type IssuesListCommentsForRepoData = IssueComment[]; - -export interface IssuesListCommentsForRepoParams { - /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: DirectionEnum8; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; +export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload { + /** Name of the runner group. */ + name?: string; /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` + * @default "all" */ - sort?: SortEnum7; -} - -/** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ -export enum IssuesListCommentsForRepoParams1DirectionEnum { - Asc = "asc", - Desc = "desc", + visibility?: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVisibilityEnum; } /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` + * @default "all" */ -export enum IssuesListCommentsForRepoParams1SortEnum { - Created = "created", - Updated = "updated", -} - -export interface IssuesListCommentsParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; -} - -export type IssuesListData = Issue[]; - -export type IssuesListEventsData = IssueEventForIssue[]; - -export type IssuesListEventsForRepoData = IssueEvent[]; - -export interface IssuesListEventsForRepoParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type IssuesListEventsForTimelineData = IssueEventForIssue[]; - -export interface IssuesListEventsForTimelineParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +export enum EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseVisibilityEnum { + Selected = "selected", + All = "all", } -export interface IssuesListEventsParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +/** + * Event + * Event + */ +export interface Event { + /** Actor */ + actor: Actor; + /** @format date-time */ + created_at: string | null; + id: string; + /** Actor */ + org?: Actor; + payload: { + action: string; + /** Comments provide a way for people to collaborate on an issue. */ + comment?: IssueComment; + /** Issue Simple */ + issue?: IssueSimple; + pages?: { + action?: string; + html_url?: string; + page_name?: string; + sha?: string; + summary?: string | null; + title?: string; + }[]; + }; + public: boolean; + repo: { + id: number; + name: string; + /** @format uri */ + url: string; + }; + type: string | null; } -export type IssuesListForAuthenticatedUserData = Issue[]; - -export interface IssuesListForAuthenticatedUserParams { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum15; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: FilterEnum7; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: SortEnum18; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: StateEnum8; +/** + * Feed + * Feed + */ +export interface Feed { + _links: { + /** Hypermedia Link with Type */ + current_user?: LinkWithType; + /** Hypermedia Link with Type */ + current_user_actor?: LinkWithType; + /** Hypermedia Link with Type */ + current_user_organization?: LinkWithType; + current_user_organizations?: LinkWithType[]; + /** Hypermedia Link with Type */ + current_user_public?: LinkWithType; + /** Hypermedia Link with Type */ + security_advisories?: LinkWithType; + /** Hypermedia Link with Type */ + timeline: LinkWithType; + /** Hypermedia Link with Type */ + user: LinkWithType; + }; + /** @example "https://github.com/octocat.private.actor?token=abc123" */ + current_user_actor_url?: string; + /** @example "https://github.com/octocat-org" */ + current_user_organization_url?: string; + /** @example ["https://github.com/organizations/github/octocat.private.atom?token=abc123"] */ + current_user_organization_urls?: string[]; + /** @example "https://github.com/octocat" */ + current_user_public_url?: string; + /** @example "https://github.com/octocat.private?token=abc123" */ + current_user_url?: string; + /** @example "https://github.com/security-advisories" */ + security_advisories_url?: string; + /** @example "https://github.com/timeline" */ + timeline_url: string; + /** @example "https://github.com/{user}" */ + user_url: string; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * File Commit + * File Commit */ -export enum IssuesListForAuthenticatedUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +export interface FileCommit { + commit: { + author?: { + date?: string; + email?: string; + name?: string; + }; + committer?: { + date?: string; + email?: string; + name?: string; + }; + html_url?: string; + message?: string; + node_id?: string; + parents?: { + html_url?: string; + sha?: string; + url?: string; + }[]; + sha?: string; + tree?: { + sha?: string; + url?: string; + }; + url?: string; + verification?: { + payload?: string | null; + reason?: string; + signature?: string | null; + verified?: boolean; + }; + }; + content: { + _links?: { + git?: string; + html?: string; + self?: string; + }; + download_url?: string; + git_url?: string; + html_url?: string; + name?: string; + path?: string; + sha?: string; + size?: number; + type?: string; + url?: string; + } | null; } /** @@ -20560,7 +19878,7 @@ export enum IssuesListForAuthenticatedUserParams1DirectionEnum { * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation * @default "assigned" */ -export enum IssuesListForAuthenticatedUserParams1FilterEnum { +export enum FilterEnum { Assigned = "assigned", Created = "created", Mentioned = "mentioned", @@ -20568,80 +19886,6 @@ export enum IssuesListForAuthenticatedUserParams1FilterEnum { All = "all", } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum IssuesListForAuthenticatedUserParams1SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", -} - -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum IssuesListForAuthenticatedUserParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} - -export type IssuesListForOrgData = Issue[]; - -export interface IssuesListForOrgParams { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum3; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: FilterEnum1; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: SortEnum3; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: StateEnum1; -} - -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum IssuesListForOrgParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - /** * Indicates which sorts of issues to return. Can be one of: * \\* \`assigned\`: Issues assigned to you @@ -20651,7 +19895,7 @@ export enum IssuesListForOrgParams1DirectionEnum { * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation * @default "assigned" */ -export enum IssuesListForOrgParams1FilterEnum { +export enum FilterEnum1 { Assigned = "assigned", Created = "created", Mentioned = "mentioned", @@ -20660,1150 +19904,1015 @@ export enum IssuesListForOrgParams1FilterEnum { } /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * Filter members returned in the list. Can be one of: + * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \\* \`all\` - All members the authenticated user can see. + * @default "all" */ -export enum IssuesListForOrgParams1SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", +export enum FilterEnum2 { + Value2FaDisabled = "2fa_disabled", + All = "all", } /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * Filter the list of outside collaborators. Can be one of: + * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \\* \`all\`: All outside collaborators. + * @default "all" */ -export enum IssuesListForOrgParams1StateEnum { - Open = "open", - Closed = "closed", +export enum FilterEnum3 { + Value2FaDisabled = "2fa_disabled", All = "all", } -export type IssuesListForRepoData = IssueSimple[]; - -export interface IssuesListForRepoParams { - /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ - assignee?: string; - /** The user that created the issue. */ - creator?: string; - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum7; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** A user that's mentioned in the issue. */ - mentioned?: string; - /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ - milestone?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: SortEnum6; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: StateEnum3; +/** + * Filters jobs by their \`completed_at\` timestamp. Can be one of: + * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. + * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. + * @default "latest" + */ +export enum FilterEnum4 { + Latest = "latest", + All = "all", } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" */ -export enum IssuesListForRepoParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +export enum FilterEnum5 { + Latest = "latest", + All = "all", } /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" */ -export enum IssuesListForRepoParams1SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", +export enum FilterEnum6 { + Latest = "latest", + All = "all", } /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" */ -export enum IssuesListForRepoParams1StateEnum { - Open = "open", - Closed = "closed", +export enum FilterEnum7 { + Assigned = "assigned", + Created = "created", + Mentioned = "mentioned", + Subscribed = "subscribed", All = "all", } -export type IssuesListLabelsForMilestoneData = Label[]; +/** Forbidden */ +export type Forbidden = BasicError; -export interface IssuesListLabelsForMilestoneParams { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; +/** Forbidden Gist */ +export interface ForbiddenGist { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; +} + +/** Found */ +export type Found = any; + +/** + * Full Repository + * Full Repository + */ +export interface FullRepository { + /** @example true */ + allow_merge_commit?: boolean; + /** @example true */ + allow_rebase_merge?: boolean; + /** @example true */ + allow_squash_merge?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether anonymous git access is allowed. + * @default true */ - page?: number; + anonymous_access_enabled?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - per_page?: number; - repo: string; -} - -export type IssuesListLabelsForRepoData = Label[]; - -export interface IssuesListLabelsForRepoParams { - owner: string; + contributors_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - page?: number; + created_at: string; + /** @example "master" */ + default_branch: string; + /** @example false */ + delete_branch_on_merge?: boolean; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - per_page?: number; - repo: string; -} - -export type IssuesListLabelsOnIssueData = Label[]; - -export interface IssuesListLabelsOnIssueParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - page?: number; + downloads_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - per_page?: number; - repo: string; -} - -export type IssuesListMilestonesData = Milestone[]; - -export interface IssuesListMilestonesParams { + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - direction?: DirectionEnum9; - owner: string; + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; + /** @example true */ + has_downloads: boolean; + /** @example true */ + has_issues: boolean; + has_pages: boolean; + /** @example true */ + has_projects: boolean; + /** @example true */ + has_wiki: boolean; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://github.com" */ - page?: number; + homepage: string | null; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - per_page?: number; - repo: string; + hooks_url: string; /** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" + * @format uri + * @example "https://github.com/octocat/Hello-World" */ - sort?: SortEnum8; + html_url: string; + /** @example 1296269 */ + id: number; + /** @example true */ + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; /** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - state?: StateEnum4; -} - -/** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" - */ -export enum IssuesListMilestonesParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -/** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" - */ -export enum IssuesListMilestonesParams1SortEnum { - DueOn = "due_on", - Completeness = "completeness", -} - -/** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum IssuesListMilestonesParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} - -export interface IssuesListParams { - collab?: boolean; + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - direction?: DirectionEnum; + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" + * @format uri + * @example "git:git.example.com/octocat/Hello-World" */ - filter?: FilterEnum; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - orgs?: boolean; - owned?: boolean; + mirror_url: string | null; + /** @example "Hello-World" */ + name: string; + /** @example 0 */ + network_count: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + organization?: SimpleUser | null; + owner: SimpleUser | null; + /** A git repository */ + parent?: Repository; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - page?: number; + pushed_at: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** A git repository */ + source?: Repository; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - per_page?: number; - pulls?: boolean; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + /** @example 42 */ + subscribers_count: number; /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - sort?: SortEnum; + subscribers_url: string; /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - state?: StateEnum; + subscription_url: string; + /** + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" + */ + svn_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" + */ + tags_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" + */ + teams_url: string; + temp_clone_token?: string | null; + template_repository?: Repository | null; + /** @example ["octocat","atom","electron","API"] */ + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; + /** + * @format date-time + * @example "2011-01-26T19:14:43Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" + */ + url: string; + /** + * The repository visibility: public, private, or internal. + * @example "public" + */ + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Gist Comment + * A comment made to a gist. */ -export enum IssuesListParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +export interface GistComment { + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" + */ + body: string; + /** + * @format date-time + * @example "2011-04-18T23:23:56Z" + */ + created_at: string; + /** @example 1 */ + id: number; + /** @example "MDExOkdpc3RDb21tZW50MQ==" */ + node_id: string; + /** + * @format date-time + * @example "2011-04-18T23:23:56Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1" + */ + url: string; + user: SimpleUser | null; } /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" + * Gist Commit + * Gist Commit */ -export enum IssuesListParams1FilterEnum { - Assigned = "assigned", - Created = "created", - Mentioned = "mentioned", - Subscribed = "subscribed", - All = "all", +export interface GistCommit { + change_status: { + additions?: number; + deletions?: number; + total?: number; + }; + /** + * @format date-time + * @example "2010-04-14T02:15:15Z" + */ + committed_at: string; + /** + * @format uri + * @example "https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f" + */ + url: string; + user: SimpleUser | null; + /** @example "57a7f021a713b1c5a6a199b54cc514735d2d462f" */ + version: string; } /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * Gist Simple + * Gist Simple */ -export enum IssuesListParams1SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", +export interface GistSimple { + comments?: number; + comments_url?: string; + commits_url?: string; + created_at?: string; + description?: string | null; + files?: Record< + string, + { + content?: string; + filename?: string; + language?: string; + raw_url?: string; + size?: number; + truncated?: boolean; + type?: string; + } | null + >; + forks_url?: string; + git_pull_url?: string; + git_push_url?: string; + html_url?: string; + id?: string; + node_id?: string; + /** Simple User */ + owner?: SimpleUser; + public?: boolean; + truncated?: boolean; + updated_at?: string; + url?: string; + user?: string | null; } -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum IssuesListParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} +export type GistsCheckIsStarredData = any; -export type IssuesLockData = any; +export type GistsCheckIsStarredError = object; -/** - * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - * \\* \`off-topic\` - * \\* \`too heated\` - * \\* \`resolved\` - * \\* \`spam\` - */ -export enum IssuesLockLockReasonEnum { - OffTopic = "off-topic", - TooHeated = "too heated", - Resolved = "resolved", - Spam = "spam", +export interface GistsCheckIsStarredParams { + /** gist_id parameter */ + gistId: string; } -export interface IssuesLockParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export type GistsCreateCommentData = GistComment; + +export interface GistsCreateCommentParams { + /** gist_id parameter */ + gistId: string; } -export type IssuesLockPayload = { +export interface GistsCreateCommentPayload { /** - * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - * \\* \`off-topic\` - * \\* \`too heated\` - * \\* \`resolved\` - * \\* \`spam\` + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" */ - lock_reason?: IssuesLockLockReasonEnum; -} | null; - -export type IssuesRemoveAllLabelsData = any; - -export interface IssuesRemoveAllLabelsParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + body: string; } -export type IssuesRemoveAssigneesData = IssueSimple; +export type GistsCreateData = GistSimple; -export interface IssuesRemoveAssigneesParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface GistsCreatePayload { + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names and content for the files that make up the gist + * @example {"hello.rb":{"content":"puts \\"Hello, World!\\""}} + */ + files: Record< + string, + { + /** Content of the file */ + content: string; + } + >; + /** Flag indicating whether the gist is public */ + public?: boolean | GistsCreatePublicEnum; } -export interface IssuesRemoveAssigneesPayload { - /** Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ - assignees?: string[]; +/** + * @default "false" + * @example "true" + */ +export enum GistsCreatePublicEnum { + True = "true", + False = "false", } -export type IssuesRemoveLabelData = Label[]; +export type GistsDeleteCommentData = any; -export interface IssuesRemoveLabelParams { - /** issue_number parameter */ - issueNumber: number; - name: string; - owner: string; - repo: string; +export interface GistsDeleteCommentParams { + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; } -export type IssuesSetLabelsData = Label[]; - -export interface IssuesSetLabelsParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; -} +export type GistsDeleteData = any; -export interface IssuesSetLabelsPayload { - /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ - labels?: string[]; +export interface GistsDeleteParams { + /** gist_id parameter */ + gistId: string; } -export type IssuesUnlockData = any; +export type GistsForkData = BaseGist; -export interface IssuesUnlockParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface GistsForkParams { + /** gist_id parameter */ + gistId: string; } -export type IssuesUpdateCommentData = IssueComment; +export type GistsGetCommentData = GistComment; -export interface IssuesUpdateCommentParams { +export interface GistsGetCommentParams { /** comment_id parameter */ commentId: number; - owner: string; - repo: string; -} - -export interface IssuesUpdateCommentPayload { - /** The contents of the comment. */ - body: string; + /** gist_id parameter */ + gistId: string; } -export type IssuesUpdateData = Issue; - -export type IssuesUpdateLabelData = Label; +export type GistsGetData = GistSimple; -export interface IssuesUpdateLabelParams { - name: string; - owner: string; - repo: string; +export interface GistsGetParams { + /** gist_id parameter */ + gistId: string; } -export interface IssuesUpdateLabelPayload { - /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ - color?: string; - /** A short description of the label. */ - description?: string; - /** The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ - new_name?: string; +export type GistsGetRevisionData = GistSimple; + +export interface GistsGetRevisionParams { + /** gist_id parameter */ + gistId: string; + sha: string; } -export type IssuesUpdateMilestoneData = Milestone; +export type GistsListCommentsData = GistComment[]; -export interface IssuesUpdateMilestoneParams { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; +export interface GistsListCommentsParams { + /** gist_id parameter */ + gistId: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export interface IssuesUpdateMilestonePayload { - /** A description of the milestone. */ - description?: string; - /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - due_on?: string; +export type GistsListCommitsData = GistCommit[]; + +export interface GistsListCommitsParams { + /** gist_id parameter */ + gistId: string; /** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" + * Page number of the results to fetch. + * @default 1 */ - state?: IssuesUpdateMilestoneStateEnum; - /** The title of the milestone. */ - title?: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" - */ -export enum IssuesUpdateMilestoneStateEnum { - Open = "open", - Closed = "closed", -} +export type GistsListData = BaseGist[]; -export interface IssuesUpdateParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; -} +export type GistsListForUserData = BaseGist[]; -export interface IssuesUpdatePayload { - /** Login for the user that this issue should be assigned to. **This field is deprecated.** */ - assignee?: string | null; - /** Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (\`[]\`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ - assignees?: string[]; - /** The contents of the issue. */ - body?: string; - /** Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (\`[]\`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ - labels?: ( - | string - | { - color?: string | null; - description?: string | null; - id?: number; - name?: string; - } - )[]; - /** The \`number\` of the milestone to associate this issue with or \`null\` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._ */ - milestone?: string | number | null; - /** State of the issue. Either \`open\` or \`closed\`. */ - state?: IssuesUpdateStateEnum; - /** The title of the issue. */ - title?: string | number; +export interface GistsListForUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + username: string; } -/** State of the issue. Either \`open\` or \`closed\`. */ -export enum IssuesUpdateStateEnum { - Open = "open", - Closed = "closed", +export type GistsListForksData = GistSimple[]; + +export interface GistsListForksParams { + /** gist_id parameter */ + gistId: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** - * Job - * Information of a job execution in a workflow run - */ -export interface Job { - /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ - check_run_url: string; +export interface GistsListParams { /** - * The time that the job finished, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" + * Page number of the results to fetch. + * @default 1 */ - completed_at: string | null; + page?: number; /** - * The outcome of the job. - * @example "success" + * Results per page (max 100) + * @default 30 */ - conclusion: string | null; + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; +} + +export type GistsListPublicData = BaseGist[]; + +export interface GistsListPublicParams { /** - * The SHA of the commit that is being run. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * Page number of the results to fetch. + * @default 1 */ - head_sha: string; - /** @example "https://github.com/github/hello-world/runs/4" */ - html_url: string | null; + page?: number; /** - * The id of the job. - * @example 21 + * Results per page (max 100) + * @default 30 */ - id: number; + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; +} + +export type GistsListStarredData = BaseGist[]; + +export interface GistsListStarredParams { /** - * The name of the job. - * @example "test-coverage" + * Page number of the results to fetch. + * @default 1 */ - name: string; - /** @example "MDg6Q2hlY2tSdW40" */ - node_id: string; + page?: number; /** - * The id of the associated workflow run. - * @example 5 + * Results per page (max 100) + * @default 30 */ - run_id: number; - /** @example "https://api.github.com/repos/github/hello-world/actions/runs/5" */ - run_url: string; + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; +} + +export type GistsStarData = any; + +export interface GistsStarParams { + /** gist_id parameter */ + gistId: string; +} + +export type GistsUnstarData = any; + +export interface GistsUnstarParams { + /** gist_id parameter */ + gistId: string; +} + +export type GistsUpdateCommentData = GistComment; + +export interface GistsUpdateCommentParams { + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; +} + +export interface GistsUpdateCommentPayload { /** - * The time that the job started, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" */ - started_at: string; + body: string; +} + +export type GistsUpdateData = GistSimple; + +export interface GistsUpdateParams { + /** gist_id parameter */ + gistId: string; +} + +export type GistsUpdatePayload = null & { /** - * The phase of the lifecycle that the job is currently in. - * @example "queued" + * Description of the gist + * @example "Example Ruby script" */ - status: JobStatusEnum; - /** Steps in this job. */ - steps?: { + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; +}; + +/** + * Git Commit + * Low-level Git commit operations within a repository + */ +export interface GitCommit { + /** Identifying information for the git-user */ + author: { /** - * The time that the job finished, in ISO 8601 format. + * Timestamp of the commit * @format date-time - * @example "2019-08-08T08:00:00-07:00" + * @example "2014-08-09T08:02:04+12:00" */ - completed_at?: string | null; + date: string; /** - * The outcome of the job. - * @example "success" + * Git email address of the user + * @example "monalisa.octocat@example.com" */ - conclusion: string | null; + email: string; /** - * The name of the job. - * @example "test-coverage" + * Name of the git user + * @example "Monalisa Octocat" */ name: string; - /** @example 1 */ - number: number; + }; + /** Identifying information for the git-user */ + committer: { /** - * The time that the step started, in ISO 8601 format. + * Timestamp of the commit * @format date-time - * @example "2019-08-08T08:00:00-07:00" + * @example "2014-08-09T08:02:04+12:00" */ - started_at?: string | null; + date: string; /** - * The phase of the lifecycle that the job is currently in. - * @example "queued" + * Git email address of the user + * @example "monalisa.octocat@example.com" */ - status: JobStatusEnum1; - }[]; - /** @example "https://api.github.com/repos/github/hello-world/actions/jobs/21" */ - url: string; -} - -/** - * The phase of the lifecycle that the job is currently in. - * @example "queued" - */ -export enum JobStatusEnum { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", -} - -/** - * The phase of the lifecycle that the job is currently in. - * @example "queued" - */ -export enum JobStatusEnum1 { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", -} - -/** - * Key - * Key - */ -export interface Key { - /** @format date-time */ - created_at: string; - id: number; - key: string; - key_id: string; - read_only: boolean; - title: string; - url: string; - verified: boolean; -} - -/** - * Key Simple - * Key Simple - */ -export interface KeySimple { - id: number; - key: string; -} - -/** - * Label - * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). - */ -export interface Label { - /** - * 6-character hex code, without the leading #, identifying the color - * @example "FFFFFF" - */ - color: string; - /** @example true */ - default: boolean; - /** @example "Something isn't working" */ - description: string | null; - /** @example 208045946 */ - id: number; + email: string; + /** + * Name of the git user + * @example "Monalisa Octocat" + */ + name: string; + }; + /** @format uri */ + html_url: string; /** - * The name of the label. - * @example "bug" + * Message describing the purpose of the commit + * @example "Fix #42" */ - name: string; - /** @example "MDU6TGFiZWwyMDgwNDU5NDY=" */ + message: string; node_id: string; + parents: { + /** @format uri */ + html_url: string; + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + /** @format uri */ + url: string; + }[]; /** - * URL for the label - * @format uri - * @example "https://api.github.com/repositories/42/labels/bug" + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ - url: string; -} - -/** - * Label Search Result Item - * Label Search Result Item - */ -export interface LabelSearchResultItem { - color: string; - default: boolean; - description: string | null; - id: number; - name: string; - node_id: string; - score: number; - text_matches?: SearchResultTextMatches; + sha: string; + tree: { + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + /** @format uri */ + url: string; + }; /** @format uri */ url: string; + verification: { + payload: string | null; + reason: string; + signature: string | null; + verified: boolean; + }; } -/** - * Language - * Language - */ -export type Language = Record; +export type GitCreateBlobData = ShortBlob; -/** - * License - * License - */ -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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * 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; - /** @example ["include-copyright"] */ - conditions: string[]; - /** @example "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty." */ - description: string; - /** @example true */ - featured: boolean; - /** - * @format uri - * @example "http://choosealicense.com/licenses/mit/" - */ - html_url: string; - /** @example "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders." */ - implementation: string; - /** @example "mit" */ - key: string; - /** @example ["no-liability"] */ - limitations: string[]; - /** @example "MIT License" */ - name: string; - /** @example "MDc6TGljZW5zZW1pdA==" */ - node_id: string; - /** @example ["commercial-use","modifications","distribution","sublicense","private-use"] */ - permissions: string[]; - /** @example "MIT" */ - spdx_id: string | null; - /** - * @format uri - * @example "https://api.github.com/licenses/mit" - */ - url: string | null; +export interface GitCreateBlobParams { + owner: string; + repo: string; } -/** - * License Content - * License Content - */ -export interface LicenseContent { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; +export interface GitCreateBlobPayload { + /** The new blob's content. */ content: string; - /** @format uri */ - download_url: string | null; - encoding: string; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - license: LicenseSimple | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; -} - -/** - * License Simple - * License Simple - */ -export interface LicenseSimple { - /** @format uri */ - html_url?: string; - /** @example "mit" */ - key: string; - /** @example "MIT License" */ - name: string; - /** @example "MDc6TGljZW5zZW1pdA==" */ - node_id: string; - /** @example "MIT" */ - spdx_id: string | null; /** - * @format uri - * @example "https://api.github.com/licenses/mit" + * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. + * @default "utf-8" */ - url: string | null; + encoding?: string; } -export type LicensesGetAllCommonlyUsedData = LicenseSimple[]; +export type GitCreateCommitData = GitCommit; -export interface LicensesGetAllCommonlyUsedParams { - featured?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; +export interface GitCreateCommitParams { + owner: string; + repo: string; } -export type LicensesGetData = License; +export interface GitCreateCommitPayload { + /** Information about the author of the commit. By default, the \`author\` will be the authenticated user and the current date. See the \`author\` and \`committer\` object below for details. */ + author?: { + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** Information about the person who is making the commit. By default, \`committer\` will use the information set in \`author\`. See the \`author\` and \`committer\` object below for details. */ + committer?: { + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The commit message */ + message: string; + /** The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ + parents?: string[]; + /** The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the \`gpgsig\` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a \`signature\` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ + signature?: string; + /** The SHA of the tree object this commit points to */ + tree: string; +} -export type LicensesGetForRepoData = LicenseContent; +export type GitCreateRefData = GitRef; -export interface LicensesGetForRepoParams { +export interface GitCreateRefParams { owner: string; repo: string; } -export interface LicensesGetParams { - license: string; +export interface GitCreateRefPayload { + /** @example ""refs/heads/newbranch"" */ + key?: string; + /** The name of the fully qualified reference (ie: \`refs/heads/master\`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ + ref: string; + /** The SHA1 value for this reference. */ + sha: string; } -/** - * Link - * Hypermedia Link - */ -export interface Link { - href: string; +export type GitCreateTagData = GitTag; + +export interface GitCreateTagParams { + owner: string; + repo: string; } -/** - * Link With Type - * Hypermedia Link with Type - */ -export interface LinkWithType { - href: string; - type: string; +export interface GitCreateTagPayload { + /** The tag message. */ + message: string; + /** 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; + /** An object with information about the individual creating the tag. */ + tagger?: { + /** When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author of the tag */ + email?: string; + /** The name of the author of the tag */ + name?: string; + }; + /** The type of the object we're tagging. Normally this is a \`commit\` but it can also be a \`tree\` or a \`blob\`. */ + type: GitCreateTagTypeEnum; } -export type MarkdownRenderData = string; +/** The type of the object we're tagging. Normally this is a \`commit\` but it can also be a \`tree\` or a \`blob\`. */ +export enum GitCreateTagTypeEnum { + Commit = "commit", + Tree = "tree", + Blob = "blob", +} -/** - * The rendering mode. - * @default "markdown" - * @example "markdown" - */ -export enum MarkdownRenderModeEnum { - Markdown = "markdown", - Gfm = "gfm", +export type GitCreateTreeData = GitTree; + +/** The file mode; 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. */ +export enum GitCreateTreeModeEnum { + Value100644 = "100644", + Value100755 = "100755", + Value040000 = "040000", + Value160000 = "160000", + Value120000 = "120000", } -export interface MarkdownRenderPayload { - /** The repository context to use when creating references in \`gfm\` mode. */ - context?: string; +export interface GitCreateTreeParams { + owner: string; + repo: string; +} + +export interface GitCreateTreePayload { /** - * The rendering mode. - * @default "markdown" - * @example "markdown" + * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by \`base_tree\` and entries defined in the \`tree\` parameter. Entries defined in the \`tree\` parameter will overwrite items from \`base_tree\` with the same \`path\`. If you're creating new changes on a branch, then normally you'd set \`base_tree\` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. + * If not provided, GitHub will create a new Git tree object from only the entries defined in the \`tree\` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the \`tree\` parameter will be listed as deleted by the new commit. */ - mode?: MarkdownRenderModeEnum; - /** The Markdown text to render in HTML. */ - text: string; + base_tree?: string; + /** Objects (of \`path\`, \`mode\`, \`type\`, and \`sha\`) specifying a tree structure. */ + tree: { + /** + * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or \`tree.sha\`. + * + * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. + */ + content?: string; + /** The file mode; 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. */ + mode?: GitCreateTreeModeEnum; + /** The file referenced in the tree. */ + path?: string; + /** + * The SHA1 checksum ID of the object in the tree. Also called \`tree.sha\`. If the value is \`null\` then the file will be deleted. + * + * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. + */ + sha?: string | null; + /** Either \`blob\`, \`tree\`, or \`commit\`. */ + type?: GitCreateTreeTypeEnum; + }[]; } -export type MarkdownRenderRawData = string; +/** Either \`blob\`, \`tree\`, or \`commit\`. */ +export enum GitCreateTreeTypeEnum { + Blob = "blob", + Tree = "tree", + Commit = "commit", +} -export type MarkdownRenderRawPayload = string; +export type GitDeleteRefData = any; -/** Marketplace Account */ -export interface MarketplaceAccount { - /** @format email */ - email?: string | null; - id: number; - login: string; - node_id?: string; - /** @format email */ - organization_billing_email?: string | null; - type: string; - /** @format uri */ - url: string; +export interface GitDeleteRefParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; } -/** - * Marketplace Listing Plan - * Marketplace Listing Plan - */ -export interface MarketplaceListingPlan { - /** - * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313/accounts" - */ - accounts_url: string; - /** @example ["Up to 25 private repositories","11 concurrent builds"] */ - bullets: string[]; - /** @example "A professional-grade CI solution" */ - description: string; - /** @example true */ - has_free_trial: boolean; - /** @example 1313 */ - id: number; - /** @example 1099 */ - monthly_price_in_cents: number; - /** @example "Pro" */ - name: string; - /** @example 3 */ - number: number; - /** @example "flat-rate" */ - price_model: string; - /** @example "published" */ - state: string; - unit_name: string | null; - /** - * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313" - */ - url: string; - /** @example 11870 */ - yearly_price_in_cents: number; +export type GitGetBlobData = Blob; + +export interface GitGetBlobParams { + fileSha: string; + owner: string; + repo: string; } -/** - * Marketplace Purchase - * Marketplace Purchase - */ -export interface MarketplacePurchase { - id: number; - login: string; - marketplace_pending_change?: { - effective_date?: string; - id?: number; - is_installed?: boolean; - /** Marketplace Listing Plan */ - plan?: MarketplaceListingPlan; - unit_count?: number | null; - } | null; - marketplace_purchase: { - billing_cycle?: string; - free_trial_ends_on?: string | null; - is_installed?: boolean; - next_billing_date?: string | null; - on_free_trial?: boolean; - /** Marketplace Listing Plan */ - plan?: MarketplaceListingPlan; - unit_count?: number | null; - updated_at?: string; - }; - organization_billing_email?: string; - type: string; - url: string; +export type GitGetCommitData = GitCommit; + +export interface GitGetCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; } -export type MetaGetData = ApiOverview; +export type GitGetRefData = GitRef; -export type MetaGetOctocatData = string; +export interface GitGetRefParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; +} -export interface MetaGetOctocatParams { - /** The words to show in Octocat's speech bubble */ - s?: string; +export type GitGetTagData = GitTag; + +export interface GitGetTagParams { + owner: string; + repo: string; + tagSha: string; } -export type MetaGetZenData = string; +export type GitGetTreeData = GitTree; -export interface MetaRootData { - /** @format uri */ - authorizations_url: string; - /** @format uri */ - code_search_url: string; - /** @format uri */ - commit_search_url: string; - /** @format uri */ - current_user_authorizations_html_url: string; - /** @format uri */ - current_user_repositories_url: string; - /** @format uri */ - current_user_url: string; - /** @format uri */ - emails_url: string; - /** @format uri */ - emojis_url: string; - /** @format uri */ - events_url: string; - /** @format uri */ - feeds_url: string; - /** @format uri */ - followers_url: string; - /** @format uri */ - following_url: string; - /** @format uri */ - gists_url: string; - /** @format uri */ - hub_url: string; - /** @format uri */ - issue_search_url: string; - /** @format uri */ - issues_url: string; - /** @format uri */ - keys_url: string; - /** @format uri */ - label_search_url: string; - /** @format uri */ - notifications_url: string; - /** @format uri */ - organization_repositories_url: string; - /** @format uri */ - organization_teams_url: string; - /** @format uri */ - organization_url: string; - /** @format uri */ - public_gists_url: string; - /** @format uri */ - rate_limit_url: string; - /** @format uri */ - repository_search_url: string; - /** @format uri */ - repository_url: string; - /** @format uri */ - starred_gists_url: string; - /** @format uri */ - starred_url: string; - /** @format uri */ - topic_search_url?: string; - /** @format uri */ - user_organizations_url: string; - /** @format uri */ - user_repositories_url: string; - /** @format uri */ - user_search_url: string; - /** @format uri */ - user_url: string; -} - -/** - * Migration - * A migration. - */ -export interface Migration { - /** @format uri */ - archive_url?: string; - /** - * @format date-time - * @example "2015-07-06T15:33:38-07:00" - */ - created_at: string; - exclude?: any[]; - exclude_attachments: boolean; - /** @example "0b989ba4-242f-11e5-81e1-c7b6966d2516" */ - guid: string; - /** @example 79 */ - id: number; - /** @example true */ - lock_repositories: boolean; - node_id: string; - owner: SimpleUser | null; - repositories: Repository[]; - /** @example "pending" */ - state: string; - /** - * @format date-time - * @example "2015-07-06T15:33:38-07:00" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/orgs/octo-org/migrations/79" - */ - url: string; -} - -export type MigrationsCancelImportData = any; - -export interface MigrationsCancelImportParams { - owner: string; - repo: string; -} - -export type MigrationsDeleteArchiveForAuthenticatedUserData = any; - -export interface MigrationsDeleteArchiveForAuthenticatedUserParams { - /** migration_id parameter */ - migrationId: number; -} - -export type MigrationsDeleteArchiveForOrgData = any; - -export interface MigrationsDeleteArchiveForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; -} - -export interface MigrationsDownloadArchiveForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; -} - -export interface MigrationsGetArchiveForAuthenticatedUserParams { - /** migration_id parameter */ - migrationId: number; -} - -export type MigrationsGetCommitAuthorsData = PorterAuthor[]; - -export interface MigrationsGetCommitAuthorsParams { - owner: string; - repo: string; - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; -} - -export type MigrationsGetImportStatusData = Import; - -export interface MigrationsGetImportStatusParams { +export interface GitGetTreeParams { owner: string; + /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ + recursive?: string; repo: string; + treeSha: string; } -export type MigrationsGetLargeFilesData = PorterLargeFile[]; +export type GitListMatchingRefsData = GitRef[]; -export interface MigrationsGetLargeFilesParams { +export interface GitListMatchingRefsParams { owner: string; - repo: string; -} - -export type MigrationsGetStatusForAuthenticatedUserData = Migration; - -export interface MigrationsGetStatusForAuthenticatedUserParams { - exclude?: string[]; - /** migration_id parameter */ - migrationId: number; -} - -export type MigrationsGetStatusForOrgData = Migration; - -export interface MigrationsGetStatusForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; -} - -export type MigrationsListForAuthenticatedUserData = Migration[]; - -export interface MigrationsListForAuthenticatedUserParams { /** * Page number of the results to fetch. * @default 1 @@ -21814,1263 +20923,1381 @@ export interface MigrationsListForAuthenticatedUserParams { * @default 30 */ per_page?: number; + /** ref+ parameter */ + ref: string; + repo: string; } -export type MigrationsListForOrgData = Migration[]; +/** + * Git Reference + * Git references within a repository + */ +export interface GitRef { + node_id: string; + object: { + /** + * SHA for the reference + * @minLength 40 + * @maxLength 40 + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + type: string; + /** @format uri */ + url: string; + }; + ref: string; + /** @format uri */ + url: string; +} -export interface MigrationsListForOrgParams { - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +/** + * Git Tag + * Metadata for a Git tag + */ +export interface GitTag { /** - * Results per page (max 100) - * @default 30 + * Message describing the purpose of the tag + * @example "Initial public release" */ - per_page?: number; -} - -export type MigrationsListReposForOrgData = MinimalRepository[]; - -export interface MigrationsListReposForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; + message: string; + /** @example "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==" */ + node_id: string; + object: { + sha: string; + type: string; + /** @format uri */ + url: string; + }; + /** @example "940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ + sha: string; /** - * Page number of the results to fetch. - * @default 1 + * Name of the tag + * @example "v0.0.1" */ - page?: number; + tag: string; + tagger: { + date: string; + email: string; + name: string; + }; /** - * Results per page (max 100) - * @default 30 + * URL for the tag + * @format uri + * @example "https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ - per_page?: number; + url: string; + verification?: Verification; } -export type MigrationsListReposForUserData = MinimalRepository[]; - -export interface MigrationsListReposForUserParams { - /** migration_id parameter */ - migrationId: number; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +/** + * Git Tree + * The hierarchy between files in a Git repository. + */ +export interface GitTree { + sha: string; /** - * Results per page (max 100) - * @default 30 + * Objects specifying a tree structure + * @example [{"path":"file.rb","mode":"100644","type":"blob","size":30,"sha":"44b4fc6d56897b048c772eb4087f854f46256132","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132","properties":{"path":{"type":"string"},"mode":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"sha":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"]}] */ - per_page?: number; + tree: { + /** @example "040000" */ + mode?: string; + /** @example "test/file.rb" */ + path?: string; + /** @example "23f6827669e43831def8a7ad935069c8bd418261" */ + sha?: string; + /** @example 12 */ + size?: number; + /** @example "tree" */ + type?: string; + /** @example "https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261" */ + url?: string; + }[]; + truncated: boolean; + /** @format uri */ + url: string; } -export type MigrationsMapCommitAuthorData = PorterAuthor; +export type GitUpdateRefData = GitRef; -export interface MigrationsMapCommitAuthorParams { - authorId: number; +export interface GitUpdateRefParams { owner: string; + /** ref+ parameter */ + ref: string; repo: string; } -export interface MigrationsMapCommitAuthorPayload { - /** The new Git author email. */ +export interface GitUpdateRefPayload { + /** + * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to \`false\` will make sure you're not overwriting work. + * @default false + */ + force?: boolean; + /** The SHA1 value to set this reference to */ + sha: string; +} + +/** + * Git User + * Metaproperties for Git author/committer information. + */ +export interface GitUser { + /** @example ""2007-10-29T02:42:39.000-07:00"" */ + date?: string; + /** @example ""chris@ozmm.org"" */ email?: string; - /** The new Git author name. */ + /** @example ""Chris Wanstrath"" */ name?: string; - /** @example ""can't touch this"" */ - remote_id?: string; } -export type MigrationsSetLfsPreferenceData = Import; +export type GitignoreGetAllTemplatesData = string[]; -export interface MigrationsSetLfsPreferenceParams { - owner: string; - repo: string; -} +export type GitignoreGetTemplateData = GitignoreTemplate; -export interface MigrationsSetLfsPreferencePayload { - /** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ - use_lfs: MigrationsSetLfsPreferenceUseLfsEnum; +export interface GitignoreGetTemplateParams { + name: string; } -/** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ -export enum MigrationsSetLfsPreferenceUseLfsEnum { - OptIn = "opt_in", - OptOut = "opt_out", +/** + * Gitignore Template + * Gitignore Template + */ +export interface GitignoreTemplate { + /** @example "C" */ + name: string; + /** + * @example "# Object files + * *.o + * + * # Libraries + * *.lib + * *.a + * + * # Shared objects (inc. Windows DLLs) + * *.dll + * *.so + * *.so.* + * *.dylib + * + * # Executables + * *.exe + * *.out + * *.app + * " + */ + source: string; } -export type MigrationsStartForAuthenticatedUserData = Migration; +/** Gone */ +export type Gone = BasicError; /** - * Allowed values that can be passed to the exclude param. - * @example "repositories" + * GPG Key + * A unique encryption key */ -export enum MigrationsStartForAuthenticatedUserExcludeEnum { - Repositories = "repositories", +export interface GpgKey { + /** @example true */ + can_certify: boolean; + can_encrypt_comms: boolean; + can_encrypt_storage: boolean; + /** @example true */ + can_sign: boolean; + /** + * @format date-time + * @example "2016-03-24T11:31:04-06:00" + */ + created_at: string; + /** @example [{"email":"mastahyeti@users.noreply.github.com","verified":true}] */ + emails: { + email?: string; + verified?: boolean; + }[]; + /** @format date-time */ + expires_at: string | null; + /** @example 3 */ + id: number; + /** @example "3262EFF25BA0D270" */ + key_id: string; + primary_key_id: number | null; + /** @example "xsBNBFayYZ..." */ + public_key: string; + raw_key: string | null; + /** @example [{"id":4,"primary_key_id":3,"key_id":"4A595D4C72EE49C7","public_key":"zsBNBFayYZ...","emails":[],"subkeys":[],"can_sign":false,"can_encrypt_comms":true,"can_encrypt_storage":true,"can_certify":false,"created_at":"2016-03-24T11:31:04-06:00","expires_at":null}] */ + subkeys: { + can_certify?: boolean; + can_encrypt_comms?: boolean; + can_encrypt_storage?: boolean; + can_sign?: boolean; + created_at?: string; + emails?: any[]; + expires_at?: string | null; + id?: number; + key_id?: string; + primary_key_id?: number; + public_key?: string; + raw_key?: string | null; + subkeys?: any[]; + }[]; } -export interface MigrationsStartForAuthenticatedUserPayload { +/** + * GroupMapping + * External Groups to be mapped to a team for membership + */ +export interface GroupMapping { /** - * Exclude attributes from the API response to improve performance - * @example ["repositories"] + * a description of the group + * @example "A group of Developers working on AzureAD SAML SSO" */ - exclude?: MigrationsStartForAuthenticatedUserExcludeEnum[]; + group_description?: string; /** - * Do not include attachments in the migration - * @example true + * The ID of the group + * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" */ - exclude_attachments?: boolean; + group_id?: string; /** - * Lock the repositories being migrated at the start of the migration - * @example true + * The name of the group + * @example "saml-azuread-test" */ - lock_repositories?: boolean; - repositories: string[]; -} - -export type MigrationsStartForOrgData = Migration; - -export interface MigrationsStartForOrgParams { - org: string; -} - -export interface MigrationsStartForOrgPayload { - exclude?: string[]; + group_name?: string; /** - * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). - * @default false + * Array of groups to be mapped to this team + * @example [{"group_id":"111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa","group_name":"saml-azuread-test","group_description":"A group of Developers working on AzureAD SAML SSO"},{"group_id":"2bb2bb2b-bb22-22bb-2bb2-bb2bbb2bb2b2","group_name":"saml-azuread-test2","group_description":"Another group of Developers working on AzureAD SAML SSO"}] */ - exclude_attachments?: boolean; + groups?: { + /** + * a description of the group + * @example "A group of Developers working on AzureAD SAML SSO" + */ + group_description: string; + /** + * The ID of the group + * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" + */ + group_id: string; + /** + * The name of the group + * @example "saml-azuread-test" + */ + group_name: string; + }[]; /** - * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. - * @default false + * synchronization status for this group mapping + * @example "unsynced" */ - lock_repositories?: boolean; - /** A list of arrays indicating which repositories should be migrated. */ - repositories: string[]; -} - -export type MigrationsStartImportData = Import; - -export interface MigrationsStartImportParams { - owner: string; - repo: string; -} - -export interface MigrationsStartImportPayload { - /** For a tfvc import, the name of the project that is being imported. */ - tfvc_project?: string; - /** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ - vcs?: MigrationsStartImportVcsEnum; - /** If authentication is required, the password to provide to \`vcs_url\`. */ - vcs_password?: string; - /** The URL of the originating repository. */ - vcs_url: string; - /** If authentication is required, the username to provide to \`vcs_url\`. */ - vcs_username?: string; -} - -/** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ -export enum MigrationsStartImportVcsEnum { - Subversion = "subversion", - Git = "git", - Mercurial = "mercurial", - Tfvc = "tfvc", -} - -export type MigrationsUnlockRepoForAuthenticatedUserData = any; - -export interface MigrationsUnlockRepoForAuthenticatedUserParams { - /** migration_id parameter */ - migrationId: number; - /** repo_name parameter */ - repoName: string; -} - -export type MigrationsUnlockRepoForOrgData = any; - -export interface MigrationsUnlockRepoForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; - /** repo_name parameter */ - repoName: string; -} - -export type MigrationsUpdateImportData = Import; - -export interface MigrationsUpdateImportParams { - owner: string; - repo: string; -} - -export interface MigrationsUpdateImportPayload { - /** @example ""project1"" */ - tfvc_project?: string; - /** @example ""git"" */ - vcs?: string; - /** The password to provide to the originating repository. */ - vcs_password?: string; - /** The username to provide to the originating repository. */ - vcs_username?: string; + status?: string; + /** + * the time of the last sync for this group-mapping + * @example "2019-06-03 22:27:15:000 -700" + */ + synced_at?: string; } /** - * Milestone - * A collection of related issues and pull requests. + * Webhook + * Webhooks for repositories. */ -export interface Milestone { +export interface Hook { /** - * @format date-time - * @example "2013-02-12T13:22:01Z" + * Determines whether the hook is actually triggered on pushes. + * @example true */ - closed_at: string | null; - /** @example 8 */ - closed_issues: number; + active: boolean; + config: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** @example ""sha256"" */ + digest?: string; + /** @example ""foo@bar.com"" */ + email?: string; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""foo"" */ + password?: string; + /** @example ""roomer"" */ + room?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** @example ""foo"" */ + subdomain?: string; + /** @example ""abc"" */ + token?: string; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; + }; /** * @format date-time - * @example "2011-04-10T20:09:31Z" + * @example "2011-09-06T17:26:27Z" */ created_at: string; - creator: SimpleUser | null; - /** @example "Tracking milestone for version 1.0" */ - description: string | null; /** - * @format date-time - * @example "2012-10-09T23:39:01Z" + * Determines what events the hook is triggered for. Default: ['push']. + * @example ["push","pull_request"] */ - due_on: string | null; + events: string[]; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/milestones/v1.0" + * Unique identifier of the webhook. + * @example 42 */ - html_url: string; - /** @example 1002604 */ id: number; + last_response: HookResponse; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" - */ - labels_url: string; - /** @example "MDk6TWlsZXN0b25lMTAwMjYwNA==" */ - node_id: string; - /** - * The number of the milestone. - * @example 42 + * The name of a valid service, use 'web' for a webhook. + * @example "web" */ - number: number; - /** @example 4 */ - open_issues: number; + name: string; /** - * The state of the milestone. - * @default "open" - * @example "open" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings" */ - state: MilestoneStateEnum; + ping_url: string; /** - * The title of the milestone. - * @example "v1.0" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/test" */ - title: string; + test_url: string; + type: string; /** * @format date-time - * @example "2014-03-03T18:58:10Z" + * @example "2011-09-06T20:39:23Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1" + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1" */ url: string; } +/** Hook Response */ +export interface HookResponse { + code: number | null; + message: string | null; + status: string | null; +} + /** - * The state of the milestone. - * @default "open" - * @example "open" + * Hovercard + * Hovercard */ -export enum MilestoneStateEnum { - Open = "open", - Closed = "closed", +export interface Hovercard { + contexts: { + message: string; + octicon: string; + }[]; } /** - * Minimal Repository - * Minimal Repository + * Import + * A repository import from an external source. */ -export interface MinimalRepository { - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - archived?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - clone_url?: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; +export interface Import { + authors_count?: number | null; + /** @format uri */ + authors_url: string; + commit_count?: number | null; + error_message?: string | null; + failed_step?: string | null; + has_large_files?: boolean; + /** @format uri */ + html_url: string; + import_percent?: number | null; + large_files_count?: number; + large_files_size?: number; + message?: string; + project_choices?: { + human_name?: string; + tfvc_project?: string; + vcs?: string; + }[]; + push_percent?: number | null; + /** @format uri */ + repository_url: string; + status: ImportStatusEnum; + status_text?: string | null; + svc_root?: string; + svn_root?: string; + tfvc_project?: string; + /** @format uri */ + url: string; + use_lfs?: string; + vcs: string | null; + /** The URL of the originating repository. */ + vcs_url: string; +} + +export enum ImportStatusEnum { + Auth = "auth", + Error = "error", + None = "none", + Detecting = "detecting", + Choose = "choose", + AuthFailed = "auth_failed", + Importing = "importing", + Mapping = "mapping", + WaitingToPush = "waiting_to_push", + Pushing = "pushing", + Complete = "complete", + Setup = "setup", + Unknown = "unknown", + DetectionFoundMultiple = "detection_found_multiple", + DetectionFoundNothing = "detection_found_nothing", + DetectionNeedsAuth = "detection_needs_auth", +} + +/** + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. + */ +export enum IncludeEnum { + Web = "web", + Git = "git", + All = "all", +} + +/** + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. + */ +export enum IncludeEnum1 { + Web = "web", + Git = "git", + All = "all", +} + +/** + * Installation + * Installation + */ +export interface Installation { /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" + * @example "https://api.github.com/installations/1/access_tokens" */ - contributors_url: string; + access_tokens_url: string; + account: SimpleUser | Enterprise | null; + /** @example 1 */ + app_id: number; + /** @example "github-actions" */ + app_slug: string; + /** @example ""test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"" */ + contact_email?: string | null; + /** @format date-time */ + created_at: string; + events: string[]; + /** @example true */ + has_multiple_single_files?: boolean; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * @format uri + * @example "https://github.com/organizations/github/settings/installations/1" */ - created_at?: string | null; - default_branch?: string; - delete_branch_on_merge?: boolean; + html_url: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" + * The ID of the installation. + * @example 1 */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - disabled?: boolean; + id: number; + /** @example {"issues":"read","deployments":"write"} */ + permissions: { + checks?: string; + contents?: string; + deployments?: string; + /** @example ""read"" */ + issues?: string; + metadata?: string; + /** @example ""read"" */ + organization_administration?: string; + pull_requests?: string; + statuses?: string; + }; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" + * @example "https://api.github.com/installation/repositories" */ - downloads_url: string; + repositories_url: string; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: InstallationRepositorySelectionEnum; + /** @example "config.yaml" */ + single_file_name: string | null; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; + /** @format date-time */ + suspended_at?: string | null; + suspended_by?: SimpleUser | null; + /** The ID of the user or organization this token is being scoped to. */ + target_id: number; + /** @example "Organization" */ + target_type: string; + /** @format date-time */ + updated_at: string; +} + +/** Describe whether all repositories have been selected or there's a selection involved */ +export enum InstallationRepositorySelectionEnum { + All = "all", + Selected = "selected", +} + +/** + * Installation Token + * Authentication token for a GitHub App installed on a user or org. + */ +export interface InstallationToken { + expires_at: string; + /** @example true */ + has_multiple_single_files?: boolean; + permissions?: { + contents?: string; + issues?: string; + /** @example "read" */ + metadata?: string; + /** @example "read" */ + single_file?: string; + }; + repositories?: Repository[]; + repository_selection?: InstallationTokenRepositorySelectionEnum; + /** @example "README.md" */ + single_file?: string; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; + token: string; +} + +export enum InstallationTokenRepositorySelectionEnum { + All = "all", + Selected = "selected", +} + +/** + * GitHub app + * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + */ +export interface Integration { + /** @example ""Iv1.25b5d1e65ffc4022"" */ + client_id?: string; + /** @example ""1d4b2097ac622ba702d19de498f005747a8b21d3"" */ + client_secret?: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" + * @format date-time + * @example "2017-07-08T16:18:44-04:00" */ - events_url: string; - fork: boolean; - /** @example 0 */ - forks?: number; - forks_count?: number; + created_at: string; + /** @example "The description of the app." */ + description: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" + * The list of events for the GitHub app + * @example ["label","deployment"] */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - git_url?: string; - has_downloads?: boolean; - has_issues?: boolean; - has_pages?: boolean; - has_projects?: boolean; - has_wiki?: boolean; - homepage?: string | null; + events: string[]; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @example "https://example.com" */ - hooks_url: string; + external_url: string; /** * @format uri - * @example "https://github.com/octocat/Hello-World" + * @example "https://github.com/apps/super-ci" */ html_url: string; - /** @example 1296269 */ + /** + * Unique identifier of the GitHub app + * @example 37 + */ id: number; - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language?: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" + * The number of installations associated with the GitHub app + * @example 5 */ - languages_url: string; - license?: { - key?: string; - name?: string; - node_id?: string; - spdx_id?: string; - url?: string; - } | null; + installations_count?: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" + * The name of the GitHub app + * @example "Probot Owners" */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; - mirror_url?: string | null; - /** @example "Hello-World" */ name: string; - network_count?: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + /** @example "MDExOkludGVncmF0aW9uMQ==" */ node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - /** @example 0 */ - open_issues?: number; - open_issues_count?: number; owner: SimpleUser | null; - permissions?: { - admin?: boolean; - pull?: boolean; - push?: boolean; - }; - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; + /** @example ""-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\n-----END RSA PRIVATE KEY-----\\n"" */ + pem?: string; /** - * @format date-time - * @example "2011-01-26T19:06:43Z" + * The set of permissions for the GitHub app + * @example {"issues":"read","deployments":"write"} */ - pushed_at?: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - size?: number; - ssh_url?: string; - stargazers_count?: number; + permissions: { + checks?: string; + contents?: string; + deployments?: string; + issues?: string; + metadata?: string; + [key: string]: any; + }; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + * The slug name of the GitHub app + * @example "probot-owners" */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; + slug?: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + * @format date-time + * @example "2017-07-08T16:18:44-04:00" */ - subscribers_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" - */ - subscription_url: string; - svn_url?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: Repository | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at?: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - url: string; - visibility?: string; - /** @example 0 */ - watchers?: number; - watchers_count?: number; + updated_at: string; + /** @example ""6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b"" */ + webhook_secret?: string; + [key: string]: any; } -/** Moved Permanently */ -export type MovedPermanently = any; - -/** Resource Not Found */ -export type NotFound = BasicError; +/** + * The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. + * @example "one_month" + */ +export enum InteractionExpiry { + OneDay = "one_day", + ThreeDays = "three_days", + OneWeek = "one_week", + OneMonth = "one_month", + SixMonths = "six_months", +} -/** Not Modified */ -export type NotModified = any; +/** + * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. + * @example "collaborators_only" + */ +export enum InteractionGroup { + ExistingUsers = "existing_users", + ContributorsOnly = "contributors_only", + CollaboratorsOnly = "collaborators_only", +} -export type OauthAuthorizationsCreateAuthorizationData = Authorization; +/** + * Interaction Restrictions + * Limit interactions to a specific type of user for a specified duration + */ +export interface InteractionLimit { + /** The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. */ + expiry?: InteractionExpiry; + /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ + limit: InteractionGroup; +} -export interface OauthAuthorizationsCreateAuthorizationPayload { - /** - * The OAuth app client key for which to create the token. - * @maxLength 20 - */ - client_id?: string; - /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 - */ - client_secret?: string; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; - /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" - */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; +/** + * Interaction Limits + * Interaction limit settings. + */ +export interface InteractionLimitResponse { /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] + * @format date-time + * @example "2018-08-17T04:18:39Z" */ - scopes?: string[] | null; + expires_at: string; + /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ + limit: InteractionGroup; + /** @example "repository" */ + origin: string; } -export type OauthAuthorizationsDeleteAuthorizationData = any; +export type InteractionsGetRestrictionsForAuthenticatedUserData = + InteractionLimitResponse; -export interface OauthAuthorizationsDeleteAuthorizationParams { - /** authorization_id parameter */ - authorizationId: number; +export type InteractionsGetRestrictionsForOrgData = InteractionLimitResponse; + +export interface InteractionsGetRestrictionsForOrgParams { + org: string; } -export type OauthAuthorizationsDeleteGrantData = any; +export type InteractionsGetRestrictionsForRepoData = InteractionLimitResponse; -export interface OauthAuthorizationsDeleteGrantParams { - /** grant_id parameter */ - grantId: number; +export interface InteractionsGetRestrictionsForRepoParams { + owner: string; + repo: string; } -export type OauthAuthorizationsGetAuthorizationData = Authorization; +export type InteractionsRemoveRestrictionsForAuthenticatedUserData = any; -export interface OauthAuthorizationsGetAuthorizationParams { - /** authorization_id parameter */ - authorizationId: number; +export type InteractionsRemoveRestrictionsForOrgData = any; + +export interface InteractionsRemoveRestrictionsForOrgParams { + org: string; } -export type OauthAuthorizationsGetGrantData = ApplicationGrant; +export type InteractionsRemoveRestrictionsForRepoData = any; -export interface OauthAuthorizationsGetGrantParams { - /** grant_id parameter */ - grantId: number; +export interface InteractionsRemoveRestrictionsForRepoParams { + owner: string; + repo: string; } -export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData = - Authorization; +export type InteractionsSetRestrictionsForAuthenticatedUserData = + InteractionLimitResponse; -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintParams { - /** The client ID of your GitHub app. */ - clientId: string; - fingerprint: string; +export type InteractionsSetRestrictionsForOrgData = InteractionLimitResponse; + +export interface InteractionsSetRestrictionsForOrgParams { + org: string; } -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload { +export type InteractionsSetRestrictionsForRepoData = InteractionLimitResponse; + +export interface InteractionsSetRestrictionsForRepoParams { + owner: string; + repo: string; +} + +/** Internal Error */ +export type InternalError = BasicError; + +/** + * Issue + * Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + */ +export interface Issue { + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 + * Contents of the issue + * @example "It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?" */ - client_secret: string; + body?: string; + body_html?: string; + body_text?: string; + /** @format date-time */ + closed_at: string | null; + closed_by?: SimpleUser | null; + comments: number; + /** @format uri */ + comments_url: string; + /** @format date-time */ + created_at: string; + /** @format uri */ + events_url: string; + /** @format uri */ + html_url: string; + id: number; /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" + * Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + * @example ["bug","registration"] */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; + labels: ( + | string + | { + color?: string | null; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + /** @format uri */ + url?: string; + } + )[]; + labels_url: string; + locked: boolean; + milestone: Milestone | null; + node_id: string; /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] + * Number uniquely identifying the issue within its repository + * @example 42 */ - scopes?: string[] | null; -} - -export type OauthAuthorizationsGetOrCreateAuthorizationForAppData = - Authorization; - -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppParams { - /** The client ID of your GitHub app. */ - clientId: string; -} - -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppPayload { + number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; + }; + reactions?: ReactionRollup; + /** A git repository */ + repository?: Repository; + /** @format uri */ + repository_url: string; /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 + * State of the issue; either 'open' or 'closed' + * @example "open" */ - client_secret: string; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; + state: string; + /** @format uri */ + timeline_url?: string; /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" + * Title of the issue + * @example "Widget creation fails in Safari on OS X 10.8" */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; + title: string; + /** @format date-time */ + updated_at: string; /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] + * URL for the issue + * @format uri + * @example "https://api.github.com/repositories/42/issues/1" */ - scopes?: string[] | null; + url: string; + user: SimpleUser | null; } -export type OauthAuthorizationsListAuthorizationsData = Authorization[]; - -export interface OauthAuthorizationsListAuthorizationsParams { +/** + * Issue Comment + * Comments provide a way for people to collaborate on an issue. + */ +export interface IssueComment { + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; /** - * Page number of the results to fetch. - * @default 1 + * Contents of the issue comment + * @example "What version of Safari were you using when you observed this bug?" */ - page?: number; + body?: string; + body_html?: string; + body_text?: string; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-04-14T16:00:49Z" */ - per_page?: number; -} - -export type OauthAuthorizationsListGrantsData = ApplicationGrant[]; - -export interface OauthAuthorizationsListGrantsParams { + created_at: string; + /** @format uri */ + html_url: string; /** - * Page number of the results to fetch. - * @default 1 + * Unique identifier of the issue comment + * @example 42 */ - page?: number; + id: number; + /** @format uri */ + issue_url: string; + node_id: string; + performed_via_github_app?: Integration | null; + reactions?: ReactionRollup; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-04-14T16:00:49Z" */ - per_page?: number; -} - -export type OauthAuthorizationsUpdateAuthorizationData = Authorization; - -export interface OauthAuthorizationsUpdateAuthorizationParams { - /** authorization_id parameter */ - authorizationId: number; + updated_at: string; + /** + * URL for the issue comment + * @format uri + * @example "https://api.github.com/repositories/42/issues/comments/1" + */ + url: string; + user: SimpleUser | null; } -export interface OauthAuthorizationsUpdateAuthorizationPayload { - /** A list of scopes to add to this authorization. */ - add_scopes?: string[]; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; +/** + * Issue Event + * Issue Event + */ +export interface IssueEvent { + actor: SimpleUser | null; + assignee?: SimpleUser | null; + assigner?: SimpleUser | null; + /** How the author is associated with the repository. */ + author_association?: AuthorAssociation; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_id: string | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_url: string | null; /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" + * @format date-time + * @example "2011-04-14T16:00:49Z" */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; - /** A list of scopes to remove from this authorization. */ - remove_scopes?: string[]; + created_at: string; + dismissed_review?: IssueEventDismissedReview; + /** @example "closed" */ + event: string; + /** @example 1 */ + id: number; + /** Issue Simple */ + issue?: IssueSimple; + /** Issue Event Label */ + label?: IssueEventLabel; + lock_reason?: string | null; + /** Issue Event Milestone */ + milestone?: IssueEventMilestone; + /** @example "MDEwOklzc3VlRXZlbnQx" */ + node_id: string; + /** Issue Event Project Card */ + project_card?: IssueEventProjectCard; + /** Issue Event Rename */ + rename?: IssueEventRename; + requested_reviewer?: SimpleUser | null; + /** Groups of organization members that gives permissions on specified repositories. */ + requested_team?: Team; + review_requester?: SimpleUser | null; /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/events/1" */ - scopes?: string[] | null; + url: string; } -/** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ -export enum OrderEnum { - Desc = "desc", - Asc = "asc", +/** Issue Event Dismissed Review */ +export interface IssueEventDismissedReview { + dismissal_commit_id?: string | null; + dismissal_message: string | null; + review_id: number; + state: string; } /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. + * Issue Event for Issue + * Issue Event for Issue */ -export enum OrderEnum1 { - Desc = "desc", - Asc = "asc", +export interface IssueEventForIssue { + /** Simple User */ + actor?: SimpleUser; + /** How the author is associated with the repository. */ + author_association?: AuthorAssociation; + /** @example "":+1:"" */ + body?: string; + /** @example ""

Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam.

"" */ + body_html?: string; + /** @example ""Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam."" */ + body_text?: string; + commit_id?: string | null; + commit_url?: string | null; + created_at?: string; + event?: string; + /** @example ""https://github.com/owner-3906e11a33a3d55ba449d63f/BBB_Private_Repo/commit/480d4f47447129f015cb327536c522ca683939a1"" */ + html_url?: string; + id?: number; + /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/issues/1"" */ + issue_url?: string; + /** @example ""off-topic"" */ + lock_reason?: string; + /** @example ""add a bunch of files"" */ + message?: string; + node_id?: string; + /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/pulls/2"" */ + pull_request_url?: string; + /** @example ""480d4f47447129f015cb327536c522ca683939a1"" */ + sha?: string; + /** @example ""commented"" */ + state?: string; + /** @example ""2020-07-09T00:17:51Z"" */ + submitted_at?: string; + /** @example ""2020-07-09T00:17:36Z"" */ + updated_at?: string; + url?: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Issue Event Label + * Issue Event Label */ -export enum OrderEnum2 { - Desc = "desc", - Asc = "asc", +export interface IssueEventLabel { + color: string | null; + name: string | null; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Issue Event Milestone + * Issue Event Milestone */ -export enum OrderEnum3 { - Desc = "desc", - Asc = "asc", +export interface IssueEventMilestone { + title: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Issue Event Project Card + * Issue Event Project Card */ -export enum OrderEnum4 { - Desc = "desc", - Asc = "asc", +export interface IssueEventProjectCard { + column_name: string; + id: number; + previous_column_name?: string; + project_id: number; + /** @format uri */ + project_url: string; + /** @format uri */ + url: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Issue Event Rename + * Issue Event Rename */ -export enum OrderEnum5 { - Desc = "desc", - Asc = "asc", +export interface IssueEventRename { + from: string; + to: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Issue Search Result Item + * Issue Search Result Item */ -export enum OrderEnum6 { - Desc = "desc", - Asc = "asc", -} - -/** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ -export enum OrderEnum7 { - Desc = "desc", - Asc = "asc", -} - -/** - * Org Hook - * Org Hook - */ -export interface OrgHook { - /** @example true */ - active: boolean; - config: { - /** @example ""form"" */ - content_type?: string; - /** @example ""0"" */ - insecure_ssl?: string; - /** @example ""********"" */ - secret?: string; - /** @example ""http://example.com/2"" */ - url?: string; - }; - /** - * @format date-time - * @example "2011-09-06T17:26:27Z" - */ +export interface IssueSearchResultItem { + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + body?: string; + body_html?: string; + body_text?: string; + /** @format date-time */ + closed_at: string | null; + comments: number; + /** @format uri */ + comments_url: string; + /** @format date-time */ created_at: string; - /** @example ["push","pull_request"] */ - events: string[]; - /** @example 1 */ + draft?: boolean; + /** @format uri */ + events_url: string; + /** @format uri */ + html_url: string; id: number; - /** @example "web" */ - name: string; - /** - * @format uri - * @example "https://api.github.com/orgs/octocat/hooks/1/pings" - */ - ping_url: string; - type: string; - /** - * @format date-time - * @example "2011-09-06T20:39:23Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/orgs/octocat/hooks/1" - */ - url: string; -} - -/** - * Org Membership - * Org Membership - */ -export interface OrgMembership { - /** Organization Simple */ - organization: OrganizationSimple; - /** - * @format uri - * @example "https://api.github.com/orgs/octocat" - */ - organization_url: string; - permissions?: { - can_create_repository: boolean; + labels: { + color?: string; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + url?: string; + }[]; + labels_url: string; + locked: boolean; + milestone: Milestone | null; + node_id: string; + number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; }; - /** @example "admin" */ - role: string; - /** @example "active" */ + /** A git repository */ + repository?: Repository; + /** @format uri */ + repository_url: string; + score: number; state: string; - /** - * @format uri - * @example "https://api.github.com/orgs/octocat/memberships/defunkt" - */ + text_matches?: SearchResultTextMatches; + /** @format uri */ + timeline_url?: string; + title: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ url: string; user: SimpleUser | null; } /** - * Actions Secret for an Organization - * Secrets for GitHub Actions for an organization. + * Issue Simple + * Issue Simple */ -export interface OrganizationActionsSecret { - /** @format date-time */ - created_at: string; - /** - * The name of the secret. - * @example "SECRET_TOKEN" - */ - name: string; - /** - * @format uri - * @example "https://api.github.com/organizations/org/secrets/my_secret/repositories" - */ - selected_repositories_url?: string; +export interface IssueSimple { + /** @example "too heated" */ + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** @example "I'm having a problem with this." */ + body?: string; + body_html?: string; + body_text?: string; /** @format date-time */ - updated_at: string; - /** Visibility of a secret */ - visibility: OrganizationActionsSecretVisibilityEnum; -} - -/** Visibility of a secret */ -export enum OrganizationActionsSecretVisibilityEnum { - All = "all", - Private = "private", - Selected = "selected", -} - -/** - * Organization Full - * Organization Full - */ -export interface OrganizationFull { - /** @example "https://github.com/images/error/octocat_happy.gif" */ - avatar_url: string; - /** - * @format email - * @example "org@example.com" - */ - billing_email?: string | null; + closed_at: string | null; + /** @example 0 */ + comments: number; /** * @format uri - * @example "https://github.com/blog" + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" */ - blog?: string; - /** @example 8 */ - collaborators?: number | null; - /** @example "GitHub" */ - company?: string; + comments_url: string; /** * @format date-time - * @example "2008-01-14T04:33:35Z" + * @example "2011-04-22T13:33:48Z" */ created_at: string; - default_repository_permission?: string | null; - /** @example "A great organization" */ - description: string | null; - /** @example 10000 */ - disk_usage?: number | null; - /** - * @format email - * @example "octocat@github.com" - */ - email?: string; /** * @format uri - * @example "https://api.github.com/orgs/github/events" + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/events" */ events_url: string; - /** @example 20 */ - followers: number; - /** @example 0 */ - following: number; - /** @example true */ - has_organization_projects: boolean; - /** @example true */ - has_repository_projects: boolean; - /** @example "https://api.github.com/orgs/github/hooks" */ - hooks_url: string; /** * @format uri - * @example "https://github.com/octocat" + * @example "https://github.com/octocat/Hello-World/issues/1347" */ html_url: string; /** @example 1 */ id: number; + labels: Label[]; + /** @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}" */ + labels_url: string; /** @example true */ - is_verified?: boolean; - /** @example "https://api.github.com/orgs/github/issues" */ - issues_url: string; - /** @example "San Francisco" */ - location?: string; - /** @example "github" */ - login: string; - /** @example "all" */ - members_allowed_repository_creation_type?: string; - /** @example true */ - members_can_create_internal_repositories?: boolean; - /** @example true */ - members_can_create_pages?: boolean; - /** @example true */ - members_can_create_private_repositories?: boolean; - /** @example true */ - members_can_create_public_repositories?: boolean; - /** @example true */ - members_can_create_repositories?: boolean | null; - /** @example "https://api.github.com/orgs/github/members{/member}" */ - members_url: string; - /** @example "github" */ - name?: string; - /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ + locked: boolean; + milestone: Milestone | null; + /** @example "MDU6SXNzdWUx" */ node_id: string; - /** @example 100 */ - owned_private_repos?: number; - plan?: { - filled_seats?: number; - name: string; - private_repos: number; - seats?: number; - space: number; + /** @example 1347 */ + number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; }; - /** @example 81 */ - private_gists?: number | null; - /** @example 1 */ - public_gists: number; - /** @example "https://api.github.com/orgs/github/public_members{/member}" */ - public_members_url: string; - /** @example 2 */ - public_repos: number; + /** A git repository */ + repository?: Repository; /** * @format uri - * @example "https://api.github.com/orgs/github/repos" + * @example "https://api.github.com/repos/octocat/Hello-World" + */ + repository_url: string; + /** @example "open" */ + state: string; + /** @format uri */ + timeline_url?: string; + /** @example "Found a bug" */ + title: string; + /** + * @format date-time + * @example "2011-04-22T13:33:48Z" */ - repos_url: string; - /** @example 100 */ - total_private_repos?: number; - /** @example "github" */ - twitter_username?: string | null; - /** @example true */ - two_factor_requirement_enabled?: boolean | null; - /** @example "Organization" */ - type: string; - /** @format date-time */ updated_at: string; /** * @format uri - * @example "https://api.github.com/orgs/github" + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" */ url: string; + user: SimpleUser | null; } -/** - * Organization Invitation - * Organization Invitation - */ -export interface OrganizationInvitation { - created_at: string; - email: string | null; - failed_at?: string; - failed_reason?: string; - id: number; - invitation_team_url: string; - /** @example ""https://api.github.com/organizations/16/invitations/1/teams"" */ - invitation_teams_url?: string; - /** Simple User */ - inviter: SimpleUser; - login: string | null; - /** @example ""MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x"" */ - node_id: string; - role: string; - team_count: number; +export type IssuesAddAssigneesData = IssueSimple; + +export interface IssuesAddAssigneesParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -/** - * Organization Simple - * Organization Simple - */ -export interface OrganizationSimple { - /** @example "https://github.com/images/error/octocat_happy.gif" */ - avatar_url: string; - /** @example "A great organization" */ - description: string | null; - /** - * @format uri - * @example "https://api.github.com/orgs/github/events" - */ - events_url: string; - /** @example "https://api.github.com/orgs/github/hooks" */ - hooks_url: string; - /** @example 1 */ - id: number; - /** @example "https://api.github.com/orgs/github/issues" */ - issues_url: string; - /** @example "github" */ - login: string; - /** @example "https://api.github.com/orgs/github/members{/member}" */ - members_url: string; - /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ - node_id: string; - /** @example "https://api.github.com/orgs/github/public_members{/member}" */ - public_members_url: string; - /** - * @format uri - * @example "https://api.github.com/orgs/github/repos" - */ - repos_url: string; - /** - * @format uri - * @example "https://api.github.com/orgs/github" - */ - url: string; +export interface IssuesAddAssigneesPayload { + /** Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; } -export type OrgsBlockUserData = any; +export type IssuesAddLabelsData = Label[]; -export interface OrgsBlockUserParams { - org: string; - username: string; +export interface IssuesAddLabelsParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export type OrgsCancelInvitationData = any; - -export interface OrgsCancelInvitationParams { - /** invitation_id parameter */ - invitationId: number; - org: string; +export interface IssuesAddLabelsPayload { + /** The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ + labels: string[]; } -export type OrgsCheckBlockedUserData = any; +export type IssuesCheckUserCanBeAssignedData = any; -export type OrgsCheckBlockedUserError = BasicError; +export type IssuesCheckUserCanBeAssignedError = BasicError; -export interface OrgsCheckBlockedUserParams { - org: string; - username: string; +export interface IssuesCheckUserCanBeAssignedParams { + assignee: string; + owner: string; + repo: string; } -export type OrgsCheckMembershipForUserData = any; +export type IssuesCreateCommentData = IssueComment; -export interface OrgsCheckMembershipForUserParams { - org: string; - username: string; +export interface IssuesCreateCommentParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export type OrgsCheckPublicMembershipForUserData = any; - -export interface OrgsCheckPublicMembershipForUserParams { - org: string; - username: string; +export interface IssuesCreateCommentPayload { + /** The contents of the comment. */ + body: string; } -export type OrgsConvertMemberToOutsideCollaboratorData = any; +export type IssuesCreateData = Issue; -export type OrgsConvertMemberToOutsideCollaboratorError = { - documentation_url?: string; - message?: string; -}; +export type IssuesCreateLabelData = Label; -export interface OrgsConvertMemberToOutsideCollaboratorParams { - org: string; - username: string; +export interface IssuesCreateLabelParams { + owner: string; + repo: string; } -export type OrgsCreateInvitationData = OrganizationInvitation; +export interface IssuesCreateLabelPayload { + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ + color?: string; + /** A short description of the label. */ + description?: string; + /** The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ + name: string; +} -export interface OrgsCreateInvitationParams { - org: string; +export type IssuesCreateMilestoneData = Milestone; + +export interface IssuesCreateMilestoneParams { + owner: string; + repo: string; } -export interface OrgsCreateInvitationPayload { - /** **Required unless you provide \`invitee_id\`**. Email address of the person you are inviting, which can be an existing GitHub user. */ - email?: string; - /** **Required unless you provide \`email\`**. GitHub user ID for the person you are inviting. */ - invitee_id?: number; +export interface IssuesCreateMilestonePayload { + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + due_on?: string; /** - * Specify role for new member. Can be one of: - * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. - * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. - * @default "direct_member" + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" */ - role?: OrgsCreateInvitationRoleEnum; - /** Specify IDs for the teams you want to invite new members to. */ - team_ids?: number[]; + state?: IssuesCreateMilestoneStateEnum; + /** The title of the milestone. */ + title: string; } /** - * Specify role for new member. Can be one of: - * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. - * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. - * @default "direct_member" + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" */ -export enum OrgsCreateInvitationRoleEnum { - Admin = "admin", - DirectMember = "direct_member", - BillingManager = "billing_manager", +export enum IssuesCreateMilestoneStateEnum { + Open = "open", + Closed = "closed", } -export type OrgsCreateWebhookData = OrgHook; - -export interface OrgsCreateWebhookParams { - org: string; +export interface IssuesCreateParams { + owner: string; + repo: string; } -export interface OrgsCreateWebhookPayload { - /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true - */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""password"" */ - password?: string; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - /** @example ""kdaigle"" */ - username?: string; - }; - /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] - */ - events?: string[]; - /** Must be passed as "web". */ - name: string; +export interface IssuesCreatePayload { + /** Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ + assignee?: string | null; + /** Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + /** The contents of the issue. */ + body?: string; + /** Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + color?: string | null; + description?: string | null; + id?: number; + name?: string; + } + )[]; + /** The \`number\` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ */ + milestone?: string | number | null; + /** The title of the issue. */ + title: string | number; } -export type OrgsDeleteWebhookData = any; +export type IssuesDeleteCommentData = any; -export interface OrgsDeleteWebhookParams { - hookId: number; - org: string; +export interface IssuesDeleteCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; } -export type OrgsGetAuditLogData = AuditLogEvent[]; +export type IssuesDeleteLabelData = any; -export interface OrgsGetAuditLogParams { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: IncludeEnum1; - /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ - order?: OrderEnum1; - org: string; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; +export interface IssuesDeleteLabelParams { + name: string; + owner: string; + repo: string; } -/** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ -export enum OrgsGetAuditLogParams1IncludeEnum { - Web = "web", - Git = "git", - All = "all", -} +export type IssuesDeleteMilestoneData = any; -/** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ -export enum OrgsGetAuditLogParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export interface IssuesDeleteMilestoneParams { + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; } -export type OrgsGetData = OrganizationFull; - -export type OrgsGetMembershipForAuthenticatedUserData = OrgMembership; +export type IssuesGetCommentData = IssueComment; -export interface OrgsGetMembershipForAuthenticatedUserParams { - org: string; +export interface IssuesGetCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; } -export type OrgsGetMembershipForUserData = OrgMembership; +export type IssuesGetData = Issue; -export interface OrgsGetMembershipForUserParams { - org: string; - username: string; -} +export type IssuesGetEventData = IssueEvent; -export interface OrgsGetParams { - org: string; +export interface IssuesGetEventParams { + eventId: number; + owner: string; + repo: string; } -export type OrgsGetWebhookConfigForOrgData = WebhookConfig; +export type IssuesGetLabelData = Label; -export interface OrgsGetWebhookConfigForOrgParams { - hookId: number; - org: string; +export interface IssuesGetLabelParams { + name: string; + owner: string; + repo: string; } -export type OrgsGetWebhookData = OrgHook; +export type IssuesGetMilestoneData = Milestone; -export interface OrgsGetWebhookParams { - hookId: number; - org: string; +export interface IssuesGetMilestoneParams { + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; } -export interface OrgsListAppInstallationsData { - installations: Installation[]; - total_count: number; +export interface IssuesGetParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export interface OrgsListAppInstallationsParams { - org: string; +export type IssuesListAssigneesData = SimpleUser[]; + +export interface IssuesListAssigneesParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23081,20 +22308,56 @@ export interface OrgsListAppInstallationsParams { * @default 30 */ per_page?: number; + repo: string; } -export type OrgsListBlockedUsersData = SimpleUser[]; +export type IssuesListCommentsData = IssueComment[]; -export interface OrgsListBlockedUsersParams { - org: string; +export type IssuesListCommentsForRepoData = IssueComment[]; + +export interface IssuesListCommentsForRepoParams { + /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: DirectionEnum8; + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: SortEnum7; } -export type OrgsListData = OrganizationSimple[]; +/** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ +export enum IssuesListCommentsForRepoParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} -export type OrgsListFailedInvitationsData = OrganizationInvitation[]; +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum IssuesListCommentsForRepoParams1SortEnum { + Created = "created", + Updated = "updated", +} -export interface OrgsListFailedInvitationsParams { - org: string; +export interface IssuesListCommentsParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23105,11 +22368,19 @@ export interface OrgsListFailedInvitationsParams { * @default 30 */ per_page?: number; + repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; } -export type OrgsListForAuthenticatedUserData = OrganizationSimple[]; +export type IssuesListData = Issue[]; -export interface OrgsListForAuthenticatedUserParams { +export type IssuesListEventsData = IssueEventForIssue[]; + +export type IssuesListEventsForRepoData = IssueEvent[]; + +export interface IssuesListEventsForRepoParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23120,11 +22391,15 @@ export interface OrgsListForAuthenticatedUserParams { * @default 30 */ per_page?: number; + repo: string; } -export type OrgsListForUserData = OrganizationSimple[]; +export type IssuesListEventsForTimelineData = IssueEventForIssue[]; -export interface OrgsListForUserParams { +export interface IssuesListEventsForTimelineParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23135,15 +22410,13 @@ export interface OrgsListForUserParams { * @default 30 */ per_page?: number; - username: string; + repo: string; } -export type OrgsListInvitationTeamsData = Team[]; - -export interface OrgsListInvitationTeamsParams { - /** invitation_id parameter */ - invitationId: number; - org: string; +export interface IssuesListEventsParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23154,19 +22427,29 @@ export interface OrgsListInvitationTeamsParams { * @default 30 */ per_page?: number; + repo: string; } -export type OrgsListMembersData = SimpleUser[]; +export type IssuesListForAuthenticatedUserData = Issue[]; -export interface OrgsListMembersParams { +export interface IssuesListForAuthenticatedUserParams { /** - * Filter members returned in the list. Can be one of: - * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \\* \`all\` - All members the authenticated user can see. - * @default "all" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - filter?: FilterEnum2; - org: string; + direction?: DirectionEnum15; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: FilterEnum7; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; /** * Page number of the results to fetch. * @default 1 @@ -23177,43 +22460,87 @@ export interface OrgsListMembersParams { * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; /** - * Filter members returned by their role. Can be one of: - * \\* \`all\` - All members of the organization, regardless of role. - * \\* \`admin\` - Organization owners. - * \\* \`member\` - Non-owner organization members. - * @default "all" + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" */ - role?: RoleEnum; + sort?: SortEnum18; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum8; } /** - * Filter members returned in the list. Can be one of: - * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \\* \`all\` - All members the authenticated user can see. - * @default "all" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ -export enum OrgsListMembersParams1FilterEnum { - Value2FaDisabled = "2fa_disabled", +export enum IssuesListForAuthenticatedUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} + +/** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ +export enum IssuesListForAuthenticatedUserParams1FilterEnum { + Assigned = "assigned", + Created = "created", + Mentioned = "mentioned", + Subscribed = "subscribed", All = "all", } /** - * Filter members returned by their role. Can be one of: - * \\* \`all\` - All members of the organization, regardless of role. - * \\* \`admin\` - Organization owners. - * \\* \`member\` - Non-owner organization members. - * @default "all" + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" */ -export enum OrgsListMembersParams1RoleEnum { +export enum IssuesListForAuthenticatedUserParams1SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum IssuesListForAuthenticatedUserParams1StateEnum { + Open = "open", + Closed = "closed", All = "all", - Admin = "admin", - Member = "member", } -export type OrgsListMembershipsForAuthenticatedUserData = OrgMembership[]; +export type IssuesListForOrgData = Issue[]; -export interface OrgsListMembershipsForAuthenticatedUserParams { +export interface IssuesListForOrgParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum3; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: FilterEnum1; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + org: string; /** * Page number of the results to fetch. * @default 1 @@ -23224,27 +22551,85 @@ export interface OrgsListMembershipsForAuthenticatedUserParams { * @default 30 */ per_page?: number; - /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ - state?: StateEnum9; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: SortEnum3; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum1; } -/** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ -export enum OrgsListMembershipsForAuthenticatedUserParams1StateEnum { - Active = "active", - Pending = "pending", +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum IssuesListForOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type OrgsListOutsideCollaboratorsData = SimpleUser[]; +/** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ +export enum IssuesListForOrgParams1FilterEnum { + Assigned = "assigned", + Created = "created", + Mentioned = "mentioned", + Subscribed = "subscribed", + All = "all", +} -export interface OrgsListOutsideCollaboratorsParams { +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum IssuesListForOrgParams1SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum IssuesListForOrgParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} + +export type IssuesListForRepoData = IssueSimple[]; + +export interface IssuesListForRepoParams { + /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ + assignee?: string; + /** The user that created the issue. */ + creator?: string; /** - * Filter the list of outside collaborators. Can be one of: - * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \\* \`all\`: All outside collaborators. - * @default "all" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - filter?: FilterEnum3; - org: string; + direction?: DirectionEnum7; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** A user that's mentioned in the issue. */ + mentioned?: string; + /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ + milestone?: string; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23255,33 +22640,56 @@ export interface OrgsListOutsideCollaboratorsParams { * @default 30 */ per_page?: number; + repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: SortEnum6; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum3; } /** - * Filter the list of outside collaborators. Can be one of: - * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \\* \`all\`: All outside collaborators. - * @default "all" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ -export enum OrgsListOutsideCollaboratorsParams1FilterEnum { - Value2FaDisabled = "2fa_disabled", - All = "all", +export enum IssuesListForRepoParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export interface OrgsListParams { - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** An organization ID. Only return organizations with an ID greater than this ID. */ - since?: number; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum IssuesListForRepoParams1SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", } -export type OrgsListPendingInvitationsData = OrganizationInvitation[]; +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum IssuesListForRepoParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} -export interface OrgsListPendingInvitationsParams { - org: string; +export type IssuesListLabelsForMilestoneData = Label[]; + +export interface IssuesListLabelsForMilestoneParams { + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23292,12 +22700,13 @@ export interface OrgsListPendingInvitationsParams { * @default 30 */ per_page?: number; + repo: string; } -export type OrgsListPublicMembersData = SimpleUser[]; +export type IssuesListLabelsForRepoData = Label[]; -export interface OrgsListPublicMembersParams { - org: string; +export interface IssuesListLabelsForRepoParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23308,18 +22717,37 @@ export interface OrgsListPublicMembersParams { * @default 30 */ per_page?: number; + repo: string; } -export type OrgsListSamlSsoAuthorizationsData = CredentialAuthorization[]; +export type IssuesListLabelsOnIssueData = Label[]; -export interface OrgsListSamlSsoAuthorizationsParams { - org: string; +export interface IssuesListLabelsOnIssueParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -export type OrgsListWebhooksData = OrgHook[]; +export type IssuesListMilestonesData = Milestone[]; -export interface OrgsListWebhooksParams { - org: string; +export interface IssuesListMilestonesParams { + /** + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" + */ + direction?: DirectionEnum9; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -23330,3287 +22758,3436 @@ export interface OrgsListWebhooksParams { * @default 30 */ per_page?: number; + repo: string; + /** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ + sort?: SortEnum8; + /** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum4; } -export type OrgsPingWebhookData = any; +/** + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" + */ +export enum IssuesListMilestonesParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} -export interface OrgsPingWebhookParams { - hookId: number; - org: string; +/** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ +export enum IssuesListMilestonesParams1SortEnum { + DueOn = "due_on", + Completeness = "completeness", } -export type OrgsRemoveMemberData = any; +/** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum IssuesListMilestonesParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} -export interface OrgsRemoveMemberParams { - org: string; - username: string; +export interface IssuesListParams { + collab?: boolean; + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: FilterEnum; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + orgs?: boolean; + owned?: boolean; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pulls?: boolean; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: SortEnum; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum; } -export type OrgsRemoveMembershipForUserData = any; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum IssuesListParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} -export interface OrgsRemoveMembershipForUserParams { - org: string; - username: string; +/** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ +export enum IssuesListParams1FilterEnum { + Assigned = "assigned", + Created = "created", + Mentioned = "mentioned", + Subscribed = "subscribed", + All = "all", } -export type OrgsRemoveOutsideCollaboratorData = any; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum IssuesListParams1SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", +} -export type OrgsRemoveOutsideCollaboratorError = { - documentation_url?: string; - message?: string; -}; +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum IssuesListParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} -export interface OrgsRemoveOutsideCollaboratorParams { - org: string; - username: string; +export type IssuesLockData = any; + +/** + * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + * \\* \`off-topic\` + * \\* \`too heated\` + * \\* \`resolved\` + * \\* \`spam\` + */ +export enum IssuesLockLockReasonEnum { + OffTopic = "off-topic", + TooHeated = "too heated", + Resolved = "resolved", + Spam = "spam", } -export type OrgsRemovePublicMembershipForAuthenticatedUserData = any; +export interface IssuesLockParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; +} -export interface OrgsRemovePublicMembershipForAuthenticatedUserParams { - org: string; - username: string; +export type IssuesLockPayload = { + /** + * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + * \\* \`off-topic\` + * \\* \`too heated\` + * \\* \`resolved\` + * \\* \`spam\` + */ + lock_reason?: IssuesLockLockReasonEnum; +} | null; + +export type IssuesRemoveAllLabelsData = any; + +export interface IssuesRemoveAllLabelsParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export type OrgsRemoveSamlSsoAuthorizationData = any; +export type IssuesRemoveAssigneesData = IssueSimple; -export interface OrgsRemoveSamlSsoAuthorizationParams { - credentialId: number; - org: string; +export interface IssuesRemoveAssigneesParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export type OrgsSetMembershipForUserData = OrgMembership; +export interface IssuesRemoveAssigneesPayload { + /** Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; +} -export interface OrgsSetMembershipForUserParams { - org: string; - username: string; +export type IssuesRemoveLabelData = Label[]; + +export interface IssuesRemoveLabelParams { + /** issue_number parameter */ + issueNumber: number; + name: string; + owner: string; + repo: string; } -export interface OrgsSetMembershipForUserPayload { - /** - * The role to give the user in the organization. Can be one of: - * \\* \`admin\` - The user will become an owner of the organization. - * \\* \`member\` - The user will become a non-owner member of the organization. - * @default "member" - */ - role?: OrgsSetMembershipForUserRoleEnum; +export type IssuesSetLabelsData = Label[]; + +export interface IssuesSetLabelsParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -/** - * The role to give the user in the organization. Can be one of: - * \\* \`admin\` - The user will become an owner of the organization. - * \\* \`member\` - The user will become a non-owner member of the organization. - * @default "member" - */ -export enum OrgsSetMembershipForUserRoleEnum { - Admin = "admin", - Member = "member", +export interface IssuesSetLabelsPayload { + /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ + labels?: string[]; } -export type OrgsSetPublicMembershipForAuthenticatedUserData = any; +export type IssuesUnlockData = any; -export interface OrgsSetPublicMembershipForAuthenticatedUserParams { - org: string; - username: string; +export interface IssuesUnlockParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -export type OrgsUnblockUserData = any; +export type IssuesUpdateCommentData = IssueComment; -export interface OrgsUnblockUserParams { - org: string; - username: string; +export interface IssuesUpdateCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; } -export type OrgsUpdateData = OrganizationFull; +export interface IssuesUpdateCommentPayload { + /** The contents of the comment. */ + body: string; +} -/** - * Default permission level members have for organization repositories: - * \\* \`read\` - can pull, but not push to or administer this repository. - * \\* \`write\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push, and administer this repository. - * \\* \`none\` - no permissions granted by default. - * @default "read" - */ -export enum OrgsUpdateDefaultRepositoryPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", - None = "none", +export type IssuesUpdateData = Issue; + +export type IssuesUpdateLabelData = Label; + +export interface IssuesUpdateLabelParams { + name: string; + owner: string; + repo: string; } -export type OrgsUpdateError = ValidationError | ValidationErrorSimple; +export interface IssuesUpdateLabelPayload { + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ + color?: string; + /** A short description of the label. */ + description?: string; + /** The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ + new_name?: string; +} -/** - * Specifies which types of repositories non-admin organization members can create. Can be one of: - * \\* \`all\` - all organization members can create public and private repositories. - * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - * \\* \`none\` - only admin members can create repositories. - * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. - */ -export enum OrgsUpdateMembersAllowedRepositoryCreationTypeEnum { - All = "all", - Private = "private", - None = "none", +export type IssuesUpdateMilestoneData = Milestone; + +export interface IssuesUpdateMilestoneParams { + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; } -export type OrgsUpdateMembershipForAuthenticatedUserData = OrgMembership; +export interface IssuesUpdateMilestonePayload { + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + due_on?: string; + /** + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" + */ + state?: IssuesUpdateMilestoneStateEnum; + /** The title of the milestone. */ + title?: string; +} -export interface OrgsUpdateMembershipForAuthenticatedUserParams { - org: string; +/** + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" + */ +export enum IssuesUpdateMilestoneStateEnum { + Open = "open", + Closed = "closed", } -export interface OrgsUpdateMembershipForAuthenticatedUserPayload { - /** The state that the membership should be in. Only \`"active"\` will be accepted. */ - state: OrgsUpdateMembershipForAuthenticatedUserStateEnum; +export interface IssuesUpdateParams { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; } -/** The state that the membership should be in. Only \`"active"\` will be accepted. */ -export enum OrgsUpdateMembershipForAuthenticatedUserStateEnum { - Active = "active", +export interface IssuesUpdatePayload { + /** Login for the user that this issue should be assigned to. **This field is deprecated.** */ + assignee?: string | null; + /** Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (\`[]\`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + /** The contents of the issue. */ + body?: string; + /** Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (\`[]\`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + color?: string | null; + description?: string | null; + id?: number; + name?: string; + } + )[]; + /** The \`number\` of the milestone to associate this issue with or \`null\` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._ */ + milestone?: string | number | null; + /** State of the issue. Either \`open\` or \`closed\`. */ + state?: IssuesUpdateStateEnum; + /** The title of the issue. */ + title?: string | number; } -export interface OrgsUpdateParams { - org: string; +/** State of the issue. Either \`open\` or \`closed\`. */ +export enum IssuesUpdateStateEnum { + Open = "open", + Closed = "closed", } -export interface OrgsUpdatePayload { - /** Billing email address. This address is not publicized. */ - billing_email?: string; - /** @example ""http://github.blog"" */ - blog?: string; - /** The company name. */ - company?: string; +/** + * Job + * Information of a job execution in a workflow run + */ +export interface Job { + /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ + check_run_url: string; /** - * Default permission level members have for organization repositories: - * \\* \`read\` - can pull, but not push to or administer this repository. - * \\* \`write\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push, and administer this repository. - * \\* \`none\` - no permissions granted by default. - * @default "read" + * The time that the job finished, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" */ - default_repository_permission?: OrgsUpdateDefaultRepositoryPermissionEnum; - /** The description of the company. */ - description?: string; - /** The publicly visible email address. */ - email?: string; - /** Toggles whether an organization can use organization projects. */ - has_organization_projects?: boolean; - /** Toggles whether repositories that belong to the organization can use repository projects. */ - has_repository_projects?: boolean; - /** The location. */ - location?: string; + completed_at: string | null; /** - * Specifies which types of repositories non-admin organization members can create. Can be one of: - * \\* \`all\` - all organization members can create public and private repositories. - * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - * \\* \`none\` - only admin members can create repositories. - * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. + * The outcome of the job. + * @example "success" */ - members_allowed_repository_creation_type?: OrgsUpdateMembersAllowedRepositoryCreationTypeEnum; + conclusion: string | null; /** - * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: - * \\* \`true\` - all organization members can create internal repositories. - * \\* \`false\` - only organization owners can create internal repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + * The SHA of the commit that is being run. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" */ - members_can_create_internal_repositories?: boolean; + head_sha: string; + /** @example "https://github.com/github/hello-world/runs/4" */ + html_url: string | null; /** - * Toggles whether organization members can create GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create GitHub Pages sites. - * \\* \`false\` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. - * @default true + * The id of the job. + * @example 21 */ - members_can_create_pages?: boolean; + id: number; /** - * Toggles whether organization members can create private GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create private GitHub Pages sites. - * \\* \`false\` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - * @default true + * The name of the job. + * @example "test-coverage" */ - members_can_create_private_pages?: boolean; + name: string; + /** @example "MDg6Q2hlY2tSdW40" */ + node_id: string; /** - * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: - * \\* \`true\` - all organization members can create private repositories. - * \\* \`false\` - only organization owners can create private repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + * The id of the associated workflow run. + * @example 5 */ - members_can_create_private_repositories?: boolean; + run_id: number; + /** @example "https://api.github.com/repos/github/hello-world/actions/runs/5" */ + run_url: string; /** - * Toggles whether organization members can create public GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create public GitHub Pages sites. - * \\* \`false\` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - * @default true + * The time that the job started, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" */ - members_can_create_public_pages?: boolean; + started_at: string; /** - * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: - * \\* \`true\` - all organization members can create public repositories. - * \\* \`false\` - only organization owners can create public repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + * The phase of the lifecycle that the job is currently in. + * @example "queued" */ - members_can_create_public_repositories?: boolean; - /** - * Toggles the ability of non-admin organization members to create repositories. Can be one of: - * \\* \`true\` - all organization members can create repositories. - * \\* \`false\` - only organization owners can create repositories. - * Default: \`true\` - * **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. - * @default true - */ - members_can_create_repositories?: boolean; - /** The shorthand name of the company. */ - name?: string; - /** The Twitter username of the company. */ - twitter_username?: string; + status: JobStatusEnum; + /** Steps in this job. */ + steps?: { + /** + * The time that the job finished, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" + */ + completed_at?: string | null; + /** + * The outcome of the job. + * @example "success" + */ + conclusion: string | null; + /** + * The name of the job. + * @example "test-coverage" + */ + name: string; + /** @example 1 */ + number: number; + /** + * The time that the step started, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" + */ + started_at?: string | null; + /** + * The phase of the lifecycle that the job is currently in. + * @example "queued" + */ + status: JobStatusEnum1; + }[]; + /** @example "https://api.github.com/repos/github/hello-world/actions/jobs/21" */ + url: string; } -export type OrgsUpdateWebhookConfigForOrgData = WebhookConfig; - -export interface OrgsUpdateWebhookConfigForOrgParams { - hookId: number; - org: string; +/** + * The phase of the lifecycle that the job is currently in. + * @example "queued" + */ +export enum JobStatusEnum { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ -export interface OrgsUpdateWebhookConfigForOrgPayload { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; +/** + * The phase of the lifecycle that the job is currently in. + * @example "queued" + */ +export enum JobStatusEnum1 { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", } -export type OrgsUpdateWebhookData = OrgHook; +/** + * Key + * Key + */ +export interface Key { + /** @format date-time */ + created_at: string; + id: number; + key: string; + key_id: string; + read_only: boolean; + title: string; + url: string; + verified: boolean; +} -export interface OrgsUpdateWebhookParams { - hookId: number; - org: string; +/** + * Key Simple + * Key Simple + */ +export interface KeySimple { + id: number; + key: string; } -export interface OrgsUpdateWebhookPayload { +/** + * Label + * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + */ +export interface Label { /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true + * 6-character hex code, without the leading #, identifying the color + * @example "FFFFFF" */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ - config?: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - }; + color: string; + /** @example true */ + default: boolean; + /** @example "Something isn't working" */ + description: string | null; + /** @example 208045946 */ + id: number; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] + * The name of the label. + * @example "bug" */ - events?: string[]; - /** @example ""web"" */ - name?: string; + name: string; + /** @example "MDU6TGFiZWwyMDgwNDU5NDY=" */ + node_id: string; + /** + * URL for the label + * @format uri + * @example "https://api.github.com/repositories/42/labels/bug" + */ + url: string; } -export interface PackagesBillingUsage { - /** Free storage space (GB) for GitHub Packages. */ - included_gigabytes_bandwidth: number; - /** Sum of the free and paid storage space (GB) for GitHuub Packages. */ - total_gigabytes_bandwidth_used: number; - /** Total paid storage space (GB) for GitHuub Packages. */ - total_paid_gigabytes_bandwidth_used: number; +/** + * Label Search Result Item + * Label Search Result Item + */ +export interface LabelSearchResultItem { + color: string; + default: boolean; + description: string | null; + id: number; + name: string; + node_id: string; + score: number; + text_matches?: SearchResultTextMatches; + /** @format uri */ + url: string; } /** - * GitHub Pages - * The configuration for GitHub Pages for a repository. + * Language + * Language */ -export interface Page { - /** - * Whether the Page has a custom 404 page. - * @default false - * @example false - */ - custom_404: boolean; +export type Language = Record; + +/** + * License + * License + */ +export interface License { /** - * The Pages site's custom domain - * @example "example.com" + * @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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * 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. + * " */ - cname: string | null; + body: string; + /** @example ["include-copyright"] */ + conditions: string[]; + /** @example "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty." */ + description: string; + /** @example true */ + featured: boolean; /** - * The web address the Page can be accessed from. * @format uri - * @example "https://example.com" - */ - html_url?: string; - /** - * Whether the GitHub Pages site is publicly visible. If set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. - * @example true - */ - public: boolean; - source?: PagesSourceHash; - /** - * The status of the most recent build of the Page. - * @example "built" + * @example "http://choosealicense.com/licenses/mit/" */ - status: PageStatusEnum | null; + html_url: string; + /** @example "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders." */ + implementation: string; + /** @example "mit" */ + key: string; + /** @example ["no-liability"] */ + limitations: string[]; + /** @example "MIT License" */ + name: string; + /** @example "MDc6TGljZW5zZW1pdA==" */ + node_id: string; + /** @example ["commercial-use","modifications","distribution","sublicense","private-use"] */ + permissions: string[]; + /** @example "MIT" */ + spdx_id: string | null; /** - * The API address for accessing this Page resource. * @format uri - * @example "https://api.github.com/repos/github/hello-world/pages" + * @example "https://api.github.com/licenses/mit" */ - url: string; + url: string | null; } /** - * Page Build - * Page Build + * License Content + * License Content */ -export interface PageBuild { - commit: string; - /** @format date-time */ - created_at: string; - duration: number; - error: { - message: string | null; +export interface LicenseContent { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; }; - pusher: SimpleUser | null; - status: string; - /** @format date-time */ - updated_at: string; + content: string; + /** @format uri */ + download_url: string | null; + encoding: string; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + license: LicenseSimple | null; + name: string; + path: string; + sha: string; + size: number; + type: string; /** @format uri */ url: string; } /** - * Page Build Status - * Page Build Status + * License Simple + * License Simple */ -export interface PageBuildStatus { - /** @example "queued" */ - status: string; +export interface LicenseSimple { + /** @format uri */ + html_url?: string; + /** @example "mit" */ + key: string; + /** @example "MIT License" */ + name: string; + /** @example "MDc6TGljZW5zZW1pdA==" */ + node_id: string; + /** @example "MIT" */ + spdx_id: string | null; /** * @format uri - * @example "https://api.github.com/repos/github/hello-world/pages/builds/latest" + * @example "https://api.github.com/licenses/mit" */ - url: string; + url: string | null; } -/** - * The status of the most recent build of the Page. - * @example "built" - */ -export enum PageStatusEnum { - Built = "built", - Building = "building", - Errored = "errored", +export type LicensesGetAllCommonlyUsedData = LicenseSimple[]; + +export interface LicensesGetAllCommonlyUsedParams { + featured?: boolean; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** Pages Source Hash */ -export interface PagesSourceHash { - branch: string; - path: string; +export type LicensesGetData = License; + +export type LicensesGetForRepoData = LicenseContent; + +export interface LicensesGetForRepoParams { + owner: string; + repo: string; } -/** Participation Stats */ -export interface ParticipationStats { - all: number[]; - owner: number[]; +export interface LicensesGetParams { + license: string; } /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * Link + * Hypermedia Link */ -export enum PerEnum { - Day = "day", - Week = "week", +export interface Link { + href: string; } /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * Link With Type + * Hypermedia Link with Type */ -export enum PerEnum1 { - Day = "day", - Week = "week", +export interface LinkWithType { + href: string; + type: string; } +export type MarkdownRenderData = string; + /** - * Porter Author - * Porter Author + * The rendering mode. + * @default "markdown" + * @example "markdown" */ -export interface PorterAuthor { - email: string; - id: number; - /** @format uri */ - import_url: string; - name: string; - remote_id: string; - remote_name: string; - /** @format uri */ - url: string; +export enum MarkdownRenderModeEnum { + Markdown = "markdown", + Gfm = "gfm", } -/** - * Porter Large File - * Porter Large File - */ -export interface PorterLargeFile { - oid: string; - path: string; - ref_name: string; - size: number; +export interface MarkdownRenderPayload { + /** The repository context to use when creating references in \`gfm\` mode. */ + context?: string; + /** + * The rendering mode. + * @default "markdown" + * @example "markdown" + */ + mode?: MarkdownRenderModeEnum; + /** The Markdown text to render in HTML. */ + text: string; } -/** Preview Header Missing */ -export interface PreviewHeaderMissing { - documentation_url: string; - message: string; +export type MarkdownRenderRawData = string; + +export type MarkdownRenderRawPayload = string; + +/** Marketplace Account */ +export interface MarketplaceAccount { + /** @format email */ + email?: string | null; + id: number; + login: string; + node_id?: string; + /** @format email */ + organization_billing_email?: string | null; + type: string; + /** @format uri */ + url: string; } /** - * Private User - * Private User + * Marketplace Listing Plan + * Marketplace Listing Plan */ -export interface PrivateUser { - /** - * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" - */ - avatar_url: string; - /** @example "There once was..." */ - bio: string | null; - /** @example "https://github.com/blog" */ - blog: string | null; - business_plus?: boolean; - /** @example 8 */ - collaborators: number; - /** @example "GitHub" */ - company: string | null; - /** - * @format date-time - * @example "2008-01-14T04:33:35Z" - */ - created_at: string; - /** @example 10000 */ - disk_usage: number; - /** - * @format email - * @example "octocat@github.com" - */ - email: string | null; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ - events_url: string; - /** @example 20 */ - followers: number; +export interface MarketplaceListingPlan { /** * @format uri - * @example "https://api.github.com/users/octocat/followers" + * @example "https://api.github.com/marketplace_listing/plans/1313/accounts" */ - followers_url: string; - /** @example 0 */ - following: number; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; - hireable: boolean | null; + accounts_url: string; + /** @example ["Up to 25 private repositories","11 concurrent builds"] */ + bullets: string[]; + /** @example "A professional-grade CI solution" */ + description: string; + /** @example true */ + has_free_trial: boolean; + /** @example 1313 */ + id: number; + /** @example 1099 */ + monthly_price_in_cents: number; + /** @example "Pro" */ + name: string; + /** @example 3 */ + number: number; + /** @example "flat-rate" */ + price_model: string; + /** @example "published" */ + state: string; + unit_name: string | null; /** * @format uri - * @example "https://github.com/octocat" + * @example "https://api.github.com/marketplace_listing/plans/1313" */ - html_url: string; - /** @example 1 */ + url: string; + /** @example 11870 */ + yearly_price_in_cents: number; +} + +/** + * Marketplace Purchase + * Marketplace Purchase + */ +export interface MarketplacePurchase { id: number; - ldap_dn?: string; - /** @example "San Francisco" */ - location: string | null; - /** @example "octocat" */ login: string; - /** @example "monalisa octocat" */ - name: string | null; - /** @example "MDQ6VXNlcjE=" */ - node_id: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/orgs" - */ - organizations_url: string; - /** @example 100 */ - owned_private_repos: number; - plan?: { - collaborators: number; - name: string; - private_repos: number; - space: number; + marketplace_pending_change?: { + effective_date?: string; + id?: number; + is_installed?: boolean; + /** Marketplace Listing Plan */ + plan?: MarketplaceListingPlan; + unit_count?: number | null; + } | null; + marketplace_purchase: { + billing_cycle?: string; + free_trial_ends_on?: string | null; + is_installed?: boolean; + next_billing_date?: string | null; + on_free_trial?: boolean; + /** Marketplace Listing Plan */ + plan?: MarketplaceListingPlan; + unit_count?: number | null; + updated_at?: string; }; - /** @example 81 */ - private_gists: number; - /** @example 1 */ - public_gists: number; - /** @example 2 */ - public_repos: number; - /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" - */ - received_events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" - */ - repos_url: string; - site_admin: boolean; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" - */ - subscriptions_url: string; - /** @format date-time */ - suspended_at?: string | null; - /** @example 100 */ - total_private_repos: number; - /** @example "monalisa" */ - twitter_username?: string | null; - /** @example true */ - two_factor_authentication: boolean; - /** @example "User" */ + organization_billing_email?: string; type: string; - /** - * @format date-time - * @example "2008-01-14T04:33:35Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat" - */ url: string; } -/** - * Project - * Projects are a way to organize columns and cards of work. - */ -export interface Project { - /** - * Body of the project - * @example "This project represents the sprint of the first week in January" - */ - body: string | null; - /** - * @format uri - * @example "https://api.github.com/projects/1002604/columns" - */ - columns_url: string; - /** - * @format date-time - * @example "2011-04-10T20:09:31Z" - */ - created_at: string; - creator: SimpleUser | null; - /** - * @format uri - * @example "https://github.com/api-playground/projects-test/projects/12" - */ - html_url: string; - /** @example 1002604 */ - id: number; - /** - * Name of the project - * @example "Week One Sprint" - */ - name: string; - /** @example "MDc6UHJvamVjdDEwMDI2MDQ=" */ - node_id: string; - /** @example 1 */ - number: number; - /** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ - organization_permission?: ProjectOrganizationPermissionEnum; - /** - * @format uri - * @example "https://api.github.com/repos/api-playground/projects-test" - */ - owner_url: string; - /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ - private?: boolean; - /** - * State of the project; either 'open' or 'closed' - * @example "open" - */ - state: string; - /** - * @format date-time - * @example "2014-03-03T18:58:10Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/projects/1002604" - */ - url: string; +export type MetaGetData = ApiOverview; + +export type MetaGetOctocatData = string; + +export interface MetaGetOctocatParams { + /** The words to show in Octocat's speech bubble */ + s?: string; } -/** - * Project Card - * Project cards represent a scope of work. - */ -export interface ProjectCard { - /** - * Whether or not the card is archived - * @example false - */ - archived?: boolean; - /** - * @format uri - * @example "https://api.github.com/projects/columns/367" - */ - column_url: string; - /** - * @format uri - * @example "https://api.github.com/repos/api-playground/projects-test/issues/3" - */ - content_url?: string; - /** - * @format date-time - * @example "2016-09-05T14:21:06Z" - */ - created_at: string; - creator: SimpleUser | null; - /** - * The project card's ID - * @example 42 - */ - id: number; - /** @example "MDExOlByb2plY3RDYXJkMTQ3OA==" */ - node_id: string; - /** @example "Add payload for delete Project column" */ - note: string | null; - /** - * @format uri - * @example "https://api.github.com/projects/120" - */ - project_url: string; - /** - * @format date-time - * @example "2016-09-05T14:20:22Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/projects/columns/cards/1478" - */ - url: string; +export type MetaGetZenData = string; + +export interface MetaRootData { + /** @format uri */ + authorizations_url: string; + /** @format uri */ + code_search_url: string; + /** @format uri */ + commit_search_url: string; + /** @format uri */ + current_user_authorizations_html_url: string; + /** @format uri */ + current_user_repositories_url: string; + /** @format uri */ + current_user_url: string; + /** @format uri */ + emails_url: string; + /** @format uri */ + emojis_url: string; + /** @format uri */ + events_url: string; + /** @format uri */ + feeds_url: string; + /** @format uri */ + followers_url: string; + /** @format uri */ + following_url: string; + /** @format uri */ + gists_url: string; + /** @format uri */ + hub_url: string; + /** @format uri */ + issue_search_url: string; + /** @format uri */ + issues_url: string; + /** @format uri */ + keys_url: string; + /** @format uri */ + label_search_url: string; + /** @format uri */ + notifications_url: string; + /** @format uri */ + organization_repositories_url: string; + /** @format uri */ + organization_teams_url: string; + /** @format uri */ + organization_url: string; + /** @format uri */ + public_gists_url: string; + /** @format uri */ + rate_limit_url: string; + /** @format uri */ + repository_search_url: string; + /** @format uri */ + repository_url: string; + /** @format uri */ + starred_gists_url: string; + /** @format uri */ + starred_url: string; + /** @format uri */ + topic_search_url?: string; + /** @format uri */ + user_organizations_url: string; + /** @format uri */ + user_repositories_url: string; + /** @format uri */ + user_search_url: string; + /** @format uri */ + user_url: string; } /** - * Project Column - * Project columns contain cards of work. + * Migration + * A migration. */ -export interface ProjectColumn { - /** - * @format uri - * @example "https://api.github.com/projects/columns/367/cards" - */ - cards_url: string; +export interface Migration { + /** @format uri */ + archive_url?: string; /** * @format date-time - * @example "2016-09-05T14:18:44Z" + * @example "2015-07-06T15:33:38-07:00" */ created_at: string; - /** - * The unique identifier of the project column - * @example 42 - */ + exclude?: any[]; + exclude_attachments: boolean; + /** @example "0b989ba4-242f-11e5-81e1-c7b6966d2516" */ + guid: string; + /** @example 79 */ id: number; - /** - * Name of the project column - * @example "Remaining tasks" - */ - name: string; - /** @example "MDEzOlByb2plY3RDb2x1bW4zNjc=" */ + /** @example true */ + lock_repositories: boolean; node_id: string; - /** - * @format uri - * @example "https://api.github.com/projects/120" - */ - project_url: string; + owner: SimpleUser | null; + repositories: Repository[]; + /** @example "pending" */ + state: string; /** * @format date-time - * @example "2016-09-05T14:22:28Z" + * @example "2015-07-06T15:33:38-07:00" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/projects/columns/367" + * @example "https://api.github.com/orgs/octo-org/migrations/79" */ url: string; } -/** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ -export enum ProjectOrganizationPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", - None = "none", +export type MigrationsCancelImportData = any; + +export interface MigrationsCancelImportParams { + owner: string; + repo: string; } -export type ProjectsAddCollaboratorData = any; +export type MigrationsDeleteArchiveForAuthenticatedUserData = any; -export interface ProjectsAddCollaboratorParams { - projectId: number; - username: string; +export interface MigrationsDeleteArchiveForAuthenticatedUserParams { + /** migration_id parameter */ + migrationId: number; } -export interface ProjectsAddCollaboratorPayload { - /** - * The permission to grant the collaborator. - * @default "write" - * @example "write" - */ - permission?: ProjectsAddCollaboratorPermissionEnum; +export type MigrationsDeleteArchiveForOrgData = any; + +export interface MigrationsDeleteArchiveForOrgParams { + /** migration_id parameter */ + migrationId: number; + org: string; } -/** - * The permission to grant the collaborator. - * @default "write" - * @example "write" - */ -export enum ProjectsAddCollaboratorPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", +export interface MigrationsDownloadArchiveForOrgParams { + /** migration_id parameter */ + migrationId: number; + org: string; } -export type ProjectsCreateCardData = ProjectCard; +export interface MigrationsGetArchiveForAuthenticatedUserParams { + /** migration_id parameter */ + migrationId: number; +} -export type ProjectsCreateCardError = - | (ValidationError | ValidationErrorSimple) - | { - code?: string; - documentation_url?: string; - errors?: { - code?: string; - message?: string; - }[]; - message?: string; - }; +export type MigrationsGetCommitAuthorsData = PorterAuthor[]; -export interface ProjectsCreateCardParams { - /** column_id parameter */ - columnId: number; +export interface MigrationsGetCommitAuthorsParams { + owner: string; + repo: string; + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; } -export type ProjectsCreateCardPayload = - | { - /** - * The project card's note - * @example "Update all gems" - */ - note: string | null; - } - | { - /** - * The unique identifier of the content associated with the card - * @example 42 - */ - content_id: number; - /** - * The piece of content associated with the card - * @example "PullRequest" - */ - content_type: string; - }; +export type MigrationsGetImportStatusData = Import; -export type ProjectsCreateColumnData = ProjectColumn; +export interface MigrationsGetImportStatusParams { + owner: string; + repo: string; +} -export interface ProjectsCreateColumnParams { - projectId: number; +export type MigrationsGetLargeFilesData = PorterLargeFile[]; + +export interface MigrationsGetLargeFilesParams { + owner: string; + repo: string; } -export interface ProjectsCreateColumnPayload { +export type MigrationsGetStatusForAuthenticatedUserData = Migration; + +export interface MigrationsGetStatusForAuthenticatedUserParams { + exclude?: string[]; + /** migration_id parameter */ + migrationId: number; +} + +export type MigrationsGetStatusForOrgData = Migration; + +export interface MigrationsGetStatusForOrgParams { + /** migration_id parameter */ + migrationId: number; + org: string; +} + +export type MigrationsListForAuthenticatedUserData = Migration[]; + +export interface MigrationsListForAuthenticatedUserParams { /** - * Name of the project column - * @example "Remaining tasks" + * Page number of the results to fetch. + * @default 1 */ - name: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export type ProjectsCreateForAuthenticatedUserData = Project; +export type MigrationsListForOrgData = Migration[]; -export interface ProjectsCreateForAuthenticatedUserPayload { +export interface MigrationsListForOrgParams { + org: string; /** - * Body of the project - * @example "This project represents the sprint of the first week in January" + * Page number of the results to fetch. + * @default 1 */ - body?: string | null; + page?: number; /** - * Name of the project - * @example "Week One Sprint" + * Results per page (max 100) + * @default 30 */ - name: string; + per_page?: number; } -export type ProjectsCreateForOrgData = Project; +export type MigrationsListReposForOrgData = MinimalRepository[]; -export interface ProjectsCreateForOrgParams { +export interface MigrationsListReposForOrgParams { + /** migration_id parameter */ + migrationId: number; org: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export interface ProjectsCreateForOrgPayload { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; +export type MigrationsListReposForUserData = MinimalRepository[]; + +export interface MigrationsListReposForUserParams { + /** migration_id parameter */ + migrationId: number; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -export type ProjectsCreateForRepoData = Project; +export type MigrationsMapCommitAuthorData = PorterAuthor; -export interface ProjectsCreateForRepoParams { +export interface MigrationsMapCommitAuthorParams { + authorId: number; owner: string; repo: string; } -export interface ProjectsCreateForRepoPayload { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; +export interface MigrationsMapCommitAuthorPayload { + /** The new Git author email. */ + email?: string; + /** The new Git author name. */ + name?: string; + /** @example ""can't touch this"" */ + remote_id?: string; } -export type ProjectsDeleteCardData = any; - -export type ProjectsDeleteCardError = { - documentation_url?: string; - errors?: string[]; - message?: string; -}; - -export interface ProjectsDeleteCardParams { - /** card_id parameter */ - cardId: number; -} - -export type ProjectsDeleteColumnData = any; - -export interface ProjectsDeleteColumnParams { - /** column_id parameter */ - columnId: number; -} - -export type ProjectsDeleteData = any; - -export type ProjectsDeleteError = { - documentation_url?: string; - errors?: string[]; - message?: string; -}; - -export interface ProjectsDeleteParams { - projectId: number; -} - -export type ProjectsGetCardData = ProjectCard; +export type MigrationsSetLfsPreferenceData = Import; -export interface ProjectsGetCardParams { - /** card_id parameter */ - cardId: number; +export interface MigrationsSetLfsPreferenceParams { + owner: string; + repo: string; } -export type ProjectsGetColumnData = ProjectColumn; - -export interface ProjectsGetColumnParams { - /** column_id parameter */ - columnId: number; +export interface MigrationsSetLfsPreferencePayload { + /** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ + use_lfs: MigrationsSetLfsPreferenceUseLfsEnum; } -export type ProjectsGetData = Project; - -export interface ProjectsGetParams { - projectId: number; +/** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ +export enum MigrationsSetLfsPreferenceUseLfsEnum { + OptIn = "opt_in", + OptOut = "opt_out", } -export type ProjectsGetPermissionForUserData = RepositoryCollaboratorPermission; +export type MigrationsStartForAuthenticatedUserData = Migration; -export interface ProjectsGetPermissionForUserParams { - projectId: number; - username: string; +/** + * Allowed values that can be passed to the exclude param. + * @example "repositories" + */ +export enum MigrationsStartForAuthenticatedUserExcludeEnum { + Repositories = "repositories", } -export type ProjectsListCardsData = ProjectCard[]; - -export interface ProjectsListCardsParams { +export interface MigrationsStartForAuthenticatedUserPayload { /** - * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. - * @default "not_archived" + * Exclude attributes from the API response to improve performance + * @example ["repositories"] */ - archived_state?: ArchivedStateEnum; - /** column_id parameter */ - columnId: number; + exclude?: MigrationsStartForAuthenticatedUserExcludeEnum[]; /** - * Page number of the results to fetch. - * @default 1 + * Do not include attachments in the migration + * @example true */ - page?: number; + exclude_attachments?: boolean; /** - * Results per page (max 100) - * @default 30 + * Lock the repositories being migrated at the start of the migration + * @example true */ - per_page?: number; + lock_repositories?: boolean; + repositories: string[]; } -/** - * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. - * @default "not_archived" - */ -export enum ProjectsListCardsParams1ArchivedStateEnum { - All = "all", - Archived = "archived", - NotArchived = "not_archived", -} +export type MigrationsStartForOrgData = Migration; -export type ProjectsListCollaboratorsData = SimpleUser[]; +export interface MigrationsStartForOrgParams { + org: string; +} -export interface ProjectsListCollaboratorsParams { - /** - * Filters the collaborators by their affiliation. Can be one of: - * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. - * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: AffiliationEnum; +export interface MigrationsStartForOrgPayload { + exclude?: string[]; /** - * Page number of the results to fetch. - * @default 1 + * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). + * @default false */ - page?: number; + exclude_attachments?: boolean; /** - * Results per page (max 100) - * @default 30 + * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. + * @default false */ - per_page?: number; - projectId: number; + lock_repositories?: boolean; + /** A list of arrays indicating which repositories should be migrated. */ + repositories: string[]; } -/** - * Filters the collaborators by their affiliation. Can be one of: - * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. - * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ -export enum ProjectsListCollaboratorsParams1AffiliationEnum { - Outside = "outside", - Direct = "direct", - All = "all", +export type MigrationsStartImportData = Import; + +export interface MigrationsStartImportParams { + owner: string; + repo: string; } -export type ProjectsListColumnsData = ProjectColumn[]; +export interface MigrationsStartImportPayload { + /** For a tfvc import, the name of the project that is being imported. */ + tfvc_project?: string; + /** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ + vcs?: MigrationsStartImportVcsEnum; + /** If authentication is required, the password to provide to \`vcs_url\`. */ + vcs_password?: string; + /** The URL of the originating repository. */ + vcs_url: string; + /** If authentication is required, the username to provide to \`vcs_url\`. */ + vcs_username?: string; +} -export interface ProjectsListColumnsParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - projectId: number; +/** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ +export enum MigrationsStartImportVcsEnum { + Subversion = "subversion", + Git = "git", + Mercurial = "mercurial", + Tfvc = "tfvc", } -export type ProjectsListForOrgData = Project[]; +export type MigrationsUnlockRepoForAuthenticatedUserData = any; -export interface ProjectsListForOrgParams { +export interface MigrationsUnlockRepoForAuthenticatedUserParams { + /** migration_id parameter */ + migrationId: number; + /** repo_name parameter */ + repoName: string; +} + +export type MigrationsUnlockRepoForOrgData = any; + +export interface MigrationsUnlockRepoForOrgParams { + /** migration_id parameter */ + migrationId: number; org: string; + /** repo_name parameter */ + repoName: string; +} + +export type MigrationsUpdateImportData = Import; + +export interface MigrationsUpdateImportParams { + owner: string; + repo: string; +} + +export interface MigrationsUpdateImportPayload { + /** @example ""project1"" */ + tfvc_project?: string; + /** @example ""git"" */ + vcs?: string; + /** The password to provide to the originating repository. */ + vcs_password?: string; + /** The username to provide to the originating repository. */ + vcs_username?: string; +} + +/** + * Milestone + * A collection of related issues and pull requests. + */ +export interface Milestone { /** - * Page number of the results to fetch. - * @default 1 + * @format date-time + * @example "2013-02-12T13:22:01Z" */ - page?: number; + closed_at: string | null; + /** @example 8 */ + closed_issues: number; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-04-10T20:09:31Z" */ - per_page?: number; + created_at: string; + creator: SimpleUser | null; + /** @example "Tracking milestone for version 1.0" */ + description: string | null; /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * @format date-time + * @example "2012-10-09T23:39:01Z" */ - state?: StateEnum2; -} - -/** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum ProjectsListForOrgParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} - -export type ProjectsListForRepoData = Project[]; - -export interface ProjectsListForRepoParams { - owner: string; + due_on: string | null; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://github.com/octocat/Hello-World/milestones/v1.0" */ - page?: number; + html_url: string; + /** @example 1002604 */ + id: number; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" */ - per_page?: number; - repo: string; + labels_url: string; + /** @example "MDk6TWlsZXN0b25lMTAwMjYwNA==" */ + node_id: string; /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * The number of the milestone. + * @example 42 + */ + number: number; + /** @example 4 */ + open_issues: number; + /** + * The state of the milestone. * @default "open" + * @example "open" */ - state?: StateEnum5; -} - -/** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum ProjectsListForRepoParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} - -export type ProjectsListForUserData = Project[]; - -export interface ProjectsListForUserParams { + state: MilestoneStateEnum; /** - * Page number of the results to fetch. - * @default 1 + * The title of the milestone. + * @example "v1.0" */ - page?: number; + title: string; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2014-03-03T18:58:10Z" */ - per_page?: number; + updated_at: string; /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1" */ - state?: StateEnum10; - username: string; + url: string; } /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * The state of the milestone. * @default "open" + * @example "open" */ -export enum ProjectsListForUserParams1StateEnum { +export enum MilestoneStateEnum { Open = "open", Closed = "closed", - All = "all", -} - -export type ProjectsMoveCardData = object; - -export type ProjectsMoveCardError = - | { - documentation_url?: string; - errors?: { - code?: string; - field?: string; - message?: string; - resource?: string; - }[]; - message?: string; - } - | { - code?: string; - documentation_url?: string; - errors?: { - code?: string; - message?: string; - }[]; - message?: string; - }; - -export interface ProjectsMoveCardParams { - /** card_id parameter */ - cardId: number; } -export interface ProjectsMoveCardPayload { +/** + * Minimal Repository + * Minimal Repository + */ +export interface MinimalRepository { + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + archived?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + clone_url?: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** - * The unique identifier of the column the card should be moved to - * @example 42 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - column_id?: number; + contributors_url: string; /** - * The position of the card in a column - * @pattern ^(?:top|bottom|after:\\d+)$ - * @example "bottom" + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - position: string; -} - -export type ProjectsMoveColumnData = object; - -export interface ProjectsMoveColumnParams { - /** column_id parameter */ - columnId: number; -} - -export interface ProjectsMoveColumnPayload { + created_at?: string | null; + default_branch?: string; + delete_branch_on_merge?: boolean; /** - * The position of the column in a project - * @pattern ^(?:first|last|after:\\d+)$ - * @example "last" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - position: string; -} - -export type ProjectsRemoveCollaboratorData = any; - -export interface ProjectsRemoveCollaboratorParams { - projectId: number; - username: string; -} - -export type ProjectsUpdateCardData = ProjectCard; - -export interface ProjectsUpdateCardParams { - /** card_id parameter */ - cardId: number; -} - -export interface ProjectsUpdateCardPayload { + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + disabled?: boolean; /** - * Whether or not the card is archived - * @example false + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - archived?: boolean; + downloads_url: string; /** - * The project card's note - * @example "Update all gems" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - note?: string | null; -} - -export type ProjectsUpdateColumnData = ProjectColumn; - -export interface ProjectsUpdateColumnParams { - /** column_id parameter */ - columnId: number; -} - -export interface ProjectsUpdateColumnPayload { + events_url: string; + fork: boolean; + /** @example 0 */ + forks?: number; + forks_count?: number; /** - * Name of the project column - * @example "Remaining tasks" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - name: string; -} - -export type ProjectsUpdateData = Project; - -export type ProjectsUpdateError = { - documentation_url?: string; - errors?: string[]; - message?: string; -}; - -/** The baseline permission that all organization members have on this project */ -export enum ProjectsUpdateOrganizationPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", - None = "none", -} - -export interface ProjectsUpdateParams { - projectId: number; -} - -export interface ProjectsUpdatePayload { + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + git_url?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_pages?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + homepage?: string | null; /** - * Body of the project - * @example "This project represents the sprint of the first week in January" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - body?: string | null; + hooks_url: string; /** - * Name of the project - * @example "Week One Sprint" + * @format uri + * @example "https://github.com/octocat/Hello-World" */ - name?: string; - /** The baseline permission that all organization members have on this project */ - organization_permission?: ProjectsUpdateOrganizationPermissionEnum; - /** Whether or not this project can be seen by everyone. */ - private?: boolean; + html_url: string; + /** @example 1296269 */ + id: number; + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language?: string | null; /** - * State of the project; either 'open' or 'closed' - * @example "open" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - state?: string; + languages_url: string; + license?: { + key?: string; + name?: string; + node_id?: string; + spdx_id?: string; + url?: string; + } | null; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" + */ + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; + mirror_url?: string | null; + /** @example "Hello-World" */ + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + /** @example 0 */ + open_issues?: number; + open_issues_count?: number; + owner: SimpleUser | null; + permissions?: { + admin?: boolean; + pull?: boolean; + push?: boolean; + }; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; + /** + * @format date-time + * @example "2011-01-26T19:06:43Z" + */ + pushed_at?: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + size?: number; + ssh_url?: string; + stargazers_count?: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + */ + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + */ + subscribers_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + */ + subscription_url: string; + svn_url?: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" + */ + tags_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" + */ + teams_url: string; + temp_clone_token?: string; + template_repository?: Repository | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; + /** + * @format date-time + * @example "2011-01-26T19:14:43Z" + */ + updated_at?: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" + */ + url: string; + visibility?: string; + /** @example 0 */ + watchers?: number; + watchers_count?: number; +} + +/** Moved Permanently */ +export type MovedPermanently = any; + +/** Resource Not Found */ +export type NotFound = BasicError; + +/** Not Modified */ +export type NotModified = any; + +export type OauthAuthorizationsCreateAuthorizationData = Authorization; + +export interface OauthAuthorizationsCreateAuthorizationPayload { + /** + * The OAuth app client key for which to create the token. + * @maxLength 20 + */ + client_id?: string; + /** + * The OAuth app client secret for which to create the token. + * @maxLength 40 + */ + client_secret?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; +} + +export type OauthAuthorizationsDeleteAuthorizationData = any; + +export interface OauthAuthorizationsDeleteAuthorizationParams { + /** authorization_id parameter */ + authorizationId: number; +} + +export type OauthAuthorizationsDeleteGrantData = any; + +export interface OauthAuthorizationsDeleteGrantParams { + /** grant_id parameter */ + grantId: number; +} + +export type OauthAuthorizationsGetAuthorizationData = Authorization; + +export interface OauthAuthorizationsGetAuthorizationParams { + /** authorization_id parameter */ + authorizationId: number; +} + +export type OauthAuthorizationsGetGrantData = ApplicationGrant; + +export interface OauthAuthorizationsGetGrantParams { + /** grant_id parameter */ + grantId: number; +} + +export type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData = + Authorization; + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintParams { + /** The client ID of your GitHub app. */ + clientId: string; + fingerprint: string; +} + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload { + /** + * The OAuth app client secret for which to create the token. + * @maxLength 40 + */ + client_secret: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; +} + +export type OauthAuthorizationsGetOrCreateAuthorizationForAppData = + Authorization; + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppParams { + /** The client ID of your GitHub app. */ + clientId: string; +} + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppPayload { + /** + * The OAuth app client secret for which to create the token. + * @maxLength 40 + */ + client_secret: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; +} + +export type OauthAuthorizationsListAuthorizationsData = Authorization[]; + +export interface OauthAuthorizationsListAuthorizationsParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} + +export type OauthAuthorizationsListGrantsData = ApplicationGrant[]; + +export interface OauthAuthorizationsListGrantsParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} + +export type OauthAuthorizationsUpdateAuthorizationData = Authorization; + +export interface OauthAuthorizationsUpdateAuthorizationParams { + /** authorization_id parameter */ + authorizationId: number; +} + +export interface OauthAuthorizationsUpdateAuthorizationPayload { + /** A list of scopes to add to this authorization. */ + add_scopes?: string[]; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** A list of scopes to remove from this authorization. */ + remove_scopes?: string[]; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; } /** - * Protected Branch - * Branch protections protect branches + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ -export interface ProtectedBranch { - allow_deletions?: { - enabled: boolean; - }; - allow_force_pushes?: { - enabled: boolean; - }; - enforce_admins?: { - enabled: boolean; - /** @format uri */ - url: string; - }; - required_linear_history?: { - enabled: boolean; - }; - required_pull_request_reviews?: { - dismiss_stale_reviews?: boolean; - dismissal_restrictions?: { - teams: Team[]; - /** @format uri */ - teams_url: string; - /** @format uri */ - url: string; - users: SimpleUser[]; - /** @format uri */ - users_url: string; - }; - require_code_owner_reviews?: boolean; - required_approving_review_count?: number; - /** @format uri */ - url: string; - }; - required_signatures?: { - /** @example true */ - enabled: boolean; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" - */ - url: string; - }; - /** Status Check Policy */ - required_status_checks?: StatusCheckPolicy; - /** Branch Restriction Policy */ - restrictions?: BranchRestrictionPolicy; - /** @format uri */ - url: string; +export enum OrderEnum { + Desc = "desc", + Asc = "asc", } /** - * Protected Branch Admin Enforced - * Protected Branch Admin Enforced + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ -export interface ProtectedBranchAdminEnforced { +export enum OrderEnum1 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum2 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum3 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum4 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum5 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum6 { + Desc = "desc", + Asc = "asc", +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum OrderEnum7 { + Desc = "desc", + Asc = "asc", +} + +/** + * Org Hook + * Org Hook + */ +export interface OrgHook { /** @example true */ - enabled: boolean; + active: boolean; + config: { + /** @example ""form"" */ + content_type?: string; + /** @example ""0"" */ + insecure_ssl?: string; + /** @example ""********"" */ + secret?: string; + /** @example ""http://example.com/2"" */ + url?: string; + }; + /** + * @format date-time + * @example "2011-09-06T17:26:27Z" + */ + created_at: string; + /** @example ["push","pull_request"] */ + events: string[]; + /** @example 1 */ + id: number; + /** @example "web" */ + name: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" + * @example "https://api.github.com/orgs/octocat/hooks/1/pings" + */ + ping_url: string; + type: string; + /** + * @format date-time + * @example "2011-09-06T20:39:23Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/orgs/octocat/hooks/1" */ url: string; } /** - * Protected Branch Pull Request Review - * Protected Branch Pull Request Review + * Org Membership + * Org Membership */ -export interface ProtectedBranchPullRequestReview { - /** @example true */ - dismiss_stale_reviews: boolean; - dismissal_restrictions?: { - /** The list of teams with review dismissal access. */ - teams?: Team[]; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams"" */ - teams_url?: string; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions"" */ - url?: string; - /** The list of users with review dismissal access. */ - users?: SimpleUser[]; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"" */ - users_url?: string; - }; - /** @example true */ - require_code_owner_reviews: boolean; +export interface OrgMembership { + /** Organization Simple */ + organization: OrganizationSimple; /** - * @min 1 - * @max 6 - * @example 2 + * @format uri + * @example "https://api.github.com/orgs/octocat" */ - required_approving_review_count?: number; + organization_url: string; + permissions?: { + can_create_repository: boolean; + }; + /** @example "admin" */ + role: string; + /** @example "active" */ + state: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" + * @example "https://api.github.com/orgs/octocat/memberships/defunkt" */ - url?: string; + url: string; + user: SimpleUser | null; } /** - * Public User - * Public User + * Actions Secret for an Organization + * Secrets for GitHub Actions for an organization. */ -export interface PublicUser { - /** @format uri */ - avatar_url: string; - bio: string | null; - blog: string | null; - /** @example 3 */ - collaborators?: number; - company: string | null; +export interface OrganizationActionsSecret { /** @format date-time */ created_at: string; - /** @example 1 */ - disk_usage?: number; - /** @format email */ - email: string | null; + /** + * The name of the secret. + * @example "SECRET_TOKEN" + */ + name: string; + /** + * @format uri + * @example "https://api.github.com/organizations/org/secrets/my_secret/repositories" + */ + selected_repositories_url?: string; + /** @format date-time */ + updated_at: string; + /** Visibility of a secret */ + visibility: OrganizationActionsSecretVisibilityEnum; +} + +/** Visibility of a secret */ +export enum OrganizationActionsSecretVisibilityEnum { + All = "all", + Private = "private", + Selected = "selected", +} + +/** + * Organization Full + * Organization Full + */ +export interface OrganizationFull { + /** @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; + /** + * @format email + * @example "org@example.com" + */ + billing_email?: string | null; + /** + * @format uri + * @example "https://github.com/blog" + */ + blog?: string; + /** @example 8 */ + collaborators?: number | null; + /** @example "GitHub" */ + company?: string; + /** + * @format date-time + * @example "2008-01-14T04:33:35Z" + */ + created_at: string; + default_repository_permission?: string | null; + /** @example "A great organization" */ + description: string | null; + /** @example 10000 */ + disk_usage?: number | null; + /** + * @format email + * @example "octocat@github.com" + */ + email?: string; + /** + * @format uri + * @example "https://api.github.com/orgs/github/events" + */ events_url: string; + /** @example 20 */ followers: number; - /** @format uri */ - followers_url: string; + /** @example 0 */ following: number; - following_url: string; - gists_url: string; - gravatar_id: string | null; - hireable: boolean | null; - /** @format uri */ + /** @example true */ + has_organization_projects: boolean; + /** @example true */ + has_repository_projects: boolean; + /** @example "https://api.github.com/orgs/github/hooks" */ + hooks_url: string; + /** + * @format uri + * @example "https://github.com/octocat" + */ html_url: string; + /** @example 1 */ id: number; - location: string | null; + /** @example true */ + is_verified?: boolean; + /** @example "https://api.github.com/orgs/github/issues" */ + issues_url: string; + /** @example "San Francisco" */ + location?: string; + /** @example "github" */ login: string; - name: string | null; + /** @example "all" */ + members_allowed_repository_creation_type?: string; + /** @example true */ + members_can_create_internal_repositories?: boolean; + /** @example true */ + members_can_create_pages?: boolean; + /** @example true */ + members_can_create_private_repositories?: boolean; + /** @example true */ + members_can_create_public_repositories?: boolean; + /** @example true */ + members_can_create_repositories?: boolean | null; + /** @example "https://api.github.com/orgs/github/members{/member}" */ + members_url: string; + /** @example "github" */ + name?: string; + /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ node_id: string; - /** @format uri */ - organizations_url: string; - /** @example 2 */ + /** @example 100 */ owned_private_repos?: number; plan?: { - collaborators: number; + filled_seats?: number; name: string; private_repos: number; + seats?: number; space: number; }; + /** @example 81 */ + private_gists?: number | null; /** @example 1 */ - private_gists?: number; public_gists: number; + /** @example "https://api.github.com/orgs/github/public_members{/member}" */ + public_members_url: string; + /** @example 2 */ public_repos: number; - /** @format uri */ - received_events_url: string; - /** @format uri */ + /** + * @format uri + * @example "https://api.github.com/orgs/github/repos" + */ repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - /** @format date-time */ - suspended_at?: string | null; - /** @example 2 */ + /** @example 100 */ total_private_repos?: number; + /** @example "github" */ twitter_username?: string | null; + /** @example true */ + two_factor_requirement_enabled?: boolean | null; + /** @example "Organization" */ type: string; /** @format date-time */ updated_at: string; - /** @format uri */ + /** + * @format uri + * @example "https://api.github.com/orgs/github" + */ url: string; } /** - * Pull Request - * Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. + * Organization Invitation + * Organization Invitation */ -export interface PullRequest { - _links: { - /** Hypermedia Link */ - comments: Link; - /** Hypermedia Link */ - commits: Link; - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - issue: Link; - /** Hypermedia Link */ - review_comment: Link; - /** Hypermedia Link */ - review_comments: Link; - /** Hypermedia Link */ - self: Link; - /** Hypermedia Link */ - statuses: Link; - }; - /** @example "too heated" */ - active_lock_reason?: string | null; - /** @example 100 */ - additions: number; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** The status of auto merging a pull request. */ - auto_merge: AutoMerge; - base: { - label: string; - ref: string; - repo: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - /** @format uri */ - contributors_url: string; - /** @format date-time */ - created_at: string; - default_branch: string; - /** @format uri */ - deployments_url: string; - description: string | null; - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ - events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; - /** @format uri */ - hooks_url: string; - /** @format uri */ - html_url: string; - id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; - node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - size: number; - ssh_url: string; - stargazers_count: number; - /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; - /** @format uri */ - subscription_url: string; - /** @format uri */ - svn_url: string; - /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - topics?: string[]; - trees_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - watchers: number; - watchers_count: number; - }; - sha: string; - user: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - }; - /** @example "Please pull these awesome changes" */ - body: string | null; - /** @example 5 */ - changed_files: number; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - closed_at: string | null; - /** @example 10 */ - comments: number; +export interface OrganizationInvitation { + created_at: string; + email: string | null; + failed_at?: string; + failed_reason?: string; + id: number; + invitation_team_url: string; + /** @example ""https://api.github.com/organizations/16/invitations/1/teams"" */ + invitation_teams_url?: string; + /** Simple User */ + inviter: SimpleUser; + login: string | null; + /** @example ""MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x"" */ + node_id: string; + role: string; + team_count: number; +} + +/** + * Organization Simple + * Organization Simple + */ +export interface OrganizationSimple { + /** @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; + /** @example "A great organization" */ + description: string | null; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + * @example "https://api.github.com/orgs/github/events" */ - comments_url: string; - /** @example 3 */ - commits: number; + events_url: string; + /** @example "https://api.github.com/orgs/github/hooks" */ + hooks_url: string; + /** @example 1 */ + id: number; + /** @example "https://api.github.com/orgs/github/issues" */ + issues_url: string; + /** @example "github" */ + login: string; + /** @example "https://api.github.com/orgs/github/members{/member}" */ + members_url: string; + /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ + node_id: string; + /** @example "https://api.github.com/orgs/github/public_members{/member}" */ + public_members_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" - */ - commits_url: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * @example "https://api.github.com/orgs/github/repos" */ - created_at: string; - /** @example 3 */ - deletions: number; + repos_url: string; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + * @example "https://api.github.com/orgs/github" */ - diff_url: string; + url: string; +} + +export type OrgsBlockUserData = any; + +export interface OrgsBlockUserParams { + org: string; + username: string; +} + +export type OrgsCancelInvitationData = any; + +export interface OrgsCancelInvitationParams { + /** invitation_id parameter */ + invitationId: number; + org: string; +} + +export type OrgsCheckBlockedUserData = any; + +export type OrgsCheckBlockedUserError = BasicError; + +export interface OrgsCheckBlockedUserParams { + org: string; + username: string; +} + +export type OrgsCheckMembershipForUserData = any; + +export interface OrgsCheckMembershipForUserParams { + org: string; + username: string; +} + +export type OrgsCheckPublicMembershipForUserData = any; + +export interface OrgsCheckPublicMembershipForUserParams { + org: string; + username: string; +} + +export type OrgsConvertMemberToOutsideCollaboratorData = any; + +export type OrgsConvertMemberToOutsideCollaboratorError = { + documentation_url?: string; + message?: string; +}; + +export interface OrgsConvertMemberToOutsideCollaboratorParams { + org: string; + username: string; +} + +export type OrgsCreateInvitationData = OrganizationInvitation; + +export interface OrgsCreateInvitationParams { + org: string; +} + +export interface OrgsCreateInvitationPayload { + /** **Required unless you provide \`invitee_id\`**. Email address of the person you are inviting, which can be an existing GitHub user. */ + email?: string; + /** **Required unless you provide \`email\`**. GitHub user ID for the person you are inviting. */ + invitee_id?: number; /** - * Indicates whether or not the pull request is a draft. - * @example false + * Specify role for new member. Can be one of: + * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. + * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. + * @default "direct_member" */ - draft?: boolean; - head: { - label: string; - ref: string; - repo: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - /** @format uri */ - contributors_url: string; - /** @format date-time */ - created_at: string; - default_branch: string; - /** @format uri */ - deployments_url: string; - description: string | null; - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ - events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; - /** @format uri */ - hooks_url: string; - /** @format uri */ - html_url: string; - id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: { - key: string; - name: string; - node_id: string; - spdx_id: string | null; - /** @format uri */ - url: string | null; - } | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; - node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - size: number; - ssh_url: string; - stargazers_count: number; - /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; - /** @format uri */ - subscription_url: string; - /** @format uri */ - svn_url: string; - /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - topics?: string[]; - trees_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - watchers: number; - watchers_count: number; - }; - sha: string; - user: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; + role?: OrgsCreateInvitationRoleEnum; + /** Specify IDs for the teams you want to invite new members to. */ + team_ids?: number[]; +} + +/** + * Specify role for new member. Can be one of: + * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. + * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. + * @default "direct_member" + */ +export enum OrgsCreateInvitationRoleEnum { + Admin = "admin", + DirectMember = "direct_member", + BillingManager = "billing_manager", +} + +export type OrgsCreateWebhookData = OrgHook; + +export interface OrgsCreateWebhookParams { + org: string; +} + +export interface OrgsCreateWebhookPayload { + /** + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true + */ + active?: boolean; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ + config: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""password"" */ + password?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + /** @example ""kdaigle"" */ + username?: string; }; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347" + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] */ - html_url: string; - /** @example 1 */ - id: number; + events?: string[]; + /** Must be passed as "web". */ + name: string; +} + +export type OrgsDeleteWebhookData = any; + +export interface OrgsDeleteWebhookParams { + hookId: number; + org: string; +} + +export type OrgsGetAuditLogData = AuditLogEvent[]; + +export interface OrgsGetAuditLogParams { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. */ - issue_url: string; - labels: { - color?: string; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; - /** @example true */ - locked: boolean; + include?: IncludeEnum1; /** - * Indicates whether maintainers can modify the pull request. - * @example true + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ - maintainer_can_modify: boolean; - /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ - merge_commit_sha: string | null; - /** @example true */ - mergeable: boolean | null; - /** @example "clean" */ - mergeable_state: string; - merged: boolean; + order?: OrderEnum1; + org: string; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * Results per page (max 100) + * @default 30 */ - merged_at: string | null; - merged_by: SimpleUser | null; - milestone: Milestone | null; - /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ - node_id: string; + per_page?: number; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; +} + +/** + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. + */ +export enum OrgsGetAuditLogParams1IncludeEnum { + Web = "web", + Git = "git", + All = "all", +} + +/** + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. + */ +export enum OrgsGetAuditLogParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} + +export type OrgsGetData = OrganizationFull; + +export type OrgsGetMembershipForAuthenticatedUserData = OrgMembership; + +export interface OrgsGetMembershipForAuthenticatedUserParams { + org: string; +} + +export type OrgsGetMembershipForUserData = OrgMembership; + +export interface OrgsGetMembershipForUserParams { + org: string; + username: string; +} + +export interface OrgsGetParams { + org: string; +} + +export type OrgsGetWebhookConfigForOrgData = WebhookConfig; + +export interface OrgsGetWebhookConfigForOrgParams { + hookId: number; + org: string; +} + +export type OrgsGetWebhookData = OrgHook; + +export interface OrgsGetWebhookParams { + hookId: number; + org: string; +} + +export interface OrgsListAppInstallationsData { + installations: Installation[]; + total_count: number; +} + +export interface OrgsListAppInstallationsParams { + org: string; /** - * Number uniquely identifying the pull request within its repository. - * @example 42 + * Page number of the results to fetch. + * @default 1 */ - number: number; + page?: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + * Results per page (max 100) + * @default 30 */ - patch_url: string; - /** @example true */ - rebaseable?: boolean | null; - requested_reviewers?: SimpleUser[] | null; - requested_teams?: TeamSimple[] | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ - review_comment_url: string; - /** @example 0 */ - review_comments: number; + per_page?: number; +} + +export type OrgsListBlockedUsersData = SimpleUser[]; + +export interface OrgsListBlockedUsersParams { + org: string; +} + +export type OrgsListData = OrganizationSimple[]; + +export type OrgsListFailedInvitationsData = OrganizationInvitation[]; + +export interface OrgsListFailedInvitationsParams { + org: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + * Page number of the results to fetch. + * @default 1 */ - review_comments_url: string; + page?: number; /** - * State of this Pull Request. Either \`open\` or \`closed\`. - * @example "open" + * Results per page (max 100) + * @default 30 */ - state: PullRequestStateEnum; + per_page?: number; +} + +export type OrgsListForAuthenticatedUserData = OrganizationSimple[]; + +export interface OrgsListForAuthenticatedUserParams { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * Page number of the results to fetch. + * @default 1 */ - statuses_url: string; + page?: number; /** - * The title of the pull request. - * @example "Amazing new feature" + * Results per page (max 100) + * @default 30 */ - title: string; + per_page?: number; +} + +export type OrgsListForUserData = OrganizationSimple[]; + +export interface OrgsListForUserParams { /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * Page number of the results to fetch. + * @default 1 */ - updated_at: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + * Results per page (max 100) + * @default 30 */ - url: string; - user: SimpleUser | null; -} - -/** - * Pull Request Merge Result - * Pull Request Merge Result - */ -export interface PullRequestMergeResult { - merged: boolean; - message: string; - sha: string; + per_page?: number; + username: string; } -/** Pull Request Minimal */ -export interface PullRequestMinimal { - base: { - ref: string; - repo: { - id: number; - name: string; - url: string; - }; - sha: string; - }; - head: { - ref: string; - repo: { - id: number; - name: string; - url: string; - }; - sha: string; - }; - id: number; - number: number; - url: string; -} +export type OrgsListInvitationTeamsData = Team[]; -/** - * Pull Request Review - * Pull Request Reviews are reviews on pull requests. - */ -export interface PullRequestReview { - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; +export interface OrgsListInvitationTeamsParams { + /** invitation_id parameter */ + invitationId: number; + org: string; /** - * The text of the review. - * @example "This looks great." + * Page number of the results to fetch. + * @default 1 */ - body: string; - body_html?: string; - body_text?: string; + page?: number; /** - * A commit SHA for the review. - * @example "54bb654c9e6025347f57900a4a5c2313a96b8035" + * Results per page (max 100) + * @default 30 */ - commit_id: string; + per_page?: number; +} + +export type OrgsListMembersData = SimpleUser[]; + +export interface OrgsListMembersParams { /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" + * Filter members returned in the list. Can be one of: + * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \\* \`all\` - All members the authenticated user can see. + * @default "all" */ - html_url: string; - /** - * Unique identifier of the review - * @example 42 - */ - id: number; - /** @example "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" */ - node_id: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/12" - */ - pull_request_url: string; - /** @example "CHANGES_REQUESTED" */ - state: string; - /** @format date-time */ - submitted_at?: string; - user: SimpleUser | null; -} - -/** - * Pull Request Review Comment - * Pull Request Review Comments are comments on a portion of the Pull Request's diff. - */ -export interface PullRequestReviewComment { - _links: { - html: { - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" - */ - href: string; - }; - pull_request: { - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" - */ - href: string; - }; - self: { - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" - */ - href: string; - }; - }; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** - * The text of the comment. - * @example "We should probably include a check for null values here." - */ - body: string; - /** @example ""

comment body

"" */ - body_html?: string; - /** @example ""comment body"" */ - body_text?: string; - /** - * The SHA of the commit to which the comment applies. - * @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - commit_id: string; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - created_at: string; - /** - * The diff of the line that the comment refers to. - * @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." - */ - diff_hunk: string; - /** - * HTML URL for the pull request review comment. - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" - */ - html_url: string; - /** - * The ID of the pull request review comment. - * @example 1 - */ - id: number; - /** - * The comment ID to reply to. - * @example 8 - */ - in_reply_to_id?: number; - /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - line?: number; - /** - * The node ID of the pull request review comment. - * @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" - */ - node_id: string; - /** - * The SHA of the original commit to which the comment applies. - * @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" - */ - original_commit_id: string; - /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - original_line?: number; - /** - * The index of the original line in the diff to which the comment applies. - * @example 4 - */ - original_position: number; - /** - * The first line of the range for a multi-line comment. - * @example 2 - */ - original_start_line?: number | null; - /** - * The relative path of the file to which the comment applies. - * @example "config/database.yaml" - */ - path: string; - /** - * The line index in the diff to which the comment applies. - * @example 1 - */ - position: number; - /** - * The ID of the pull request review to which the comment belongs. - * @example 42 - */ - pull_request_review_id: number | null; - /** - * URL for the pull request that the review comment belongs to. - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" - */ - pull_request_url: string; - reactions?: ReactionRollup; - /** - * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - * @default "RIGHT" - */ - side?: PullRequestReviewCommentSideEnum; - /** - * The first line of the range for a multi-line comment. - * @example 2 - */ - start_line?: number | null; + filter?: FilterEnum2; + org: string; /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * Page number of the results to fetch. + * @default 1 */ - start_side?: PullRequestReviewCommentStartSideEnum | null; + page?: number; /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * Results per page (max 100) + * @default 30 */ - updated_at: string; + per_page?: number; /** - * URL for the pull request review comment - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + * Filter members returned by their role. Can be one of: + * \\* \`all\` - All members of the organization, regardless of role. + * \\* \`admin\` - Organization owners. + * \\* \`member\` - Non-owner organization members. + * @default "all" */ - url: string; - /** Simple User */ - user: SimpleUser; + role?: RoleEnum; } /** - * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - * @default "RIGHT" + * Filter members returned in the list. Can be one of: + * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \\* \`all\` - All members the authenticated user can see. + * @default "all" */ -export enum PullRequestReviewCommentSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +export enum OrgsListMembersParams1FilterEnum { + Value2FaDisabled = "2fa_disabled", + All = "all", } /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * Filter members returned by their role. Can be one of: + * \\* \`all\` - All members of the organization, regardless of role. + * \\* \`admin\` - Organization owners. + * \\* \`member\` - Non-owner organization members. + * @default "all" */ -export enum PullRequestReviewCommentStartSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +export enum OrgsListMembersParams1RoleEnum { + All = "all", + Admin = "admin", + Member = "member", } -/** - * Pull Request Review Request - * Pull Request Review Request - */ -export interface PullRequestReviewRequest { - teams: TeamSimple[]; - users: SimpleUser[]; -} +export type OrgsListMembershipsForAuthenticatedUserData = OrgMembership[]; -/** - * Pull Request Simple - * Pull Request Simple - */ -export interface PullRequestSimple { - _links: { - /** Hypermedia Link */ - comments: Link; - /** Hypermedia Link */ - commits: Link; - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - issue: Link; - /** Hypermedia Link */ - review_comment: Link; - /** Hypermedia Link */ - review_comments: Link; - /** Hypermedia Link */ - self: Link; - /** Hypermedia Link */ - statuses: Link; - }; - /** @example "too heated" */ - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** The status of auto merging a pull request. */ - auto_merge: AutoMerge; - base: { - label: string; - ref: string; - /** A git repository */ - repo: Repository; - sha: string; - user: SimpleUser | null; - }; - /** @example "Please pull these awesome changes" */ - body: string | null; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - closed_at: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" - */ - comments_url: string; +export interface OrgsListMembershipsForAuthenticatedUserParams { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + * Page number of the results to fetch. + * @default 1 */ - commits_url: string; + page?: number; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * Results per page (max 100) + * @default 30 */ - created_at: string; + per_page?: number; + /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ + state?: StateEnum9; +} + +/** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ +export enum OrgsListMembershipsForAuthenticatedUserParams1StateEnum { + Active = "active", + Pending = "pending", +} + +export type OrgsListOutsideCollaboratorsData = SimpleUser[]; + +export interface OrgsListOutsideCollaboratorsParams { /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + * Filter the list of outside collaborators. Can be one of: + * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \\* \`all\`: All outside collaborators. + * @default "all" */ - diff_url: string; + filter?: FilterEnum3; + org: string; /** - * Indicates whether or not the pull request is a draft. - * @example false + * Page number of the results to fetch. + * @default 1 */ - draft?: boolean; - head: { - label: string; - ref: string; - /** A git repository */ - repo: Repository; - sha: string; - user: SimpleUser | null; - }; + page?: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347" + * Results per page (max 100) + * @default 30 */ - html_url: string; - /** @example 1 */ - id: number; + per_page?: number; +} + +/** + * Filter the list of outside collaborators. Can be one of: + * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \\* \`all\`: All outside collaborators. + * @default "all" + */ +export enum OrgsListOutsideCollaboratorsParams1FilterEnum { + Value2FaDisabled = "2fa_disabled", + All = "all", +} + +export interface OrgsListParams { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" + * Results per page (max 100) + * @default 30 */ - issue_url: string; - labels: { - color?: string; - default?: boolean; - description?: string; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; - /** @example true */ - locked: boolean; - /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ - merge_commit_sha: string | null; + per_page?: number; + /** An organization ID. Only return organizations with an ID greater than this ID. */ + since?: number; +} + +export type OrgsListPendingInvitationsData = OrganizationInvitation[]; + +export interface OrgsListPendingInvitationsParams { + org: string; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * Page number of the results to fetch. + * @default 1 */ - merged_at: string | null; - milestone: Milestone | null; - /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ - node_id: string; - /** @example 1347 */ - number: number; + page?: number; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + * Results per page (max 100) + * @default 30 */ - patch_url: string; - requested_reviewers?: SimpleUser[] | null; - requested_teams?: TeamSimple[] | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ - review_comment_url: string; + per_page?: number; +} + +export type OrgsListPublicMembersData = SimpleUser[]; + +export interface OrgsListPublicMembersParams { + org: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + * Page number of the results to fetch. + * @default 1 */ - review_comments_url: string; - /** @example "open" */ - state: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * Results per page (max 100) + * @default 30 */ - statuses_url: string; - /** @example "new-feature" */ - title: string; + per_page?: number; +} + +export type OrgsListSamlSsoAuthorizationsData = CredentialAuthorization[]; + +export interface OrgsListSamlSsoAuthorizationsParams { + org: string; +} + +export type OrgsListWebhooksData = OrgHook[]; + +export interface OrgsListWebhooksParams { + org: string; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * Page number of the results to fetch. + * @default 1 */ - updated_at: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + * Results per page (max 100) + * @default 30 */ - url: string; - user: SimpleUser | null; + per_page?: number; } -/** - * State of this Pull Request. Either \`open\` or \`closed\`. - * @example "open" - */ -export enum PullRequestStateEnum { - Open = "open", - Closed = "closed", +export type OrgsPingWebhookData = any; + +export interface OrgsPingWebhookParams { + hookId: number; + org: string; } -export type PullsCheckIfMergedData = any; +export type OrgsRemoveMemberData = any; -export interface PullsCheckIfMergedParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsRemoveMemberParams { + org: string; + username: string; } -export type PullsCreateData = PullRequest; +export type OrgsRemoveMembershipForUserData = any; -export interface PullsCreateParams { - owner: string; - repo: string; +export interface OrgsRemoveMembershipForUserParams { + org: string; + username: string; } -export interface PullsCreatePayload { - /** The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ - base: string; - /** The contents of the pull request. */ - body?: string; - /** Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ - draft?: boolean; - /** The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace \`head\` with a user like this: \`username:branch\`. */ - head: string; - /** @example 1 */ - issue?: number; - /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ - maintainer_can_modify?: boolean; - /** The title of the new pull request. */ - title?: string; +export type OrgsRemoveOutsideCollaboratorData = any; + +export type OrgsRemoveOutsideCollaboratorError = { + documentation_url?: string; + message?: string; +}; + +export interface OrgsRemoveOutsideCollaboratorParams { + org: string; + username: string; } -export type PullsCreateReplyForReviewCommentData = PullRequestReviewComment; +export type OrgsRemovePublicMembershipForAuthenticatedUserData = any; -export interface PullsCreateReplyForReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - pullNumber: number; - repo: string; +export interface OrgsRemovePublicMembershipForAuthenticatedUserParams { + org: string; + username: string; } -export interface PullsCreateReplyForReviewCommentPayload { - /** The text of the review comment. */ - body: string; +export type OrgsRemoveSamlSsoAuthorizationData = any; + +export interface OrgsRemoveSamlSsoAuthorizationParams { + credentialId: number; + org: string; } -export type PullsCreateReviewCommentData = PullRequestReviewComment; +export type OrgsSetMembershipForUserData = OrgMembership; -export interface PullsCreateReviewCommentParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsSetMembershipForUserParams { + org: string; + username: string; } -export interface PullsCreateReviewCommentPayload { - /** The text of the review comment. */ - body: string; - /** The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the \`position\`. */ - commit_id?: string; - /** @example 2 */ - in_reply_to?: number; - /** **Required with \`comfort-fade\` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ - line?: number; - /** The relative path to the file that necessitates a comment. */ - path: string; - /** **Required without \`comfort-fade\` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ - position?: number; - /** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ - side?: PullsCreateReviewCommentSideEnum; - /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_line\` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ - start_line?: number; - /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ - start_side?: PullsCreateReviewCommentStartSideEnum; -} - -/** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ -export enum PullsCreateReviewCommentSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +export interface OrgsSetMembershipForUserPayload { + /** + * The role to give the user in the organization. Can be one of: + * \\* \`admin\` - The user will become an owner of the organization. + * \\* \`member\` - The user will become a non-owner member of the organization. + * @default "member" + */ + role?: OrgsSetMembershipForUserRoleEnum; } -/** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ -export enum PullsCreateReviewCommentStartSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", - Side = "side", +/** + * The role to give the user in the organization. Can be one of: + * \\* \`admin\` - The user will become an owner of the organization. + * \\* \`member\` - The user will become a non-owner member of the organization. + * @default "member" + */ +export enum OrgsSetMembershipForUserRoleEnum { + Admin = "admin", + Member = "member", } -export type PullsCreateReviewData = PullRequestReview; +export type OrgsSetPublicMembershipForAuthenticatedUserData = any; -/** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ -export enum PullsCreateReviewEventEnum { - APPROVE = "APPROVE", - REQUEST_CHANGES = "REQUEST_CHANGES", - COMMENT = "COMMENT", +export interface OrgsSetPublicMembershipForAuthenticatedUserParams { + org: string; + username: string; } -export interface PullsCreateReviewParams { - owner: string; - pullNumber: number; - repo: string; -} +export type OrgsUnblockUserData = any; -export interface PullsCreateReviewPayload { - /** **Required** when using \`REQUEST_CHANGES\` or \`COMMENT\` for the \`event\` parameter. The body text of the pull request review. */ - body?: string; - /** Use the following table to specify the location, destination, and contents of the draft review comment. */ - comments?: { - /** Text of the review comment. */ - body: string; - /** @example 28 */ - line?: number; - /** The relative path to the file that necessitates a review comment. */ - path: string; - /** The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ - position?: number; - /** @example "RIGHT" */ - side?: string; - /** @example 26 */ - start_line?: number; - /** @example "LEFT" */ - start_side?: string; - }[]; - /** The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the \`position\`. Defaults to the most recent commit in the pull request when you do not specify a value. */ - commit_id?: string; - /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ - event?: PullsCreateReviewEventEnum; +export interface OrgsUnblockUserParams { + org: string; + username: string; } -export type PullsDeletePendingReviewData = PullRequestReview; +export type OrgsUpdateData = OrganizationFull; -export interface PullsDeletePendingReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +/** + * Default permission level members have for organization repositories: + * \\* \`read\` - can pull, but not push to or administer this repository. + * \\* \`write\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push, and administer this repository. + * \\* \`none\` - no permissions granted by default. + * @default "read" + */ +export enum OrgsUpdateDefaultRepositoryPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", + None = "none", } -export type PullsDeleteReviewCommentData = any; +export type OrgsUpdateError = ValidationError | ValidationErrorSimple; -export interface PullsDeleteReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +/** + * Specifies which types of repositories non-admin organization members can create. Can be one of: + * \\* \`all\` - all organization members can create public and private repositories. + * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + * \\* \`none\` - only admin members can create repositories. + * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. + */ +export enum OrgsUpdateMembersAllowedRepositoryCreationTypeEnum { + All = "all", + Private = "private", + None = "none", } -export type PullsDismissReviewData = PullRequestReview; - -export interface PullsDismissReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; -} +export type OrgsUpdateMembershipForAuthenticatedUserData = OrgMembership; -export interface PullsDismissReviewPayload { - /** @example ""APPROVE"" */ - event?: string; - /** The message for the pull request review dismissal */ - message: string; +export interface OrgsUpdateMembershipForAuthenticatedUserParams { + org: string; } -export type PullsGetData = PullRequest; - -export interface PullsGetParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsUpdateMembershipForAuthenticatedUserPayload { + /** The state that the membership should be in. Only \`"active"\` will be accepted. */ + state: OrgsUpdateMembershipForAuthenticatedUserStateEnum; } -export type PullsGetReviewCommentData = PullRequestReviewComment; - -export interface PullsGetReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +/** The state that the membership should be in. Only \`"active"\` will be accepted. */ +export enum OrgsUpdateMembershipForAuthenticatedUserStateEnum { + Active = "active", } -export type PullsGetReviewData = PullRequestReview; - -export interface PullsGetReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +export interface OrgsUpdateParams { + org: string; } -export type PullsListCommentsForReviewData = ReviewComment[]; - -export interface PullsListCommentsForReviewParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export interface OrgsUpdatePayload { + /** Billing email address. This address is not publicized. */ + billing_email?: string; + /** @example ""http://github.blog"" */ + blog?: string; + /** The company name. */ + company?: string; /** - * Results per page (max 100) - * @default 30 + * Default permission level members have for organization repositories: + * \\* \`read\` - can pull, but not push to or administer this repository. + * \\* \`write\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push, and administer this repository. + * \\* \`none\` - no permissions granted by default. + * @default "read" */ - per_page?: number; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; -} - -export type PullsListCommitsData = Commit[]; - -export interface PullsListCommitsParams { - owner: string; + default_repository_permission?: OrgsUpdateDefaultRepositoryPermissionEnum; + /** The description of the company. */ + description?: string; + /** The publicly visible email address. */ + email?: string; + /** Toggles whether an organization can use organization projects. */ + has_organization_projects?: boolean; + /** Toggles whether repositories that belong to the organization can use repository projects. */ + has_repository_projects?: boolean; + /** The location. */ + location?: string; /** - * Page number of the results to fetch. - * @default 1 + * Specifies which types of repositories non-admin organization members can create. Can be one of: + * \\* \`all\` - all organization members can create public and private repositories. + * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + * \\* \`none\` - only admin members can create repositories. + * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. */ - page?: number; + members_allowed_repository_creation_type?: OrgsUpdateMembersAllowedRepositoryCreationTypeEnum; /** - * Results per page (max 100) - * @default 30 + * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: + * \\* \`true\` - all organization members can create internal repositories. + * \\* \`false\` - only organization owners can create internal repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ - per_page?: number; - pullNumber: number; - repo: string; -} - -export type PullsListData = PullRequestSimple[]; - -export type PullsListFilesData = DiffEntry[]; - -export interface PullsListFilesParams { - owner: string; + members_can_create_internal_repositories?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Toggles whether organization members can create GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create GitHub Pages sites. + * \\* \`false\` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. + * @default true */ - page?: number; + members_can_create_pages?: boolean; /** - * Results per page (max 100) - * @default 30 + * Toggles whether organization members can create private GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create private GitHub Pages sites. + * \\* \`false\` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + * @default true */ - per_page?: number; - pullNumber: number; - repo: string; -} - -export interface PullsListParams { - /** Filter pulls by base branch name. Example: \`gh-pages\`. */ - base?: string; - /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ - direction?: DirectionEnum10; - /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ - head?: string; - owner: string; + members_can_create_private_pages?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: + * \\* \`true\` - all organization members can create private repositories. + * \\* \`false\` - only organization owners can create private repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ - page?: number; + members_can_create_private_repositories?: boolean; /** - * Results per page (max 100) - * @default 30 + * Toggles whether organization members can create public GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create public GitHub Pages sites. + * \\* \`false\` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + * @default true */ - per_page?: number; - repo: string; + members_can_create_public_pages?: boolean; /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). - * @default "created" + * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: + * \\* \`true\` - all organization members can create public repositories. + * \\* \`false\` - only organization owners can create public repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ - sort?: SortEnum9; + members_can_create_public_repositories?: boolean; /** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" + * Toggles the ability of non-admin organization members to create repositories. Can be one of: + * \\* \`true\` - all organization members can create repositories. + * \\* \`false\` - only organization owners can create repositories. + * Default: \`true\` + * **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. + * @default true */ - state?: StateEnum6; + members_can_create_repositories?: boolean; + /** The shorthand name of the company. */ + name?: string; + /** The Twitter username of the company. */ + twitter_username?: string; } -/** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ -export enum PullsListParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} +export type OrgsUpdateWebhookConfigForOrgData = WebhookConfig; -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). - * @default "created" - */ -export enum PullsListParams1SortEnum { - Created = "created", - Updated = "updated", - Popularity = "popularity", - LongRunning = "long-running", +export interface OrgsUpdateWebhookConfigForOrgParams { + hookId: number; + org: string; } -/** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ -export enum PullsListParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", +/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ +export interface OrgsUpdateWebhookConfigForOrgPayload { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; } -export type PullsListRequestedReviewersData = PullRequestReviewRequest; +export type OrgsUpdateWebhookData = OrgHook; -export interface PullsListRequestedReviewersParams { - owner: string; +export interface OrgsUpdateWebhookParams { + hookId: number; + org: string; +} + +export interface OrgsUpdateWebhookPayload { /** - * Page number of the results to fetch. - * @default 1 + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - page?: number; + active?: boolean; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ + config?: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + }; /** - * Results per page (max 100) - * @default 30 + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] */ - per_page?: number; - pullNumber: number; - repo: string; + events?: string[]; + /** @example ""web"" */ + name?: string; } -export type PullsListReviewCommentsData = PullRequestReviewComment[]; - -export type PullsListReviewCommentsForRepoData = PullRequestReviewComment[]; +export interface PackagesBillingUsage { + /** Free storage space (GB) for GitHub Packages. */ + included_gigabytes_bandwidth: number; + /** Sum of the free and paid storage space (GB) for GitHuub Packages. */ + total_gigabytes_bandwidth_used: number; + /** Total paid storage space (GB) for GitHuub Packages. */ + total_paid_gigabytes_bandwidth_used: number; +} -export interface PullsListReviewCommentsForRepoParams { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: DirectionEnum11; - owner: string; +/** + * GitHub Pages + * The configuration for GitHub Pages for a repository. + */ +export interface Page { /** - * Page number of the results to fetch. - * @default 1 + * Whether the Page has a custom 404 page. + * @default false + * @example false */ - page?: number; + custom_404: boolean; /** - * Results per page (max 100) - * @default 30 + * The Pages site's custom domain + * @example "example.com" */ - per_page?: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + cname: string | null; /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * The web address the Page can be accessed from. + * @format uri + * @example "https://example.com" */ - sort?: SortEnum10; -} - -/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ -export enum PullsListReviewCommentsForRepoParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum PullsListReviewCommentsForRepoParams1SortEnum { - Created = "created", - Updated = "updated", -} - -export interface PullsListReviewCommentsParams { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: DirectionEnum12; - owner: string; + html_url?: string; /** - * Page number of the results to fetch. - * @default 1 + * Whether the GitHub Pages site is publicly visible. If set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. + * @example true */ - page?: number; + public: boolean; + source?: PagesSourceHash; /** - * Results per page (max 100) - * @default 30 + * The status of the most recent build of the Page. + * @example "built" */ - per_page?: number; - pullNumber: number; - repo: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + status: PageStatusEnum | null; /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * The API address for accessing this Page resource. + * @format uri + * @example "https://api.github.com/repos/github/hello-world/pages" */ - sort?: SortEnum11; + url: string; } -/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ -export enum PullsListReviewCommentsParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +/** + * Page Build + * Page Build + */ +export interface PageBuild { + commit: string; + /** @format date-time */ + created_at: string; + duration: number; + error: { + message: string | null; + }; + pusher: SimpleUser | null; + status: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; } /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Page Build Status + * Page Build Status */ -export enum PullsListReviewCommentsParams1SortEnum { - Created = "created", - Updated = "updated", +export interface PageBuildStatus { + /** @example "queued" */ + status: string; + /** + * @format uri + * @example "https://api.github.com/repos/github/hello-world/pages/builds/latest" + */ + url: string; } -export type PullsListReviewsData = PullRequestReview[]; - -export interface PullsListReviewsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - pullNumber: number; - repo: string; -} - -export type PullsMergeData = PullRequestMergeResult; - -export type PullsMergeError = { - documentation_url?: string; - message?: string; -}; - -/** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ -export enum PullsMergeMergeMethodEnum { - Merge = "merge", - Squash = "squash", - Rebase = "rebase", -} - -export interface PullsMergeParams { - owner: string; - pullNumber: number; - repo: string; -} - -export type PullsMergePayload = { - /** Extra detail to append to automatic commit message. */ - commit_message?: string; - /** Title for the automatic commit message. */ - commit_title?: string; - /** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ - merge_method?: PullsMergeMergeMethodEnum; - /** SHA that pull request head must match to allow merge. */ - sha?: string; -} | null; - -export type PullsRemoveRequestedReviewersData = any; - -export interface PullsRemoveRequestedReviewersParams { - owner: string; - pullNumber: number; - repo: string; -} - -export interface PullsRemoveRequestedReviewersPayload { - /** An array of user \`login\`s that will be removed. */ - reviewers?: string[]; - /** An array of team \`slug\`s that will be removed. */ - team_reviewers?: string[]; -} - -export type PullsRequestReviewersData = PullRequestSimple; - -export interface PullsRequestReviewersParams { - owner: string; - pullNumber: number; - repo: string; -} - -export interface PullsRequestReviewersPayload { - /** An array of user \`login\`s that will be requested. */ - reviewers?: string[]; - /** An array of team \`slug\`s that will be requested. */ - team_reviewers?: string[]; -} - -export type PullsSubmitReviewData = PullRequestReview; - -/** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ -export enum PullsSubmitReviewEventEnum { - APPROVE = "APPROVE", - REQUEST_CHANGES = "REQUEST_CHANGES", - COMMENT = "COMMENT", -} - -export interface PullsSubmitReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; -} - -export interface PullsSubmitReviewPayload { - /** The body text of the pull request review */ - body?: string; - /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ - event: PullsSubmitReviewEventEnum; -} - -export interface PullsUpdateBranchData { - message?: string; - url?: string; -} - -export interface PullsUpdateBranchParams { - owner: string; - pullNumber: number; - repo: string; -} - -export type PullsUpdateBranchPayload = { - /** The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a \`422 Unprocessable Entity\` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ - expected_head_sha?: string; -} | null; - -export type PullsUpdateData = PullRequest; - -export interface PullsUpdateParams { - owner: string; - pullNumber: number; - repo: string; +/** + * The status of the most recent build of the Page. + * @example "built" + */ +export enum PageStatusEnum { + Built = "built", + Building = "building", + Errored = "errored", } -export interface PullsUpdatePayload { - /** The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ - base?: string; - /** The contents of the pull request. */ - body?: string; - /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ - maintainer_can_modify?: boolean; - /** State of this Pull Request. Either \`open\` or \`closed\`. */ - state?: PullsUpdateStateEnum; - /** The title of the pull request. */ - title?: string; +/** Pages Source Hash */ +export interface PagesSourceHash { + branch: string; + path: string; } -export type PullsUpdateReviewCommentData = PullRequestReviewComment; - -export interface PullsUpdateReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +/** Participation Stats */ +export interface ParticipationStats { + all: number[]; + owner: number[]; } -export interface PullsUpdateReviewCommentPayload { - /** The text of the reply to the review comment. */ - body: string; +/** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ +export enum PerEnum { + Day = "day", + Week = "week", } -export type PullsUpdateReviewData = PullRequestReview; - -export interface PullsUpdateReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +/** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ +export enum PerEnum1 { + Day = "day", + Week = "week", } -export interface PullsUpdateReviewPayload { - /** The body text of the pull request review. */ - body: string; +/** + * Porter Author + * Porter Author + */ +export interface PorterAuthor { + email: string; + id: number; + /** @format uri */ + import_url: string; + name: string; + remote_id: string; + remote_name: string; + /** @format uri */ + url: string; } -/** State of this Pull Request. Either \`open\` or \`closed\`. */ -export enum PullsUpdateStateEnum { - Open = "open", - Closed = "closed", +/** + * Porter Large File + * Porter Large File + */ +export interface PorterLargeFile { + oid: string; + path: string; + ref_name: string; + size: number; } -/** Rate Limit */ -export interface RateLimit { - limit: number; - remaining: number; - reset: number; +/** Preview Header Missing */ +export interface PreviewHeaderMissing { + documentation_url: string; + message: string; } -export type RateLimitGetData = RateLimitOverview; - /** - * Rate Limit Overview - * Rate Limit Overview + * Private User + * Private User */ -export interface RateLimitOverview { - rate: RateLimit; - resources: { - code_scanning_upload?: RateLimit; - core: RateLimit; - graphql?: RateLimit; - integration_manifest?: RateLimit; - search: RateLimit; - source_import?: RateLimit; +export interface PrivateUser { + /** + * @format uri + * @example "https://github.com/images/error/octocat_happy.gif" + */ + avatar_url: string; + /** @example "There once was..." */ + bio: string | null; + /** @example "https://github.com/blog" */ + blog: string | null; + business_plus?: boolean; + /** @example 8 */ + collaborators: number; + /** @example "GitHub" */ + company: string | null; + /** + * @format date-time + * @example "2008-01-14T04:33:35Z" + */ + created_at: string; + /** @example 10000 */ + disk_usage: number; + /** + * @format email + * @example "octocat@github.com" + */ + email: string | null; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; + /** @example 20 */ + followers: number; + /** + * @format uri + * @example "https://api.github.com/users/octocat/followers" + */ + followers_url: string; + /** @example 0 */ + following: number; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; + hireable: boolean | null; + /** + * @format uri + * @example "https://github.com/octocat" + */ + html_url: string; + /** @example 1 */ + id: number; + ldap_dn?: string; + /** @example "San Francisco" */ + location: string | null; + /** @example "octocat" */ + login: string; + /** @example "monalisa octocat" */ + name: string | null; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/orgs" + */ + organizations_url: string; + /** @example 100 */ + owned_private_repos: number; + plan?: { + collaborators: number; + name: string; + private_repos: number; + space: number; }; + /** @example 81 */ + private_gists: number; + /** @example 1 */ + public_gists: number; + /** @example 2 */ + public_repos: number; + /** + * @format uri + * @example "https://api.github.com/users/octocat/received_events" + */ + received_events_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/repos" + */ + repos_url: string; + site_admin: boolean; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/subscriptions" + */ + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + /** @example 100 */ + total_private_repos: number; + /** @example "monalisa" */ + twitter_username?: string | null; + /** @example true */ + two_factor_authentication: boolean; + /** @example "User" */ + type: string; + /** + * @format date-time + * @example "2008-01-14T04:33:35Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat" + */ + url: string; } /** - * Reaction - * Reactions to conversations provide a way to help people express their feelings more simply and effectively. + * Project + * Projects are a way to organize columns and cards of work. */ -export interface Reaction { +export interface Project { /** - * The reaction to use - * @example "heart" + * Body of the project + * @example "This project represents the sprint of the first week in January" */ - content: ReactionContentEnum; + body: string | null; + /** + * @format uri + * @example "https://api.github.com/projects/1002604/columns" + */ + columns_url: string; /** * @format date-time - * @example "2016-05-20T20:09:31Z" + * @example "2011-04-10T20:09:31Z" */ created_at: string; - /** @example 1 */ + creator: SimpleUser | null; + /** + * @format uri + * @example "https://github.com/api-playground/projects-test/projects/12" + */ + html_url: string; + /** @example 1002604 */ id: number; - /** @example "MDg6UmVhY3Rpb24x" */ + /** + * Name of the project + * @example "Week One Sprint" + */ + name: string; + /** @example "MDc6UHJvamVjdDEwMDI2MDQ=" */ node_id: string; - user: SimpleUser | null; + /** @example 1 */ + number: number; + /** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ + organization_permission?: ProjectOrganizationPermissionEnum; + /** + * @format uri + * @example "https://api.github.com/repos/api-playground/projects-test" + */ + owner_url: string; + /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ + private?: boolean; + /** + * State of the project; either 'open' or 'closed' + * @example "open" + */ + state: string; + /** + * @format date-time + * @example "2014-03-03T18:58:10Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/projects/1002604" + */ + url: string; } /** - * The reaction to use - * @example "heart" + * Project Card + * Project cards represent a scope of work. */ -export enum ReactionContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} - -/** Reaction Rollup */ -export interface ReactionRollup { - "+1": number; - "-1": number; - confused: number; - eyes: number; - heart: number; - hooray: number; - laugh: number; - rocket: number; - total_count: number; - /** @format uri */ +export interface ProjectCard { + /** + * Whether or not the card is archived + * @example false + */ + archived?: boolean; + /** + * @format uri + * @example "https://api.github.com/projects/columns/367" + */ + column_url: string; + /** + * @format uri + * @example "https://api.github.com/repos/api-playground/projects-test/issues/3" + */ + content_url?: string; + /** + * @format date-time + * @example "2016-09-05T14:21:06Z" + */ + created_at: string; + creator: SimpleUser | null; + /** + * The project card's ID + * @example 42 + */ + id: number; + /** @example "MDExOlByb2plY3RDYXJkMTQ3OA==" */ + node_id: string; + /** @example "Add payload for delete Project column" */ + note: string | null; + /** + * @format uri + * @example "https://api.github.com/projects/120" + */ + project_url: string; + /** + * @format date-time + * @example "2016-09-05T14:20:22Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/projects/columns/cards/1478" + */ url: string; } -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ -export enum ReactionsCreateForCommitCommentContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} - -export type ReactionsCreateForCommitCommentData = Reaction; - -export interface ReactionsCreateForCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; -} - -export interface ReactionsCreateForCommitCommentPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ - content: ReactionsCreateForCommitCommentContentEnum; -} - -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ -export enum ReactionsCreateForIssueCommentContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} - -export type ReactionsCreateForIssueCommentData = Reaction; - -export interface ReactionsCreateForIssueCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; -} - -export interface ReactionsCreateForIssueCommentPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ - content: ReactionsCreateForIssueCommentContentEnum; +/** + * Project Column + * Project columns contain cards of work. + */ +export interface ProjectColumn { + /** + * @format uri + * @example "https://api.github.com/projects/columns/367/cards" + */ + cards_url: string; + /** + * @format date-time + * @example "2016-09-05T14:18:44Z" + */ + created_at: string; + /** + * The unique identifier of the project column + * @example 42 + */ + id: number; + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; + /** @example "MDEzOlByb2plY3RDb2x1bW4zNjc=" */ + node_id: string; + /** + * @format uri + * @example "https://api.github.com/projects/120" + */ + project_url: string; + /** + * @format date-time + * @example "2016-09-05T14:22:28Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/projects/columns/367" + */ + url: string; } -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ -export enum ReactionsCreateForIssueContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ +export enum ProjectOrganizationPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", + None = "none", } -export type ReactionsCreateForIssueData = Reaction; +export type ProjectsAddCollaboratorData = any; -export interface ReactionsCreateForIssueParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; +export interface ProjectsAddCollaboratorParams { + projectId: number; + username: string; } -export interface ReactionsCreateForIssuePayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ - content: ReactionsCreateForIssueContentEnum; +export interface ProjectsAddCollaboratorPayload { + /** + * The permission to grant the collaborator. + * @default "write" + * @example "write" + */ + permission?: ProjectsAddCollaboratorPermissionEnum; } -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ -export enum ReactionsCreateForPullRequestReviewCommentContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * The permission to grant the collaborator. + * @default "write" + * @example "write" + */ +export enum ProjectsAddCollaboratorPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", } -export type ReactionsCreateForPullRequestReviewCommentData = Reaction; - -export interface ReactionsCreateForPullRequestReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; -} +export type ProjectsCreateCardData = ProjectCard; -export interface ReactionsCreateForPullRequestReviewCommentPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ - content: ReactionsCreateForPullRequestReviewCommentContentEnum; -} +export type ProjectsCreateCardError = + | (ValidationError | ValidationErrorSimple) + | { + code?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + message?: string; + }; -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ -export enum ReactionsCreateForTeamDiscussionCommentInOrgContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface ProjectsCreateCardParams { + /** column_id parameter */ + columnId: number; } -export type ReactionsCreateForTeamDiscussionCommentInOrgData = Reaction; - -export interface ReactionsCreateForTeamDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; -} +export type ProjectsCreateCardPayload = + | { + /** + * The project card's note + * @example "Update all gems" + */ + note: string | null; + } + | { + /** + * The unique identifier of the content associated with the card + * @example 42 + */ + content_id: number; + /** + * The piece of content associated with the card + * @example "PullRequest" + */ + content_type: string; + }; -export interface ReactionsCreateForTeamDiscussionCommentInOrgPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ - content: ReactionsCreateForTeamDiscussionCommentInOrgContentEnum; -} +export type ProjectsCreateColumnData = ProjectColumn; -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ -export enum ReactionsCreateForTeamDiscussionCommentLegacyContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface ProjectsCreateColumnParams { + projectId: number; } -export type ReactionsCreateForTeamDiscussionCommentLegacyData = Reaction; - -export interface ReactionsCreateForTeamDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; +export interface ProjectsCreateColumnPayload { + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; } -export interface ReactionsCreateForTeamDiscussionCommentLegacyPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ - content: ReactionsCreateForTeamDiscussionCommentLegacyContentEnum; -} +export type ProjectsCreateForAuthenticatedUserData = Project; -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ -export enum ReactionsCreateForTeamDiscussionInOrgContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface ProjectsCreateForAuthenticatedUserPayload { + /** + * Body of the project + * @example "This project represents the sprint of the first week in January" + */ + body?: string | null; + /** + * Name of the project + * @example "Week One Sprint" + */ + name: string; } -export type ReactionsCreateForTeamDiscussionInOrgData = Reaction; +export type ProjectsCreateForOrgData = Project; -export interface ReactionsCreateForTeamDiscussionInOrgParams { - discussionNumber: number; +export interface ProjectsCreateForOrgParams { org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export interface ReactionsCreateForTeamDiscussionInOrgPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ - content: ReactionsCreateForTeamDiscussionInOrgContentEnum; } -/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ -export enum ReactionsCreateForTeamDiscussionLegacyContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export interface ProjectsCreateForOrgPayload { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; } -export type ReactionsCreateForTeamDiscussionLegacyData = Reaction; +export type ProjectsCreateForRepoData = Project; -export interface ReactionsCreateForTeamDiscussionLegacyParams { - discussionNumber: number; - teamId: number; +export interface ProjectsCreateForRepoParams { + owner: string; + repo: string; } -export interface ReactionsCreateForTeamDiscussionLegacyPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ - content: ReactionsCreateForTeamDiscussionLegacyContentEnum; +export interface ProjectsCreateForRepoPayload { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; } -export type ReactionsDeleteForCommitCommentData = any; +export type ProjectsDeleteCardData = any; -export interface ReactionsDeleteForCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +export type ProjectsDeleteCardError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; + +export interface ProjectsDeleteCardParams { + /** card_id parameter */ + cardId: number; } -export type ReactionsDeleteForIssueCommentData = any; +export type ProjectsDeleteColumnData = any; -export interface ReactionsDeleteForIssueCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +export interface ProjectsDeleteColumnParams { + /** column_id parameter */ + columnId: number; } -export type ReactionsDeleteForIssueData = any; +export type ProjectsDeleteData = any; -export interface ReactionsDeleteForIssueParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - reactionId: number; - repo: string; +export type ProjectsDeleteError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; + +export interface ProjectsDeleteParams { + projectId: number; } -export type ReactionsDeleteForPullRequestCommentData = any; +export type ProjectsGetCardData = ProjectCard; -export interface ReactionsDeleteForPullRequestCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +export interface ProjectsGetCardParams { + /** card_id parameter */ + cardId: number; } -export type ReactionsDeleteForTeamDiscussionCommentData = any; +export type ProjectsGetColumnData = ProjectColumn; -export interface ReactionsDeleteForTeamDiscussionCommentParams { - commentNumber: number; - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; +export interface ProjectsGetColumnParams { + /** column_id parameter */ + columnId: number; } -export type ReactionsDeleteForTeamDiscussionData = any; +export type ProjectsGetData = Project; -export interface ReactionsDeleteForTeamDiscussionParams { - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; +export interface ProjectsGetParams { + projectId: number; } -export type ReactionsDeleteLegacyData = any; +export type ProjectsGetPermissionForUserData = RepositoryCollaboratorPermission; -export interface ReactionsDeleteLegacyParams { - reactionId: number; +export interface ProjectsGetPermissionForUserParams { + projectId: number; + username: string; } -export type ReactionsListForCommitCommentData = Reaction[]; +export type ProjectsListCardsData = ProjectCard[]; -export interface ReactionsListForCommitCommentParams { - /** comment_id parameter */ - commentId: number; - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ - content?: ContentEnum2; - owner: string; +export interface ProjectsListCardsParams { + /** + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" + */ + archived_state?: ArchivedStateEnum; + /** column_id parameter */ + columnId: number; /** * Page number of the results to fetch. * @default 1 @@ -26621,29 +26198,29 @@ export interface ReactionsListForCommitCommentParams { * @default 30 */ per_page?: number; - repo: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ -export enum ReactionsListForCommitCommentParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" + */ +export enum ProjectsListCardsParams1ArchivedStateEnum { + All = "all", + Archived = "archived", + NotArchived = "not_archived", } -export type ReactionsListForIssueCommentData = Reaction[]; +export type ProjectsListCollaboratorsData = SimpleUser[]; -export interface ReactionsListForIssueCommentParams { - /** comment_id parameter */ - commentId: number; - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ - content?: ContentEnum3; - owner: string; +export interface ProjectsListCollaboratorsParams { + /** + * Filters the collaborators by their affiliation. Can be one of: + * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. + * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ + affiliation?: AffiliationEnum; /** * Page number of the results to fetch. * @default 1 @@ -26654,29 +26231,25 @@ export interface ReactionsListForIssueCommentParams { * @default 30 */ per_page?: number; - repo: string; + projectId: number; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ -export enum ReactionsListForIssueCommentParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * Filters the collaborators by their affiliation. Can be one of: + * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. + * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ +export enum ProjectsListCollaboratorsParams1AffiliationEnum { + Outside = "outside", + Direct = "direct", + All = "all", } -export type ReactionsListForIssueData = Reaction[]; +export type ProjectsListColumnsData = ProjectColumn[]; -export interface ReactionsListForIssueParams { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ - content?: ContentEnum4; - /** issue_number parameter */ - issueNumber: number; - owner: string; +export interface ProjectsListColumnsParams { /** * Page number of the results to fetch. * @default 1 @@ -26687,29 +26260,13 @@ export interface ReactionsListForIssueParams { * @default 30 */ per_page?: number; - repo: string; -} - -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ -export enum ReactionsListForIssueParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", + projectId: number; } -export type ReactionsListForPullRequestReviewCommentData = Reaction[]; +export type ProjectsListForOrgData = Project[]; -export interface ReactionsListForPullRequestReviewCommentParams { - /** comment_id parameter */ - commentId: number; - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ - content?: ContentEnum5; - owner: string; +export interface ProjectsListForOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -26720,29 +26277,27 @@ export interface ReactionsListForPullRequestReviewCommentParams { * @default 30 */ per_page?: number; - repo: string; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum2; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ -export enum ReactionsListForPullRequestReviewCommentParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum ProjectsListForOrgParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", } -export type ReactionsListForTeamDiscussionCommentInOrgData = Reaction[]; +export type ProjectsListForRepoData = Project[]; -export interface ReactionsListForTeamDiscussionCommentInOrgParams { - commentNumber: number; - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: ContentEnum; - discussionNumber: number; - org: string; +export interface ProjectsListForRepoParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -26753,29 +26308,27 @@ export interface ReactionsListForTeamDiscussionCommentInOrgParams { * @default 30 */ per_page?: number; - /** team_slug parameter */ - teamSlug: string; + repo: string; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum5; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ -export enum ReactionsListForTeamDiscussionCommentInOrgParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum ProjectsListForRepoParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", } -export type ReactionsListForTeamDiscussionCommentLegacyData = Reaction[]; +export type ProjectsListForUserData = Project[]; -export interface ReactionsListForTeamDiscussionCommentLegacyParams { - commentNumber: number; - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: ContentEnum6; - discussionNumber: number; +export interface ProjectsListForUserParams { /** * Page number of the results to fetch. * @default 1 @@ -26786,1607 +26339,2209 @@ export interface ReactionsListForTeamDiscussionCommentLegacyParams { * @default 30 */ per_page?: number; - teamId: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: StateEnum10; + username: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ -export enum ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum ProjectsListForUserParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", } -export type ReactionsListForTeamDiscussionInOrgData = Reaction[]; +export type ProjectsMoveCardData = object; -export interface ReactionsListForTeamDiscussionInOrgParams { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ - content?: ContentEnum1; - discussionNumber: number; - org: string; +export type ProjectsMoveCardError = + | { + documentation_url?: string; + errors?: { + code?: string; + field?: string; + message?: string; + resource?: string; + }[]; + message?: string; + } + | { + code?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + message?: string; + }; + +export interface ProjectsMoveCardParams { + /** card_id parameter */ + cardId: number; +} + +export interface ProjectsMoveCardPayload { /** - * Page number of the results to fetch. - * @default 1 + * The unique identifier of the column the card should be moved to + * @example 42 */ - page?: number; + column_id?: number; /** - * Results per page (max 100) - * @default 30 + * The position of the card in a column + * @pattern ^(?:top|bottom|after:\\d+)$ + * @example "bottom" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; + position: string; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ -export enum ReactionsListForTeamDiscussionInOrgParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export type ProjectsMoveColumnData = object; + +export interface ProjectsMoveColumnParams { + /** column_id parameter */ + columnId: number; } -export type ReactionsListForTeamDiscussionLegacyData = Reaction[]; +export interface ProjectsMoveColumnPayload { + /** + * The position of the column in a project + * @pattern ^(?:first|last|after:\\d+)$ + * @example "last" + */ + position: string; +} -export interface ReactionsListForTeamDiscussionLegacyParams { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ - content?: ContentEnum7; - discussionNumber: number; +export type ProjectsRemoveCollaboratorData = any; + +export interface ProjectsRemoveCollaboratorParams { + projectId: number; + username: string; +} + +export type ProjectsUpdateCardData = ProjectCard; + +export interface ProjectsUpdateCardParams { + /** card_id parameter */ + cardId: number; +} + +export interface ProjectsUpdateCardPayload { /** - * Page number of the results to fetch. - * @default 1 + * Whether or not the card is archived + * @example false */ - page?: number; + archived?: boolean; /** - * Results per page (max 100) - * @default 30 + * The project card's note + * @example "Update all gems" */ - per_page?: number; - teamId: number; + note?: string | null; } -/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ -export enum ReactionsListForTeamDiscussionLegacyParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} +export type ProjectsUpdateColumnData = ProjectColumn; -/** - * Referrer Traffic - * Referrer Traffic - */ -export interface ReferrerTraffic { - /** @example 4 */ - count: number; - /** @example "Google" */ - referrer: string; - /** @example 3 */ - uniques: number; +export interface ProjectsUpdateColumnParams { + /** column_id parameter */ + columnId: number; } -/** - * Release - * A release. - */ -export interface Release { - assets: ReleaseAsset[]; - /** @format uri */ - assets_url: string; - /** Simple User */ - author: SimpleUser; - body?: string | null; - body_html?: string; - body_text?: string; - /** @format date-time */ - created_at: string; +export interface ProjectsUpdateColumnPayload { /** - * true to create a draft (unpublished) release, false to create a published one. - * @example false + * Name of the project column + * @example "Remaining tasks" */ - draft: boolean; - /** @format uri */ - html_url: string; - id: number; - name: string | null; - node_id: string; + name: string; +} + +export type ProjectsUpdateData = Project; + +export type ProjectsUpdateError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; + +/** The baseline permission that all organization members have on this project */ +export enum ProjectsUpdateOrganizationPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", + None = "none", +} + +export interface ProjectsUpdateParams { + projectId: number; +} + +export interface ProjectsUpdatePayload { /** - * Whether to identify the release as a prerelease or a full release. - * @example false + * Body of the project + * @example "This project represents the sprint of the first week in January" */ - prerelease: boolean; - /** @format date-time */ - published_at: string | null; + body?: string | null; /** - * The name of the tag. - * @example "v1.0.0" + * Name of the project + * @example "Week One Sprint" */ - tag_name: string; - /** @format uri */ - tarball_url: string | null; + name?: string; + /** The baseline permission that all organization members have on this project */ + organization_permission?: ProjectsUpdateOrganizationPermissionEnum; + /** Whether or not this project can be seen by everyone. */ + private?: boolean; /** - * Specifies the commitish value that determines where the Git tag is created from. - * @example "master" + * State of the project; either 'open' or 'closed' + * @example "open" */ - target_commitish: string; - upload_url: string; + state?: string; +} + +/** + * Protected Branch + * Branch protections protect branches + */ +export interface ProtectedBranch { + allow_deletions?: { + enabled: boolean; + }; + allow_force_pushes?: { + enabled: boolean; + }; + enforce_admins?: { + enabled: boolean; + /** @format uri */ + url: string; + }; + required_linear_history?: { + enabled: boolean; + }; + required_pull_request_reviews?: { + dismiss_stale_reviews?: boolean; + dismissal_restrictions?: { + teams: Team[]; + /** @format uri */ + teams_url: string; + /** @format uri */ + url: string; + users: SimpleUser[]; + /** @format uri */ + users_url: string; + }; + require_code_owner_reviews?: boolean; + required_approving_review_count?: number; + /** @format uri */ + url: string; + }; + required_signatures?: { + /** @example true */ + enabled: boolean; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" + */ + url: string; + }; + /** Status Check Policy */ + required_status_checks?: StatusCheckPolicy; + /** Branch Restriction Policy */ + restrictions?: BranchRestrictionPolicy; /** @format uri */ url: string; - /** @format uri */ - zipball_url: string | null; } /** - * Release Asset - * Data related to a release. + * Protected Branch Admin Enforced + * Protected Branch Admin Enforced */ -export interface ReleaseAsset { - /** @format uri */ - browser_download_url: string; - content_type: string; - /** @format date-time */ - created_at: string; - download_count: number; - id: number; - label: string | null; +export interface ProtectedBranchAdminEnforced { + /** @example true */ + enabled: boolean; /** - * The file name of the asset. - * @example "Team Environment" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" */ - name: string; - node_id: string; - size: number; - /** State of the release asset. */ - state: ReleaseAssetStateEnum; - /** @format date-time */ - updated_at: string; - uploader: SimpleUser | null; - /** @format uri */ url: string; } -/** State of the release asset. */ -export enum ReleaseAssetStateEnum { - Uploaded = "uploaded", - Open = "open", +/** + * Protected Branch Pull Request Review + * Protected Branch Pull Request Review + */ +export interface ProtectedBranchPullRequestReview { + /** @example true */ + dismiss_stale_reviews: boolean; + dismissal_restrictions?: { + /** The list of teams with review dismissal access. */ + teams?: Team[]; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams"" */ + teams_url?: string; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions"" */ + url?: string; + /** The list of users with review dismissal access. */ + users?: SimpleUser[]; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"" */ + users_url?: string; + }; + /** @example true */ + require_code_owner_reviews: boolean; + /** + * @min 1 + * @max 6 + * @example 2 + */ + required_approving_review_count?: number; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" + */ + url?: string; } /** - * Repo Search Result Item - * Repo Search Result Item + * Public User + * Public User */ -export interface RepoSearchResultItem { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; +export interface PublicUser { /** @format uri */ - contributors_url: string; + avatar_url: string; + bio: string | null; + blog: string | null; + /** @example 3 */ + collaborators?: number; + company: string | null; /** @format date-time */ created_at: string; - default_branch: string; - delete_branch_on_merge?: boolean; - /** @format uri */ - deployments_url: string; - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ + /** @example 1 */ + disk_usage?: number; + /** @format email */ + email: string | null; events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; + followers: number; /** @format uri */ - hooks_url: string; + followers_url: string; + following: number; + following_url: string; + gists_url: string; + gravatar_id: string | null; + hireable: boolean | null; /** @format uri */ html_url: string; id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; + location: string | null; + login: string; + name: string | null; node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - score: number; - size: number; - ssh_url: string; - stargazers_count: number; /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; + organizations_url: string; + /** @example 2 */ + owned_private_repos?: number; + plan?: { + collaborators: number; + name: string; + private_repos: number; + space: number; + }; + /** @example 1 */ + private_gists?: number; + public_gists: number; + public_repos: number; /** @format uri */ - subscription_url: string; + received_events_url: string; /** @format uri */ - svn_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - text_matches?: SearchResultTextMatches; - topics?: string[]; - trees_url: string; + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + /** @example 2 */ + total_private_repos?: number; + twitter_username?: string | null; + type: string; /** @format date-time */ updated_at: string; /** @format uri */ url: string; - watchers: number; - watchers_count: number; -} - -export type ReposAcceptInvitationData = any; - -export interface ReposAcceptInvitationParams { - /** invitation_id parameter */ - invitationId: number; -} - -export type ReposAddAppAccessRestrictionsData = Integration[]; - -export interface ReposAddAppAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -/** @example {"apps":["my-app"]} */ -export interface ReposAddAppAccessRestrictionsPayload { - /** apps parameter */ - apps: string[]; -} - -export type ReposAddCollaboratorData = RepositoryInvitation; - -export interface ReposAddCollaboratorParams { - owner: string; - repo: string; - username: string; -} - -export interface ReposAddCollaboratorPayload { - /** - * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: - * \\* \`pull\` - can pull, but not push to or administer this repository. - * \\* \`push\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push and administer this repository. - * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. - * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. - * @default "push" - */ - permission?: ReposAddCollaboratorPermissionEnum; - /** @example ""push"" */ - permissions?: string; } /** - * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: - * \\* \`pull\` - can pull, but not push to or administer this repository. - * \\* \`push\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push and administer this repository. - * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. - * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. - * @default "push" + * Pull Request + * Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. */ -export enum ReposAddCollaboratorPermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", - Maintain = "maintain", - Triage = "triage", -} - -export type ReposAddStatusCheckContextsData = string[]; - -export interface ReposAddStatusCheckContextsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -/** @example {"contexts":["contexts"]} */ -export interface ReposAddStatusCheckContextsPayload { - /** contexts parameter */ - contexts: string[]; -} - -export type ReposAddTeamAccessRestrictionsData = Team[]; - -export interface ReposAddTeamAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -/** @example {"teams":["my-team"]} */ -export interface ReposAddTeamAccessRestrictionsPayload { - /** teams parameter */ - teams: string[]; -} - -export type ReposAddUserAccessRestrictionsData = SimpleUser[]; - -export interface ReposAddUserAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -/** @example {"users":["mona"]} */ -export interface ReposAddUserAccessRestrictionsPayload { - /** users parameter */ - users: string[]; -} - -export type ReposCheckCollaboratorData = any; - -export interface ReposCheckCollaboratorParams { - owner: string; - repo: string; - username: string; -} - -export type ReposCheckVulnerabilityAlertsData = any; - -export interface ReposCheckVulnerabilityAlertsParams { - owner: string; - repo: string; -} - -export type ReposCompareCommitsData = CommitComparison; - -export interface ReposCompareCommitsParams { - base: string; - head: string; - owner: string; - repo: string; -} - -export type ReposCreateCommitCommentData = CommitComment; - -export interface ReposCreateCommitCommentParams { - /** commit_sha parameter */ - commitSha: string; - owner: string; - repo: string; -} - -export interface ReposCreateCommitCommentPayload { - /** The contents of the comment. */ - body: string; - /** **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ - line?: number; - /** Relative path of the file to comment on. */ - path?: string; - /** Line index in the diff to comment on. */ - position?: number; -} - -export type ReposCreateCommitSignatureProtectionData = - ProtectedBranchAdminEnforced; - -export interface ReposCreateCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export type ReposCreateCommitStatusData = Status; - -export interface ReposCreateCommitStatusParams { - owner: string; - repo: string; - sha: string; -} - -export interface ReposCreateCommitStatusPayload { - /** - * A string label to differentiate this status from the status of other systems. This field is case-insensitive. - * @default "default" - */ - context?: string; - /** A short description of the status. */ - description?: string; - /** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ - state: ReposCreateCommitStatusStateEnum; - /** - * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. - * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: - * \`http://ci.example.com/user/repo/build/sha\` - */ - target_url?: string; -} - -/** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ -export enum ReposCreateCommitStatusStateEnum { - Error = "error", - Failure = "failure", - Pending = "pending", - Success = "success", -} - -export type ReposCreateDeployKeyData = DeployKey; - -export interface ReposCreateDeployKeyParams { - owner: string; - repo: string; -} - -export interface ReposCreateDeployKeyPayload { - /** The contents of the key. */ - key: string; - /** - * If \`true\`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. - * - * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." - */ - read_only?: boolean; - /** A name for the key. */ - title?: string; -} - -export type ReposCreateDeploymentData = Deployment; - -export type ReposCreateDeploymentError = { - /** @example ""https://docs.github.com/rest/reference/repos#create-a-deployment"" */ - documentation_url?: string; - message?: string; -}; - -export interface ReposCreateDeploymentParams { - owner: string; - repo: string; -} - -export interface ReposCreateDeploymentPayload { +export interface PullRequest { + _links: { + /** Hypermedia Link */ + comments: Link; + /** Hypermedia Link */ + commits: Link; + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + issue: Link; + /** Hypermedia Link */ + review_comment: Link; + /** Hypermedia Link */ + review_comments: Link; + /** Hypermedia Link */ + self: Link; + /** Hypermedia Link */ + statuses: Link; + }; + /** @example "too heated" */ + active_lock_reason?: string | null; + /** @example 100 */ + additions: number; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** The status of auto merging a pull request. */ + auto_merge: AutoMerge; + base: { + label: string; + ref: string; + repo: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + /** @format uri */ + deployments_url: string; + description: string | null; + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; + }; + sha: string; + user: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + }; + /** @example "Please pull these awesome changes" */ + body: string | null; + /** @example 5 */ + changed_files: number; /** - * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. - * @default true + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - auto_merge?: boolean; - /** @example ""1776-07-04T00:00:00.000-07:52"" */ - created_at?: string; + closed_at: string | null; + /** @example 10 */ + comments: number; /** - * Short description of the deployment. - * @default "" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" */ - description?: string | null; + comments_url: string; + /** @example 3 */ + commits: number; /** - * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). - * @default "production" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" */ - environment?: string; - /** JSON payload with extra information about the deployment. */ - payload?: Record | string; + commits_url: string; /** - * Specifies if the given environment is one that end-users directly interact with. Default: \`true\` when \`environment\` is \`production\` and \`false\` otherwise. - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - production_environment?: boolean; - /** The ref to deploy. This can be a branch, tag, or SHA. */ - ref: string; - /** The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ - required_contexts?: string[]; + created_at: string; + /** @example 3 */ + deletions: number; /** - * Specifies a task to execute (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "deploy" + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.diff" */ - task?: string; + diff_url: string; /** - * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: \`false\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default false + * Indicates whether or not the pull request is a draft. + * @example false */ - transient_environment?: boolean; -} - -export type ReposCreateDeploymentStatusData = DeploymentStatus; - -/** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ -export enum ReposCreateDeploymentStatusEnvironmentEnum { - Production = "production", - Staging = "staging", - Qa = "qa", -} - -export interface ReposCreateDeploymentStatusParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; -} - -export interface ReposCreateDeploymentStatusPayload { - /** - * Adds a new \`inactive\` status to all prior non-transient, non-production environment deployments with the same repository and \`environment\` name as the created status's deployment. An \`inactive\` status is only added to deployments that had a \`success\` state. Default: \`true\` - * **Note:** To add an \`inactive\` status to \`production\` environments, you must use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - */ - auto_inactive?: boolean; - /** - * A short description of the status. The maximum description length is 140 characters. - * @default "" - */ - description?: string; - /** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ - environment?: ReposCreateDeploymentStatusEnvironmentEnum; - /** - * Sets the URL for accessing your environment. Default: \`""\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default "" - */ - environment_url?: string; - /** - * The full URL of the deployment's output. This parameter replaces \`target_url\`. We will continue to accept \`target_url\` to support legacy uses, but we recommend replacing \`target_url\` with \`log_url\`. Setting \`log_url\` will automatically set \`target_url\` to the same value. Default: \`""\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default "" - */ - log_url?: string; - /** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ - state: ReposCreateDeploymentStatusStateEnum; - /** - * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the \`log_url\` parameter, which replaces \`target_url\`. - * @default "" - */ - target_url?: string; -} - -/** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ -export enum ReposCreateDeploymentStatusStateEnum { - Error = "error", - Failure = "failure", - Inactive = "inactive", - InProgress = "in_progress", - Queued = "queued", - Pending = "pending", - Success = "success", -} - -export type ReposCreateDispatchEventData = any; - -export interface ReposCreateDispatchEventParams { - owner: string; - repo: string; -} - -export interface ReposCreateDispatchEventPayload { - /** JSON payload with extra information about the webhook event that your action or worklow may use. */ - client_payload?: Record; - /** A custom webhook event name. */ - event_type: string; -} - -export type ReposCreateForAuthenticatedUserData = Repository; - -export interface ReposCreateForAuthenticatedUserPayload { + draft?: boolean; + head: { + label: string; + ref: string; + repo: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + /** @format uri */ + deployments_url: string; + description: string | null; + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: { + key: string; + name: string; + node_id: string; + spdx_id: string | null; + /** @format uri */ + url: string | null; + } | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; + }; + sha: string; + user: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + }; /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347" */ - allow_merge_commit?: boolean; + html_url: string; + /** @example 1 */ + id: number; /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" */ - allow_rebase_merge?: boolean; + issue_url: string; + labels: { + color?: string; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + url?: string; + }[]; + /** @example true */ + locked: boolean; /** - * Whether to allow squash merges for pull requests. - * @default true + * Indicates whether maintainers can modify the pull request. * @example true */ - allow_squash_merge?: boolean; - /** - * Whether the repository is initialized with a minimal README. - * @default false - */ - auto_init?: boolean; - /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false - */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; + maintainer_can_modify: boolean; + /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ + merge_commit_sha: string | null; + /** @example true */ + mergeable: boolean | null; + /** @example "clean" */ + mergeable_state: string; + merged: boolean; /** - * The desired language or platform to apply to the .gitignore. - * @example "Haskell" + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - gitignore_template?: string; + merged_at: string | null; + merged_by: SimpleUser | null; + milestone: Milestone | null; + /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + node_id: string; /** - * Whether downloads are enabled. - * @default true - * @example true + * Number uniquely identifying the pull request within its repository. + * @example 42 */ - has_downloads?: boolean; + number: number; /** - * Whether issues are enabled. - * @default true - * @example true + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.patch" */ - has_issues?: boolean; + patch_url: string; + /** @example true */ + rebaseable?: boolean | null; + requested_reviewers?: SimpleUser[] | null; + requested_teams?: TeamSimple[] | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ + review_comment_url: string; + /** @example 0 */ + review_comments: number; /** - * Whether projects are enabled. - * @default true - * @example true + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" */ - has_projects?: boolean; + review_comments_url: string; /** - * Whether the wiki is enabled. - * @default true - * @example true + * State of this Pull Request. Either \`open\` or \`closed\`. + * @example "open" */ - has_wiki?: boolean; - /** A URL with more information about the repository. */ - homepage?: string; + state: PullRequestStateEnum; /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - is_template?: boolean; + statuses_url: string; /** - * The license keyword of the open source license for this repository. - * @example "mit" + * The title of the pull request. + * @example "Amazing new feature" */ - license_template?: string; + title: string; /** - * The name of the repository. - * @example "Team Environment" + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - name: string; + updated_at: string; /** - * Whether the repository is private or public. - * @default false + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" */ - private?: boolean; - /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ - team_id?: number; -} - -export type ReposCreateForkData = Repository; - -export interface ReposCreateForkParams { - owner: string; - repo: string; + url: string; + user: SimpleUser | null; } -export interface ReposCreateForkPayload { - /** Optional parameter to specify the organization name if forking into an organization. */ - organization?: string; +/** + * Pull Request Merge Result + * Pull Request Merge Result + */ +export interface PullRequestMergeResult { + merged: boolean; + message: string; + sha: string; } -export type ReposCreateInOrgData = Repository; - -export interface ReposCreateInOrgParams { - org: string; +/** Pull Request Minimal */ +export interface PullRequestMinimal { + base: { + ref: string; + repo: { + id: number; + name: string; + url: string; + }; + sha: string; + }; + head: { + ref: string; + repo: { + id: number; + name: string; + url: string; + }; + sha: string; + }; + id: number; + number: number; + url: string; } -export interface ReposCreateInOrgPayload { - /** - * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. - * @default true - */ - allow_merge_commit?: boolean; - /** - * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. - * @default true - */ - allow_rebase_merge?: boolean; - /** - * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. - * @default true - */ - allow_squash_merge?: boolean; - /** - * Pass \`true\` to create an initial commit with empty README. - * @default false - */ - auto_init?: boolean; - /** - * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. - * @default false - */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; - /** Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ - gitignore_template?: string; - /** - * Either \`true\` to enable issues for this repository or \`false\` to disable them. - * @default true - */ - has_issues?: boolean; +/** + * Pull Request Review + * Pull Request Reviews are reviews on pull requests. + */ +export interface PullRequestReview { + _links: { + html: { + href: string; + }; + pull_request: { + href: string; + }; + }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; /** - * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. - * @default true + * The text of the review. + * @example "This looks great." */ - has_projects?: boolean; + body: string; + body_html?: string; + body_text?: string; /** - * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. - * @default true + * A commit SHA for the review. + * @example "54bb654c9e6025347f57900a4a5c2313a96b8035" */ - has_wiki?: boolean; - /** A URL with more information about the repository. */ - homepage?: string; + commit_id: string; /** - * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. - * @default false + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" */ - is_template?: boolean; - /** Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the \`license_template\` string. For example, "mit" or "mpl-2.0". */ - license_template?: string; - /** The name of the repository. */ - name: string; + html_url: string; /** - * Either \`true\` to create a private repository or \`false\` to create a public one. - * @default false + * Unique identifier of the review + * @example 42 */ - private?: boolean; - /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ - team_id?: number; + id: number; + /** @example "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" */ + node_id: string; /** - * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. - * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/12" */ - visibility?: ReposCreateInOrgVisibilityEnum; + pull_request_url: string; + /** @example "CHANGES_REQUESTED" */ + state: string; + /** @format date-time */ + submitted_at?: string; + user: SimpleUser | null; } /** - * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. - * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. + * Pull Request Review Comment + * Pull Request Review Comments are comments on a portion of the Pull Request's diff. */ -export enum ReposCreateInOrgVisibilityEnum { - Public = "public", - Private = "private", - Visibility = "visibility", - Internal = "internal", -} - -export type ReposCreateOrUpdateFileContentsData = FileCommit; - -export interface ReposCreateOrUpdateFileContentsParams { - owner: string; - /** path+ parameter */ +export interface PullRequestReviewComment { + _links: { + html: { + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + */ + href: string; + }; + pull_request: { + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + */ + href: string; + }; + self: { + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + */ + href: string; + }; + }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** + * The text of the comment. + * @example "We should probably include a check for null values here." + */ + body: string; + /** @example ""

comment body

"" */ + body_html?: string; + /** @example ""comment body"" */ + body_text?: string; + /** + * The SHA of the commit to which the comment applies. + * @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + commit_id: string; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + created_at: string; + /** + * The diff of the line that the comment refers to. + * @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." + */ + diff_hunk: string; + /** + * HTML URL for the pull request review comment. + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + */ + html_url: string; + /** + * The ID of the pull request review comment. + * @example 1 + */ + id: number; + /** + * The comment ID to reply to. + * @example 8 + */ + in_reply_to_id?: number; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + line?: number; + /** + * The node ID of the pull request review comment. + * @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" + */ + node_id: string; + /** + * The SHA of the original commit to which the comment applies. + * @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" + */ + original_commit_id: string; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + original_line?: number; + /** + * The index of the original line in the diff to which the comment applies. + * @example 4 + */ + original_position: number; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + original_start_line?: number | null; + /** + * The relative path of the file to which the comment applies. + * @example "config/database.yaml" + */ path: string; - repo: string; + /** + * The line index in the diff to which the comment applies. + * @example 1 + */ + position: number; + /** + * The ID of the pull request review to which the comment belongs. + * @example 42 + */ + pull_request_review_id: number | null; + /** + * URL for the pull request that the review comment belongs to. + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + */ + pull_request_url: string; + reactions?: ReactionRollup; + /** + * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + * @default "RIGHT" + */ + side?: PullRequestReviewCommentSideEnum; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + start_line?: number | null; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + start_side?: PullRequestReviewCommentStartSideEnum | null; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + updated_at: string; + /** + * URL for the pull request review comment + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + */ + url: string; + /** Simple User */ + user: SimpleUser; } -export interface ReposCreateOrUpdateFileContentsPayload { - /** The author of the file. Default: The \`committer\` or the authenticated user if you omit \`committer\`. */ - author?: { - /** @example ""2013-01-15T17:13:22+05:00"" */ - date?: string; - /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ - email: string; - /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ - name: string; - }; - /** The branch name. Default: the repository’s default branch (usually \`master\`) */ - branch?: string; - /** The person that committed the file. Default: the authenticated user. */ - committer?: { - /** @example ""2013-01-05T13:13:22+05:00"" */ - date?: string; - /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ - email: string; - /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ - name: string; - }; - /** The new file content, using Base64 encoding. */ - content: string; - /** The commit message. */ - message: string; - /** **Required if you are updating a file**. The blob SHA of the file being replaced. */ - sha?: string; +/** + * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + * @default "RIGHT" + */ +export enum PullRequestReviewCommentSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } -export type ReposCreatePagesSiteData = Page; - -export interface ReposCreatePagesSiteParams { - owner: string; - repo: string; +/** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ +export enum PullRequestReviewCommentStartSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } /** - * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` - * @default "/" + * Pull Request Review Request + * Pull Request Review Request */ -export enum ReposCreatePagesSitePathEnum { - Value = "/", - ValueDocs = "/docs", +export interface PullRequestReviewRequest { + teams: TeamSimple[]; + users: SimpleUser[]; } -/** The source branch and directory used to publish your Pages site. */ -export interface ReposCreatePagesSitePayload { - /** The source branch and directory used to publish your Pages site. */ - source: { - /** The repository branch used to publish your site's source files. */ - branch: string; - /** - * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` - * @default "/" - */ - path?: ReposCreatePagesSitePathEnum; +/** + * Pull Request Simple + * Pull Request Simple + */ +export interface PullRequestSimple { + _links: { + /** Hypermedia Link */ + comments: Link; + /** Hypermedia Link */ + commits: Link; + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + issue: Link; + /** Hypermedia Link */ + review_comment: Link; + /** Hypermedia Link */ + review_comments: Link; + /** Hypermedia Link */ + self: Link; + /** Hypermedia Link */ + statuses: Link; }; -} - -export type ReposCreateReleaseData = Release; - -export interface ReposCreateReleaseParams { - owner: string; - repo: string; -} - -export interface ReposCreateReleasePayload { - /** Text describing the contents of the tag. */ - body?: string; + /** @example "too heated" */ + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** The status of auto merging a pull request. */ + auto_merge: AutoMerge; + base: { + label: string; + ref: string; + /** A git repository */ + repo: Repository; + sha: string; + user: SimpleUser | null; + }; + /** @example "Please pull these awesome changes" */ + body: string | null; /** - * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. - * @default false + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - draft?: boolean; - /** The name of the release. */ - name?: string; + closed_at: string | null; /** - * \`true\` to identify the release as a prerelease. \`false\` to identify the release as a full release. - * @default false + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" */ - prerelease?: boolean; - /** The name of the tag. */ - tag_name: string; - /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ - target_commitish?: string; -} - -export type ReposCreateUsingTemplateData = Repository; - -export interface ReposCreateUsingTemplateParams { - templateOwner: string; - templateRepo: string; -} - -export interface ReposCreateUsingTemplatePayload { - /** A short description of the new repository. */ - description?: string; + comments_url: string; /** - * Set to \`true\` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: \`false\`. - * @default false + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" */ - include_all_branches?: boolean; - /** The name of the new repository. */ - name: string; - /** The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ - owner?: string; + commits_url: string; /** - * Either \`true\` to create a new private repository or \`false\` to create a new public one. - * @default false + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - private?: boolean; -} - -export type ReposCreateWebhookData = Hook; - -export interface ReposCreateWebhookParams { - owner: string; - repo: string; -} - -export interface ReposCreateWebhookPayload { + created_at: string; /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.diff" */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** @example ""sha256"" */ - digest?: string; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** @example ""abc"" */ - token?: string; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; + diff_url: string; + /** + * Indicates whether or not the pull request is a draft. + * @example false + */ + draft?: boolean; + head: { + label: string; + ref: string; + /** A git repository */ + repo: Repository; + sha: string; + user: SimpleUser | null; }; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347" */ - events?: string[]; - /** Use \`web\` to create a webhook. Default: \`web\`. This parameter only accepts the value \`web\`. */ - name?: string; + html_url: string; + /** @example 1 */ + id: number; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" + */ + issue_url: string; + labels: { + color?: string; + default?: boolean; + description?: string; + id?: number; + name?: string; + node_id?: string; + url?: string; + }[]; + /** @example true */ + locked: boolean; + /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ + merge_commit_sha: string | null; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + merged_at: string | null; + milestone: Milestone | null; + /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + node_id: string; + /** @example 1347 */ + number: number; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + */ + patch_url: string; + requested_reviewers?: SimpleUser[] | null; + requested_teams?: TeamSimple[] | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ + review_comment_url: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + */ + review_comments_url: string; + /** @example "open" */ + state: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + statuses_url: string; + /** @example "new-feature" */ + title: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + */ + url: string; + user: SimpleUser | null; } -export type ReposDeclineInvitationData = any; - -export interface ReposDeclineInvitationParams { - /** invitation_id parameter */ - invitationId: number; +/** + * State of this Pull Request. Either \`open\` or \`closed\`. + * @example "open" + */ +export enum PullRequestStateEnum { + Open = "open", + Closed = "closed", } -export type ReposDeleteAccessRestrictionsData = any; +export type PullsCheckIfMergedData = any; -export interface ReposDeleteAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export interface PullsCheckIfMergedParams { owner: string; + pullNumber: number; repo: string; } -export type ReposDeleteAdminBranchProtectionData = any; +export type PullsCreateData = PullRequest; -export interface ReposDeleteAdminBranchProtectionParams { - /** The name of the branch. */ - branch: string; +export interface PullsCreateParams { owner: string; repo: string; } -export type ReposDeleteBranchProtectionData = any; - -export interface ReposDeleteBranchProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface PullsCreatePayload { + /** The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ + base: string; + /** The contents of the pull request. */ + body?: string; + /** Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ + draft?: boolean; + /** The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace \`head\` with a user like this: \`username:branch\`. */ + head: string; + /** @example 1 */ + issue?: number; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + /** The title of the new pull request. */ + title?: string; } -export type ReposDeleteCommitCommentData = any; +export type PullsCreateReplyForReviewCommentData = PullRequestReviewComment; -export interface ReposDeleteCommitCommentParams { +export interface PullsCreateReplyForReviewCommentParams { /** comment_id parameter */ commentId: number; owner: string; + pullNumber: number; repo: string; } -export type ReposDeleteCommitSignatureProtectionData = any; - -export interface ReposDeleteCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface PullsCreateReplyForReviewCommentPayload { + /** The text of the review comment. */ + body: string; } -export type ReposDeleteData = any; - -export type ReposDeleteDeployKeyData = any; +export type PullsCreateReviewCommentData = PullRequestReviewComment; -export interface ReposDeleteDeployKeyParams { - /** key_id parameter */ - keyId: number; +export interface PullsCreateReviewCommentParams { owner: string; + pullNumber: number; repo: string; } -export type ReposDeleteDeploymentData = any; - -export interface ReposDeleteDeploymentParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; +export interface PullsCreateReviewCommentPayload { + /** The text of the review comment. */ + body: string; + /** The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the \`position\`. */ + commit_id?: string; + /** @example 2 */ + in_reply_to?: number; + /** **Required with \`comfort-fade\` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ + line?: number; + /** The relative path to the file that necessitates a comment. */ + path: string; + /** **Required without \`comfort-fade\` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ + position?: number; + /** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ + side?: PullsCreateReviewCommentSideEnum; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_line\` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ + start_line?: number; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ + start_side?: PullsCreateReviewCommentStartSideEnum; } -export type ReposDeleteError = { - documentation_url?: string; - message?: string; -}; - -export type ReposDeleteFileData = FileCommit; - -export interface ReposDeleteFileParams { - owner: string; - /** path+ parameter */ - path: string; - repo: string; +/** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ +export enum PullsCreateReviewCommentSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } -export interface ReposDeleteFilePayload { - /** object containing information about the author. */ - author?: { - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The branch name. Default: the repository’s default branch (usually \`master\`) */ - branch?: string; - /** object containing information about the committer. */ - committer?: { - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The commit message. */ - message: string; - /** The blob SHA of the file being replaced. */ - sha: string; +/** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ +export enum PullsCreateReviewCommentStartSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", + Side = "side", } -export type ReposDeleteInvitationData = any; +export type PullsCreateReviewData = PullRequestReview; -export interface ReposDeleteInvitationParams { - /** invitation_id parameter */ - invitationId: number; - owner: string; - repo: string; +/** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ +export enum PullsCreateReviewEventEnum { + APPROVE = "APPROVE", + REQUEST_CHANGES = "REQUEST_CHANGES", + COMMENT = "COMMENT", } -export type ReposDeletePagesSiteData = any; - -export interface ReposDeletePagesSiteParams { +export interface PullsCreateReviewParams { owner: string; + pullNumber: number; repo: string; } -export interface ReposDeleteParams { - owner: string; - repo: string; +export interface PullsCreateReviewPayload { + /** **Required** when using \`REQUEST_CHANGES\` or \`COMMENT\` for the \`event\` parameter. The body text of the pull request review. */ + body?: string; + /** Use the following table to specify the location, destination, and contents of the draft review comment. */ + comments?: { + /** Text of the review comment. */ + body: string; + /** @example 28 */ + line?: number; + /** The relative path to the file that necessitates a review comment. */ + path: string; + /** The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ + position?: number; + /** @example "RIGHT" */ + side?: string; + /** @example 26 */ + start_line?: number; + /** @example "LEFT" */ + start_side?: string; + }[]; + /** The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the \`position\`. Defaults to the most recent commit in the pull request when you do not specify a value. */ + commit_id?: string; + /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ + event?: PullsCreateReviewEventEnum; } -export type ReposDeletePullRequestReviewProtectionData = any; +export type PullsDeletePendingReviewData = PullRequestReview; -export interface ReposDeletePullRequestReviewProtectionParams { - /** The name of the branch. */ - branch: string; +export interface PullsDeletePendingReviewParams { owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposDeleteReleaseAssetData = any; +export type PullsDeleteReviewCommentData = any; -export interface ReposDeleteReleaseAssetParams { - /** asset_id parameter */ - assetId: number; +export interface PullsDeleteReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposDeleteReleaseData = any; +export type PullsDismissReviewData = PullRequestReview; -export interface ReposDeleteReleaseParams { +export interface PullsDismissReviewParams { owner: string; - /** release_id parameter */ - releaseId: number; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposDeleteWebhookData = any; - -export interface ReposDeleteWebhookParams { - hookId: number; - owner: string; - repo: string; +export interface PullsDismissReviewPayload { + /** @example ""APPROVE"" */ + event?: string; + /** The message for the pull request review dismissal */ + message: string; } -export type ReposDisableAutomatedSecurityFixesData = any; +export type PullsGetData = PullRequest; -export interface ReposDisableAutomatedSecurityFixesParams { +export interface PullsGetParams { owner: string; + pullNumber: number; repo: string; } -export type ReposDisableVulnerabilityAlertsData = any; +export type PullsGetReviewCommentData = PullRequestReviewComment; -export interface ReposDisableVulnerabilityAlertsParams { +export interface PullsGetReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export interface ReposDownloadTarballArchiveParams { - owner: string; - ref: string; - repo: string; -} +export type PullsGetReviewData = PullRequestReview; -export interface ReposDownloadZipballArchiveParams { +export interface PullsGetReviewParams { owner: string; - ref: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposEnableAutomatedSecurityFixesData = any; +export type PullsListCommentsForReviewData = ReviewComment[]; -export interface ReposEnableAutomatedSecurityFixesParams { +export interface PullsListCommentsForReviewParams { owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposEnableVulnerabilityAlertsData = any; +export type PullsListCommitsData = Commit[]; -export interface ReposEnableVulnerabilityAlertsParams { +export interface PullsListCommitsParams { owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; } -export type ReposGetAccessRestrictionsData = BranchRestrictionPolicy; +export type PullsListData = PullRequestSimple[]; -export interface ReposGetAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export type PullsListFilesData = DiffEntry[]; + +export interface PullsListFilesParams { owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; } -export type ReposGetAdminBranchProtectionData = ProtectedBranchAdminEnforced; - -export interface ReposGetAdminBranchProtectionParams { - /** The name of the branch. */ - branch: string; +export interface PullsListParams { + /** Filter pulls by base branch name. Example: \`gh-pages\`. */ + base?: string; + /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ + direction?: DirectionEnum10; + /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ + head?: string; owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). + * @default "created" + */ + sort?: SortEnum9; + /** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ + state?: StateEnum6; } -export type ReposGetAllStatusCheckContextsData = string[]; - -export interface ReposGetAllStatusCheckContextsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +/** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ +export enum PullsListParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type ReposGetAllTopicsData = Topic; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). + * @default "created" + */ +export enum PullsListParams1SortEnum { + Created = "created", + Updated = "updated", + Popularity = "popularity", + LongRunning = "long-running", +} -export interface ReposGetAllTopicsParams { - owner: string; - repo: string; +/** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ +export enum PullsListParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", } -export type ReposGetAppsWithAccessToProtectedBranchData = Integration[]; +export type PullsListRequestedReviewersData = PullRequestReviewRequest; -export interface ReposGetAppsWithAccessToProtectedBranchParams { - /** The name of the branch. */ - branch: string; +export interface PullsListRequestedReviewersParams { owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; } -export type ReposGetBranchData = BranchWithProtection; +export type PullsListReviewCommentsData = PullRequestReviewComment[]; -export interface ReposGetBranchParams { - /** The name of the branch. */ - branch: string; +export type PullsListReviewCommentsForRepoData = PullRequestReviewComment[]; + +export interface PullsListReviewCommentsForRepoParams { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: DirectionEnum11; owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: SortEnum10; } -export type ReposGetBranchProtectionData = BranchProtection; - -export interface ReposGetBranchProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ +export enum PullsListReviewCommentsForRepoParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type ReposGetClonesData = CloneTraffic; +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum PullsListReviewCommentsForRepoParams1SortEnum { + Created = "created", + Updated = "updated", +} -export interface ReposGetClonesParams { +export interface PullsListReviewCommentsParams { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: DirectionEnum12; owner: string; /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * Page number of the results to fetch. + * @default 1 */ - per?: PerEnum; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: SortEnum11; +} + +/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ +export enum PullsListReviewCommentsParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export enum ReposGetClonesParams1PerEnum { - Day = "day", - Week = "week", +export enum PullsListReviewCommentsParams1SortEnum { + Created = "created", + Updated = "updated", } -export type ReposGetCodeFrequencyStatsData = CodeFrequencyStat[]; +export type PullsListReviewsData = PullRequestReview[]; -export interface ReposGetCodeFrequencyStatsParams { +export interface PullsListReviewsParams { owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pullNumber: number; repo: string; } -export type ReposGetCollaboratorPermissionLevelData = - RepositoryCollaboratorPermission; +export type PullsMergeData = PullRequestMergeResult; -export interface ReposGetCollaboratorPermissionLevelParams { - owner: string; - repo: string; - username: string; -} +export type PullsMergeError = { + documentation_url?: string; + message?: string; +}; -export type ReposGetCombinedStatusForRefData = CombinedCommitStatus; +/** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ +export enum PullsMergeMergeMethodEnum { + Merge = "merge", + Squash = "squash", + Rebase = "rebase", +} -export interface ReposGetCombinedStatusForRefParams { +export interface PullsMergeParams { owner: string; - /** ref+ parameter */ - ref: string; + pullNumber: number; repo: string; } -export type ReposGetCommitActivityStatsData = CommitActivity[]; +export type PullsMergePayload = { + /** Extra detail to append to automatic commit message. */ + commit_message?: string; + /** Title for the automatic commit message. */ + commit_title?: string; + /** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ + merge_method?: PullsMergeMergeMethodEnum; + /** SHA that pull request head must match to allow merge. */ + sha?: string; +} | null; -export interface ReposGetCommitActivityStatsParams { +export type PullsRemoveRequestedReviewersData = any; + +export interface PullsRemoveRequestedReviewersParams { owner: string; + pullNumber: number; repo: string; } -export type ReposGetCommitCommentData = CommitComment; - -export interface ReposGetCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export interface PullsRemoveRequestedReviewersPayload { + /** An array of user \`login\`s that will be removed. */ + reviewers?: string[]; + /** An array of team \`slug\`s that will be removed. */ + team_reviewers?: string[]; } -export type ReposGetCommitData = Commit; +export type PullsRequestReviewersData = PullRequestSimple; -export interface ReposGetCommitParams { +export interface PullsRequestReviewersParams { owner: string; - /** ref+ parameter */ - ref: string; + pullNumber: number; repo: string; } -export type ReposGetCommitSignatureProtectionData = - ProtectedBranchAdminEnforced; - -export interface ReposGetCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface PullsRequestReviewersPayload { + /** An array of user \`login\`s that will be requested. */ + reviewers?: string[]; + /** An array of team \`slug\`s that will be requested. */ + team_reviewers?: string[]; } -export type ReposGetCommunityProfileMetricsData = CommunityProfile; +export type PullsSubmitReviewData = PullRequestReview; -export interface ReposGetCommunityProfileMetricsParams { - owner: string; - repo: string; +/** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ +export enum PullsSubmitReviewEventEnum { + APPROVE = "APPROVE", + REQUEST_CHANGES = "REQUEST_CHANGES", + COMMENT = "COMMENT", } -export type ReposGetContentData = ContentTree; - -export interface ReposGetContentParams { +export interface PullsSubmitReviewParams { owner: string; - /** path+ parameter */ - path: string; - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposGetContributorsStatsData = ContributorActivity[]; +export interface PullsSubmitReviewPayload { + /** The body text of the pull request review */ + body?: string; + /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ + event: PullsSubmitReviewEventEnum; +} -export interface ReposGetContributorsStatsParams { +export interface PullsUpdateBranchData { + message?: string; + url?: string; +} + +export interface PullsUpdateBranchParams { owner: string; + pullNumber: number; repo: string; } -export type ReposGetData = FullRepository; - -export type ReposGetDeployKeyData = DeployKey; +export type PullsUpdateBranchPayload = { + /** The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a \`422 Unprocessable Entity\` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ + expected_head_sha?: string; +} | null; -export interface ReposGetDeployKeyParams { - /** key_id parameter */ - keyId: number; +export type PullsUpdateData = PullRequest; + +export interface PullsUpdateParams { owner: string; + pullNumber: number; repo: string; } -export type ReposGetDeploymentData = Deployment; +export interface PullsUpdatePayload { + /** The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ + base?: string; + /** The contents of the pull request. */ + body?: string; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + /** State of this Pull Request. Either \`open\` or \`closed\`. */ + state?: PullsUpdateStateEnum; + /** The title of the pull request. */ + title?: string; +} -export interface ReposGetDeploymentParams { - /** deployment_id parameter */ - deploymentId: number; +export type PullsUpdateReviewCommentData = PullRequestReviewComment; + +export interface PullsUpdateReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposGetDeploymentStatusData = DeploymentStatus; +export interface PullsUpdateReviewCommentPayload { + /** The text of the reply to the review comment. */ + body: string; +} -export interface ReposGetDeploymentStatusParams { - /** deployment_id parameter */ - deploymentId: number; +export type PullsUpdateReviewData = PullRequestReview; + +export interface PullsUpdateReviewParams { owner: string; + pullNumber: number; repo: string; - statusId: number; + /** review_id parameter */ + reviewId: number; } -export type ReposGetLatestPagesBuildData = PageBuild; +export interface PullsUpdateReviewPayload { + /** The body text of the pull request review. */ + body: string; +} -export interface ReposGetLatestPagesBuildParams { - owner: string; - repo: string; +/** State of this Pull Request. Either \`open\` or \`closed\`. */ +export enum PullsUpdateStateEnum { + Open = "open", + Closed = "closed", } -export type ReposGetLatestReleaseData = Release; +/** Rate Limit */ +export interface RateLimit { + limit: number; + remaining: number; + reset: number; +} -export interface ReposGetLatestReleaseParams { - owner: string; - repo: string; +export type RateLimitGetData = RateLimitOverview; + +/** + * Rate Limit Overview + * Rate Limit Overview + */ +export interface RateLimitOverview { + rate: RateLimit; + resources: { + code_scanning_upload?: RateLimit; + core: RateLimit; + graphql?: RateLimit; + integration_manifest?: RateLimit; + search: RateLimit; + source_import?: RateLimit; + }; } -export type ReposGetPagesBuildData = PageBuild; +/** + * Reaction + * Reactions to conversations provide a way to help people express their feelings more simply and effectively. + */ +export interface Reaction { + /** + * The reaction to use + * @example "heart" + */ + content: ReactionContentEnum; + /** + * @format date-time + * @example "2016-05-20T20:09:31Z" + */ + created_at: string; + /** @example 1 */ + id: number; + /** @example "MDg6UmVhY3Rpb24x" */ + node_id: string; + user: SimpleUser | null; +} -export interface ReposGetPagesBuildParams { - buildId: number; - owner: string; - repo: string; +/** + * The reaction to use + * @example "heart" + */ +export enum ReactionContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetPagesData = Page; +/** Reaction Rollup */ +export interface ReactionRollup { + "+1": number; + "-1": number; + confused: number; + eyes: number; + heart: number; + hooray: number; + laugh: number; + rocket: number; + total_count: number; + /** @format uri */ + url: string; +} -export interface ReposGetPagesParams { - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ +export enum ReactionsCreateForCommitCommentContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export interface ReposGetParams { +export type ReactionsCreateForCommitCommentData = Reaction; + +export interface ReactionsCreateForCommitCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposGetParticipationStatsData = ParticipationStats; +export interface ReactionsCreateForCommitCommentPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ + content: ReactionsCreateForCommitCommentContentEnum; +} -export interface ReposGetParticipationStatsParams { - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ +export enum ReactionsCreateForIssueCommentContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetPullRequestReviewProtectionData = - ProtectedBranchPullRequestReview; +export type ReactionsCreateForIssueCommentData = Reaction; -export interface ReposGetPullRequestReviewProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReactionsCreateForIssueCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposGetPunchCardStatsData = CodeFrequencyStat[]; +export interface ReactionsCreateForIssueCommentPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ + content: ReactionsCreateForIssueCommentContentEnum; +} -export interface ReposGetPunchCardStatsParams { - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ +export enum ReactionsCreateForIssueContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetReadmeData = ContentFile; +export type ReactionsCreateForIssueData = Reaction; -export interface ReposGetReadmeParams { +export interface ReactionsCreateForIssueParams { + /** issue_number parameter */ + issueNumber: number; owner: string; - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; repo: string; } -export type ReposGetReleaseAssetData = ReleaseAsset; +export interface ReactionsCreateForIssuePayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ + content: ReactionsCreateForIssueContentEnum; +} -export interface ReposGetReleaseAssetParams { - /** asset_id parameter */ - assetId: number; - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ +export enum ReactionsCreateForPullRequestReviewCommentContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetReleaseByTagData = Release; +export type ReactionsCreateForPullRequestReviewCommentData = Reaction; -export interface ReposGetReleaseByTagParams { +export interface ReactionsCreateForPullRequestReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; - /** tag+ parameter */ - tag: string; } -export type ReposGetReleaseData = Release; +export interface ReactionsCreateForPullRequestReviewCommentPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ + content: ReactionsCreateForPullRequestReviewCommentContentEnum; +} -export interface ReposGetReleaseParams { - owner: string; - /** release_id parameter */ - releaseId: number; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ +export enum ReactionsCreateForTeamDiscussionCommentInOrgContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetStatusChecksProtectionData = StatusCheckPolicy; +export type ReactionsCreateForTeamDiscussionCommentInOrgData = Reaction; -export interface ReposGetStatusChecksProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface ReactionsCreateForTeamDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; } -export type ReposGetTeamsWithAccessToProtectedBranchData = Team[]; +export interface ReactionsCreateForTeamDiscussionCommentInOrgPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: ReactionsCreateForTeamDiscussionCommentInOrgContentEnum; +} -export interface ReposGetTeamsWithAccessToProtectedBranchParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ +export enum ReactionsCreateForTeamDiscussionCommentLegacyContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetTopPathsData = ContentTraffic[]; +export type ReactionsCreateForTeamDiscussionCommentLegacyData = Reaction; -export interface ReposGetTopPathsParams { - owner: string; - repo: string; +export interface ReactionsCreateForTeamDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; } -export type ReposGetTopReferrersData = ReferrerTraffic[]; +export interface ReactionsCreateForTeamDiscussionCommentLegacyPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: ReactionsCreateForTeamDiscussionCommentLegacyContentEnum; +} -export interface ReposGetTopReferrersParams { - owner: string; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ +export enum ReactionsCreateForTeamDiscussionInOrgContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetUsersWithAccessToProtectedBranchData = SimpleUser[]; +export type ReactionsCreateForTeamDiscussionInOrgData = Reaction; -export interface ReposGetUsersWithAccessToProtectedBranchParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface ReactionsCreateForTeamDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; } -export type ReposGetViewsData = ViewTraffic; +export interface ReactionsCreateForTeamDiscussionInOrgPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: ReactionsCreateForTeamDiscussionInOrgContentEnum; +} -export interface ReposGetViewsParams { - owner: string; - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: PerEnum1; - repo: string; +/** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ +export enum ReactionsCreateForTeamDiscussionLegacyContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -/** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ -export enum ReposGetViewsParams1PerEnum { - Day = "day", - Week = "week", +export type ReactionsCreateForTeamDiscussionLegacyData = Reaction; + +export interface ReactionsCreateForTeamDiscussionLegacyParams { + discussionNumber: number; + teamId: number; } -export type ReposGetWebhookConfigForRepoData = WebhookConfig; +export interface ReactionsCreateForTeamDiscussionLegacyPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: ReactionsCreateForTeamDiscussionLegacyContentEnum; +} -export interface ReposGetWebhookConfigForRepoParams { - hookId: number; +export type ReactionsDeleteForCommitCommentData = any; + +export interface ReactionsDeleteForCommitCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; } -export type ReposGetWebhookData = Hook; +export type ReactionsDeleteForIssueCommentData = any; -export interface ReposGetWebhookParams { - hookId: number; +export interface ReactionsDeleteForIssueCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; } -export type ReposListBranchesData = ShortBranch[]; - -export type ReposListBranchesForHeadCommitData = BranchShort[]; +export type ReactionsDeleteForIssueData = any; -export interface ReposListBranchesForHeadCommitParams { - /** commit_sha parameter */ - commitSha: string; +export interface ReactionsDeleteForIssueParams { + /** issue_number parameter */ + issueNumber: number; owner: string; + reactionId: number; repo: string; } -export interface ReposListBranchesParams { +export type ReactionsDeleteForPullRequestCommentData = any; + +export interface ReactionsDeleteForPullRequestCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ - protected?: boolean; + reactionId: number; repo: string; } -export type ReposListCollaboratorsData = Collaborator[]; +export type ReactionsDeleteForTeamDiscussionCommentData = any; -export interface ReposListCollaboratorsParams { - /** - * Filter collaborators returned by their affiliation. Can be one of: - * \\* \`outside\`: All outside collaborators of an organization-owned repository. - * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: AffiliationEnum1; +export interface ReactionsDeleteForTeamDiscussionCommentParams { + commentNumber: number; + discussionNumber: number; + org: string; + reactionId: number; + /** team_slug parameter */ + teamSlug: string; +} + +export type ReactionsDeleteForTeamDiscussionData = any; + +export interface ReactionsDeleteForTeamDiscussionParams { + discussionNumber: number; + org: string; + reactionId: number; + /** team_slug parameter */ + teamSlug: string; +} + +export type ReactionsDeleteLegacyData = any; + +export interface ReactionsDeleteLegacyParams { + reactionId: number; +} + +export type ReactionsListForCommitCommentData = Reaction[]; + +export interface ReactionsListForCommitCommentParams { + /** comment_id parameter */ + commentId: number; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ + content?: ContentEnum2; owner: string; /** * Page number of the results to fetch. @@ -28401,24 +28556,25 @@ export interface ReposListCollaboratorsParams { repo: string; } -/** - * Filter collaborators returned by their affiliation. Can be one of: - * \\* \`outside\`: All outside collaborators of an organization-owned repository. - * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ -export enum ReposListCollaboratorsParams1AffiliationEnum { - Outside = "outside", - Direct = "direct", - All = "all", +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ +export enum ReactionsListForCommitCommentParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListCommentsForCommitData = CommitComment[]; +export type ReactionsListForIssueCommentData = Reaction[]; -export interface ReposListCommentsForCommitParams { - /** commit_sha parameter */ - commitSha: string; +export interface ReactionsListForIssueCommentParams { + /** comment_id parameter */ + commentId: number; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ + content?: ContentEnum3; owner: string; /** * Page number of the results to fetch. @@ -28433,9 +28589,25 @@ export interface ReposListCommentsForCommitParams { repo: string; } -export type ReposListCommitCommentsForRepoData = CommitComment[]; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ +export enum ReactionsListForIssueCommentParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", +} -export interface ReposListCommitCommentsForRepoParams { +export type ReactionsListForIssueData = Reaction[]; + +export interface ReactionsListForIssueParams { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ + content?: ContentEnum4; + /** issue_number parameter */ + issueNumber: number; owner: string; /** * Page number of the results to fetch. @@ -28450,57 +28622,25 @@ export interface ReposListCommitCommentsForRepoParams { repo: string; } -export type ReposListCommitStatusesForRefData = Status[]; - -export interface ReposListCommitStatusesForRefParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** ref+ parameter */ - ref: string; - repo: string; -} - -export type ReposListCommitsData = Commit[]; - -export interface ReposListCommitsParams { - /** GitHub login or email address by which to filter by commit author. */ - author?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** Only commits containing this file path will be returned. */ - path?: string; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ - sha?: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - until?: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ +export enum ReactionsListForIssueParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListContributorsData = Contributor[]; +export type ReactionsListForPullRequestReviewCommentData = Reaction[]; -export interface ReposListContributorsParams { - /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ - anon?: string; +export interface ReactionsListForPullRequestReviewCommentParams { + /** comment_id parameter */ + commentId: number; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ + content?: ContentEnum5; owner: string; /** * Page number of the results to fetch. @@ -28515,29 +28655,26 @@ export interface ReposListContributorsParams { repo: string; } -export type ReposListDeployKeysData = DeployKey[]; - -export interface ReposListDeployKeysParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ +export enum ReactionsListForPullRequestReviewCommentParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListDeploymentStatusesData = DeploymentStatus[]; +export type ReactionsListForTeamDiscussionCommentInOrgData = Reaction[]; -export interface ReposListDeploymentStatusesParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; +export interface ReactionsListForTeamDiscussionCommentInOrgParams { + commentNumber: number; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: ContentEnum; + discussionNumber: number; + org: string; /** * Page number of the results to fetch. * @default 1 @@ -28548,61 +28685,29 @@ export interface ReposListDeploymentStatusesParams { * @default 30 */ per_page?: number; - repo: string; + /** team_slug parameter */ + teamSlug: string; } -export type ReposListDeploymentsData = Deployment[]; - -export interface ReposListDeploymentsParams { - /** - * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). - * @default "none" - */ - environment?: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * The name of the ref. This can be a branch, tag, or SHA. - * @default "none" - */ - ref?: string; - repo: string; - /** - * The SHA recorded at creation time. - * @default "none" - */ - sha?: string; - /** - * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "none" - */ - task?: string; +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ +export enum ReactionsListForTeamDiscussionCommentInOrgParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListForAuthenticatedUserData = Repository[]; +export type ReactionsListForTeamDiscussionCommentLegacyData = Reaction[]; -export interface ReposListForAuthenticatedUserParams { - /** - * Comma-separated list of values. Can include: - * \\* \`owner\`: Repositories that are owned by the authenticated user. - * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. - * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. - * @default "owner,collaborator,organization_member" - */ - affiliation?: string; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: DirectionEnum16; +export interface ReactionsListForTeamDiscussionCommentLegacyParams { + commentNumber: number; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: ContentEnum6; + discussionNumber: number; /** * Page number of the results to fetch. * @default 1 @@ -28613,73 +28718,27 @@ export interface ReposListForAuthenticatedUserParams { * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: SortEnum19; - /** - * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` - * - * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. - * @default "all" - */ - type?: TypeEnum1; - /** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ - visibility?: VisibilityEnum; -} - -/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ -export enum ReposListForAuthenticatedUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ -export enum ReposListForAuthenticatedUserParams1SortEnum { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", -} - -/** - * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` - * - * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. - * @default "all" - */ -export enum ReposListForAuthenticatedUserParams1TypeEnum { - All = "all", - Owner = "owner", - Public = "public", - Private = "private", - Member = "member", + teamId: number; } -/** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ -export enum ReposListForAuthenticatedUserParams1VisibilityEnum { - All = "all", - Public = "public", - Private = "private", +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ +export enum ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListForOrgData = MinimalRepository[]; +export type ReactionsListForTeamDiscussionInOrgData = Reaction[]; -export interface ReposListForOrgParams { - /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ - direction?: DirectionEnum4; +export interface ReactionsListForTeamDiscussionInOrgParams { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: ContentEnum1; + discussionNumber: number; org: string; /** * Page number of the results to fetch. @@ -28691,48 +28750,28 @@ export interface ReposListForOrgParams { * @default 30 */ per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ - sort?: SortEnum4; - /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ - type?: TypeEnum; -} - -/** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ -export enum ReposListForOrgParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ -export enum ReposListForOrgParams1SortEnum { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", + /** team_slug parameter */ + teamSlug: string; } -/** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ -export enum ReposListForOrgParams1TypeEnum { - All = "all", - Public = "public", - Private = "private", - Forks = "forks", - Sources = "sources", - Member = "member", - Internal = "internal", +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ +export enum ReactionsListForTeamDiscussionInOrgParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposListForUserData = MinimalRepository[]; +export type ReactionsListForTeamDiscussionLegacyData = Reaction[]; -export interface ReposListForUserParams { - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: DirectionEnum18; +export interface ReactionsListForTeamDiscussionLegacyParams { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: ContentEnum7; + discussionNumber: number; /** * Page number of the results to fetch. * @default 1 @@ -28743,281 +28782,246 @@ export interface ReposListForUserParams { * @default 30 */ per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: SortEnum21; - /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" - */ - type?: TypeEnum2; - username: string; -} - -/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ -export enum ReposListForUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", + teamId: number; } -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ -export enum ReposListForUserParams1SortEnum { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", +/** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ +export enum ReactionsListForTeamDiscussionLegacyParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" + * Referrer Traffic + * Referrer Traffic */ -export enum ReposListForUserParams1TypeEnum { - All = "all", - Owner = "owner", - Member = "member", -} - -export type ReposListForksData = MinimalRepository[]; - -export interface ReposListForksParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; - /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ - sort?: SortEnum5; +export interface ReferrerTraffic { + /** @example 4 */ + count: number; + /** @example "Google" */ + referrer: string; + /** @example 3 */ + uniques: number; } /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" + * Release + * A release. */ -export enum ReposListForksParams1SortEnum { - Newest = "newest", - Oldest = "oldest", - Stargazers = "stargazers", -} - -export type ReposListInvitationsData = RepositoryInvitation[]; - -export type ReposListInvitationsForAuthenticatedUserData = - RepositoryInvitation[]; - -export interface ReposListInvitationsForAuthenticatedUserParams { +export interface Release { + assets: ReleaseAsset[]; + /** @format uri */ + assets_url: string; + /** Simple User */ + author: SimpleUser; + body?: string | null; + body_html?: string; + body_text?: string; + /** @format date-time */ + created_at: string; /** - * Page number of the results to fetch. - * @default 1 + * true to create a draft (unpublished) release, false to create a published one. + * @example false */ - page?: number; + draft: boolean; + /** @format uri */ + html_url: string; + id: number; + name: string | null; + node_id: string; /** - * Results per page (max 100) - * @default 30 + * Whether to identify the release as a prerelease or a full release. + * @example false */ - per_page?: number; -} - -export interface ReposListInvitationsParams { - owner: string; + prerelease: boolean; + /** @format date-time */ + published_at: string | null; /** - * Page number of the results to fetch. - * @default 1 + * The name of the tag. + * @example "v1.0.0" */ - page?: number; + tag_name: string; + /** @format uri */ + tarball_url: string | null; /** - * Results per page (max 100) - * @default 30 + * Specifies the commitish value that determines where the Git tag is created from. + * @example "master" */ - per_page?: number; - repo: string; -} - -export type ReposListLanguagesData = Language; - -export interface ReposListLanguagesParams { - owner: string; - repo: string; + target_commitish: string; + upload_url: string; + /** @format uri */ + url: string; + /** @format uri */ + zipball_url: string | null; } -export type ReposListPagesBuildsData = PageBuild[]; - -export interface ReposListPagesBuildsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +/** + * Release Asset + * Data related to a release. + */ +export interface ReleaseAsset { + /** @format uri */ + browser_download_url: string; + content_type: string; + /** @format date-time */ + created_at: string; + download_count: number; + id: number; + label: string | null; /** - * Results per page (max 100) - * @default 30 + * The file name of the asset. + * @example "Team Environment" */ - per_page?: number; - repo: string; + name: string; + node_id: string; + size: number; + /** State of the release asset. */ + state: ReleaseAssetStateEnum; + /** @format date-time */ + updated_at: string; + uploader: SimpleUser | null; + /** @format uri */ + url: string; } -export type ReposListPublicData = MinimalRepository[]; - -export interface ReposListPublicParams { - /** A repository ID. Only return repositories with an ID greater than this ID. */ - since?: number; +/** State of the release asset. */ +export enum ReleaseAssetStateEnum { + Uploaded = "uploaded", + Open = "open", } -export type ReposListPullRequestsAssociatedWithCommitData = PullRequestSimple[]; - -export interface ReposListPullRequestsAssociatedWithCommitParams { - /** commit_sha parameter */ - commitSha: string; - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type ReposListReleaseAssetsData = ReleaseAsset[]; - -export interface ReposListReleaseAssetsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** release_id parameter */ - releaseId: number; - repo: string; -} - -export type ReposListReleasesData = Release[]; - -export interface ReposListReleasesParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type ReposListTagsData = Tag[]; - -export interface ReposListTagsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type ReposListTeamsData = Team[]; - -export interface ReposListTeamsParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type ReposListWebhooksData = Hook[]; - -export interface ReposListWebhooksParams { - owner: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - repo: string; -} - -export type ReposMergeData = Commit; - -export type ReposMergeError = { - /** @example ""https://docs.github.com/rest/reference/repos#perform-a-merge"" */ - documentation_url?: string; - message?: string; -}; - -export interface ReposMergeParams { - owner: string; - repo: string; -} - -export interface ReposMergePayload { - /** The name of the base branch that the head will be merged into. */ - base: string; - /** Commit message to use for the merge commit. If omitted, a default message will be used. */ - commit_message?: string; - /** The head to merge. This can be a branch name or a commit SHA1. */ - head: string; +/** + * Repo Search Result Item + * Repo Search Result Item + */ +export interface RepoSearchResultItem { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + delete_branch_on_merge?: boolean; + /** @format uri */ + deployments_url: string; + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + score: number; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + text_matches?: SearchResultTextMatches; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; } -export type ReposPingWebhookData = any; +export type ReposAcceptInvitationData = any; -export interface ReposPingWebhookParams { - hookId: number; - owner: string; - repo: string; +export interface ReposAcceptInvitationParams { + /** invitation_id parameter */ + invitationId: number; } -export type ReposRemoveAppAccessRestrictionsData = Integration[]; +export type ReposAddAppAccessRestrictionsData = Integration[]; -export interface ReposRemoveAppAccessRestrictionsParams { +export interface ReposAddAppAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; @@ -29025,22 +29029,54 @@ export interface ReposRemoveAppAccessRestrictionsParams { } /** @example {"apps":["my-app"]} */ -export interface ReposRemoveAppAccessRestrictionsPayload { +export interface ReposAddAppAccessRestrictionsPayload { /** apps parameter */ apps: string[]; } -export type ReposRemoveCollaboratorData = any; +export type ReposAddCollaboratorData = RepositoryInvitation; -export interface ReposRemoveCollaboratorParams { +export interface ReposAddCollaboratorParams { owner: string; repo: string; username: string; } -export type ReposRemoveStatusCheckContextsData = string[]; +export interface ReposAddCollaboratorPayload { + /** + * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: + * \\* \`pull\` - can pull, but not push to or administer this repository. + * \\* \`push\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push and administer this repository. + * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. + * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. + * @default "push" + */ + permission?: ReposAddCollaboratorPermissionEnum; + /** @example ""push"" */ + permissions?: string; +} -export interface ReposRemoveStatusCheckContextsParams { +/** + * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: + * \\* \`pull\` - can pull, but not push to or administer this repository. + * \\* \`push\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push and administer this repository. + * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. + * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. + * @default "push" + */ +export enum ReposAddCollaboratorPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", + Maintain = "maintain", + Triage = "triage", +} + +export type ReposAddStatusCheckContextsData = string[]; + +export interface ReposAddStatusCheckContextsParams { /** The name of the branch. */ branch: string; owner: string; @@ -29048,23 +29084,14 @@ export interface ReposRemoveStatusCheckContextsParams { } /** @example {"contexts":["contexts"]} */ -export interface ReposRemoveStatusCheckContextsPayload { +export interface ReposAddStatusCheckContextsPayload { /** contexts parameter */ contexts: string[]; } -export type ReposRemoveStatusCheckProtectionData = any; - -export interface ReposRemoveStatusCheckProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export type ReposRemoveTeamAccessRestrictionsData = Team[]; +export type ReposAddTeamAccessRestrictionsData = Team[]; -export interface ReposRemoveTeamAccessRestrictionsParams { +export interface ReposAddTeamAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; @@ -29072,14 +29099,14 @@ export interface ReposRemoveTeamAccessRestrictionsParams { } /** @example {"teams":["my-team"]} */ -export interface ReposRemoveTeamAccessRestrictionsPayload { +export interface ReposAddTeamAccessRestrictionsPayload { /** teams parameter */ teams: string[]; } -export type ReposRemoveUserAccessRestrictionsData = SimpleUser[]; +export type ReposAddUserAccessRestrictionsData = SimpleUser[]; -export interface ReposRemoveUserAccessRestrictionsParams { +export interface ReposAddUserAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; @@ -29087,268 +29114,359 @@ export interface ReposRemoveUserAccessRestrictionsParams { } /** @example {"users":["mona"]} */ -export interface ReposRemoveUserAccessRestrictionsPayload { +export interface ReposAddUserAccessRestrictionsPayload { /** users parameter */ users: string[]; } -export type ReposRenameBranchData = BranchWithProtection; - -export interface ReposRenameBranchParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export interface ReposRenameBranchPayload { - /** The new name of the branch. */ - new_name: string; -} - -export type ReposReplaceAllTopicsData = Topic; +export type ReposCheckCollaboratorData = any; -export interface ReposReplaceAllTopicsParams { +export interface ReposCheckCollaboratorParams { owner: string; repo: string; + username: string; } -export interface ReposReplaceAllTopicsPayload { - /** An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (\`[]\`) to clear all topics from the repository. **Note:** Topic \`names\` cannot contain uppercase letters. */ - names: string[]; -} - -export type ReposRequestPagesBuildData = PageBuildStatus; +export type ReposCheckVulnerabilityAlertsData = any; -export interface ReposRequestPagesBuildParams { +export interface ReposCheckVulnerabilityAlertsParams { owner: string; repo: string; } -export type ReposSetAdminBranchProtectionData = ProtectedBranchAdminEnforced; +export type ReposCompareCommitsData = CommitComparison; -export interface ReposSetAdminBranchProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReposCompareCommitsParams { + base: string; + head: string; owner: string; repo: string; } -export type ReposSetAppAccessRestrictionsData = Integration[]; +export type ReposCreateCommitCommentData = CommitComment; -export interface ReposSetAppAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export interface ReposCreateCommitCommentParams { + /** commit_sha parameter */ + commitSha: string; owner: string; repo: string; } -/** @example {"apps":["my-app"]} */ -export interface ReposSetAppAccessRestrictionsPayload { - /** apps parameter */ - apps: string[]; +export interface ReposCreateCommitCommentPayload { + /** The contents of the comment. */ + body: string; + /** **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ + line?: number; + /** Relative path of the file to comment on. */ + path?: string; + /** Line index in the diff to comment on. */ + position?: number; } -export type ReposSetStatusCheckContextsData = string[]; +export type ReposCreateCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; -export interface ReposSetStatusCheckContextsParams { +export interface ReposCreateCommitSignatureProtectionParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -/** @example {"contexts":["contexts"]} */ -export interface ReposSetStatusCheckContextsPayload { - /** contexts parameter */ - contexts: string[]; -} - -export type ReposSetTeamAccessRestrictionsData = Team[]; +export type ReposCreateCommitStatusData = Status; -export interface ReposSetTeamAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export interface ReposCreateCommitStatusParams { owner: string; repo: string; + sha: string; } -/** @example {"teams":["my-team"]} */ -export interface ReposSetTeamAccessRestrictionsPayload { - /** teams parameter */ - teams: string[]; +export interface ReposCreateCommitStatusPayload { + /** + * A string label to differentiate this status from the status of other systems. This field is case-insensitive. + * @default "default" + */ + context?: string; + /** A short description of the status. */ + description?: string; + /** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ + state: ReposCreateCommitStatusStateEnum; + /** + * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. + * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: + * \`http://ci.example.com/user/repo/build/sha\` + */ + target_url?: string; } -export type ReposSetUserAccessRestrictionsData = SimpleUser[]; +/** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ +export enum ReposCreateCommitStatusStateEnum { + Error = "error", + Failure = "failure", + Pending = "pending", + Success = "success", +} -export interface ReposSetUserAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export type ReposCreateDeployKeyData = DeployKey; + +export interface ReposCreateDeployKeyParams { owner: string; repo: string; } -/** @example {"users":["mona"]} */ -export interface ReposSetUserAccessRestrictionsPayload { - /** users parameter */ - users: string[]; +export interface ReposCreateDeployKeyPayload { + /** The contents of the key. */ + key: string; + /** + * If \`true\`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * + * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." + */ + read_only?: boolean; + /** A name for the key. */ + title?: string; } -export type ReposTestPushWebhookData = any; - -export interface ReposTestPushWebhookParams { - hookId: number; - owner: string; - repo: string; -} +export type ReposCreateDeploymentData = Deployment; -export type ReposTransferData = Repository; +export type ReposCreateDeploymentError = { + /** @example ""https://docs.github.com/rest/reference/repos#create-a-deployment"" */ + documentation_url?: string; + message?: string; +}; -export interface ReposTransferParams { +export interface ReposCreateDeploymentParams { owner: string; repo: string; } -export interface ReposTransferPayload { - /** The username or organization name the repository will be transferred to. */ - new_owner: string; - /** ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ - team_ids?: number[]; +export interface ReposCreateDeploymentPayload { + /** + * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. + * @default true + */ + auto_merge?: boolean; + /** @example ""1776-07-04T00:00:00.000-07:52"" */ + created_at?: string; + /** + * Short description of the deployment. + * @default "" + */ + description?: string | null; + /** + * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). + * @default "production" + */ + environment?: string; + /** JSON payload with extra information about the deployment. */ + payload?: Record | string; + /** + * Specifies if the given environment is one that end-users directly interact with. Default: \`true\` when \`environment\` is \`production\` and \`false\` otherwise. + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + production_environment?: boolean; + /** The ref to deploy. This can be a branch, tag, or SHA. */ + ref: string; + /** The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ + required_contexts?: string[]; + /** + * Specifies a task to execute (e.g., \`deploy\` or \`deploy:migrations\`). + * @default "deploy" + */ + task?: string; + /** + * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: \`false\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default false + */ + transient_environment?: boolean; } -export type ReposUpdateBranchProtectionData = ProtectedBranch; +export type ReposCreateDeploymentStatusData = DeploymentStatus; -export interface ReposUpdateBranchProtectionParams { - /** The name of the branch. */ - branch: string; +/** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ +export enum ReposCreateDeploymentStatusEnvironmentEnum { + Production = "production", + Staging = "staging", + Qa = "qa", +} + +export interface ReposCreateDeploymentStatusParams { + /** deployment_id parameter */ + deploymentId: number; owner: string; repo: string; } -export interface ReposUpdateBranchProtectionPayload { - /** Allows deletion of the protected branch by anyone with write access to the repository. Set to \`false\` to prevent deletion of the protected branch. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ - allow_deletions?: boolean; - /** Permits force pushes to the protected branch by anyone with write access to the repository. Set to \`true\` to allow force pushes. Set to \`false\` or \`null\` to block force pushes. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ - allow_force_pushes?: boolean | null; - /** Enforce all configured restrictions for administrators. Set to \`true\` to enforce required status checks for repository administrators. Set to \`null\` to disable. */ - enforce_admins: boolean | null; - /** Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to \`true\` to enforce a linear commit history. Set to \`false\` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: \`false\`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ - required_linear_history?: boolean; - /** Require at least one approving review on a pull request, before merging. Set to \`null\` to disable. */ - required_pull_request_reviews: { - /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ - dismiss_stale_reviews?: boolean; - /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ - dismissal_restrictions?: { - /** The list of team \`slug\`s with dismissal access */ - teams?: string[]; - /** The list of user \`login\`s with dismissal access */ - users?: string[]; - }; - /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ - require_code_owner_reviews?: boolean; - /** Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ - required_approving_review_count?: number; - } | null; - /** Require status checks to pass before merging. Set to \`null\` to disable. */ - required_status_checks: { - /** The list of status checks to require in order to merge into this branch */ - contexts: string[]; - /** Require branches to be up to date before merging. */ - strict: boolean; - } | null; - /** Restrict who can push to the protected branch. User, app, and team \`restrictions\` are only available for organization-owned repositories. Set to \`null\` to disable. */ - restrictions: { - /** The list of app \`slug\`s with push access */ - apps?: string[]; - /** The list of team \`slug\`s with push access */ - teams: string[]; - /** The list of user \`login\`s with push access */ - users: string[]; - } | null; -} - -export type ReposUpdateCommitCommentData = CommitComment; - -export interface ReposUpdateCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export interface ReposCreateDeploymentStatusPayload { + /** + * Adds a new \`inactive\` status to all prior non-transient, non-production environment deployments with the same repository and \`environment\` name as the created status's deployment. An \`inactive\` status is only added to deployments that had a \`success\` state. Default: \`true\` + * **Note:** To add an \`inactive\` status to \`production\` environments, you must use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + auto_inactive?: boolean; + /** + * A short description of the status. The maximum description length is 140 characters. + * @default "" + */ + description?: string; + /** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ + environment?: ReposCreateDeploymentStatusEnvironmentEnum; + /** + * Sets the URL for accessing your environment. Default: \`""\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default "" + */ + environment_url?: string; + /** + * The full URL of the deployment's output. This parameter replaces \`target_url\`. We will continue to accept \`target_url\` to support legacy uses, but we recommend replacing \`target_url\` with \`log_url\`. Setting \`log_url\` will automatically set \`target_url\` to the same value. Default: \`""\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default "" + */ + log_url?: string; + /** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ + state: ReposCreateDeploymentStatusStateEnum; + /** + * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the \`log_url\` parameter, which replaces \`target_url\`. + * @default "" + */ + target_url?: string; } -export interface ReposUpdateCommitCommentPayload { - /** The contents of the comment */ - body: string; +/** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ +export enum ReposCreateDeploymentStatusStateEnum { + Error = "error", + Failure = "failure", + Inactive = "inactive", + InProgress = "in_progress", + Queued = "queued", + Pending = "pending", + Success = "success", } -export type ReposUpdateData = FullRepository; - -export type ReposUpdateInformationAboutPagesSiteData = any; +export type ReposCreateDispatchEventData = any; -export interface ReposUpdateInformationAboutPagesSiteParams { +export interface ReposCreateDispatchEventParams { owner: string; repo: string; } -/** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ -export enum ReposUpdateInformationAboutPagesSitePathEnum { - Value = "/", - ValueDocs = "/docs", +export interface ReposCreateDispatchEventPayload { + /** JSON payload with extra information about the webhook event that your action or worklow may use. */ + client_payload?: Record; + /** A custom webhook event name. */ + event_type: string; } -export interface ReposUpdateInformationAboutPagesSitePayload { - /** Specify a custom domain for the repository. Sending a \`null\` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ - cname?: string | null; - /** Configures access controls for the GitHub Pages site. If public is set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to \`internal\` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ - public?: boolean; - /** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ - source: - | ReposUpdateInformationAboutPagesSiteSourceEnum - | { - /** The repository branch used to publish your site's source files. */ - branch: string; - /** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ - path: ReposUpdateInformationAboutPagesSitePathEnum; - }; -} +export type ReposCreateForAuthenticatedUserData = Repository; -/** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ -export enum ReposUpdateInformationAboutPagesSiteSourceEnum { - GhPages = "gh-pages", - Master = "master", - MasterDocs = "master /docs", +export interface ReposCreateForAuthenticatedUserPayload { + /** + * Whether to allow merge commits for pull requests. + * @default true + * @example true + */ + allow_merge_commit?: boolean; + /** + * Whether to allow rebase merges for pull requests. + * @default true + * @example true + */ + allow_rebase_merge?: boolean; + /** + * Whether to allow squash merges for pull requests. + * @default true + * @example true + */ + allow_squash_merge?: boolean; + /** + * Whether the repository is initialized with a minimal README. + * @default false + */ + auto_init?: boolean; + /** + * Whether to delete head branches when pull requests are merged + * @default false + * @example false + */ + delete_branch_on_merge?: boolean; + /** A short description of the repository. */ + description?: string; + /** + * The desired language or platform to apply to the .gitignore. + * @example "Haskell" + */ + gitignore_template?: string; + /** + * Whether downloads are enabled. + * @default true + * @example true + */ + has_downloads?: boolean; + /** + * Whether issues are enabled. + * @default true + * @example true + */ + has_issues?: boolean; + /** + * Whether projects are enabled. + * @default true + * @example true + */ + has_projects?: boolean; + /** + * Whether the wiki is enabled. + * @default true + * @example true + */ + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true + */ + is_template?: boolean; + /** + * The license keyword of the open source license for this repository. + * @example "mit" + */ + license_template?: string; + /** + * The name of the repository. + * @example "Team Environment" + */ + name: string; + /** + * Whether the repository is private or public. + * @default false + */ + private?: boolean; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; } -export type ReposUpdateInvitationData = RepositoryInvitation; +export type ReposCreateForkData = Repository; -export interface ReposUpdateInvitationParams { - /** invitation_id parameter */ - invitationId: number; +export interface ReposCreateForkParams { owner: string; repo: string; } -export interface ReposUpdateInvitationPayload { - /** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ - permissions?: ReposUpdateInvitationPermissionsEnum; +export interface ReposCreateForkPayload { + /** Optional parameter to specify the organization name if forking into an organization. */ + organization?: string; } -/** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ -export enum ReposUpdateInvitationPermissionsEnum { - Read = "read", - Write = "write", - Maintain = "maintain", - Triage = "triage", - Admin = "admin", -} +export type ReposCreateInOrgData = Repository; -export interface ReposUpdateParams { - owner: string; - repo: string; +export interface ReposCreateInOrgParams { + org: string; } -export interface ReposUpdatePayload { +export interface ReposCreateInOrgPayload { /** * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. * @default true @@ -29365,12 +29483,10 @@ export interface ReposUpdatePayload { */ allow_squash_merge?: boolean; /** - * \`true\` to archive this repository. **Note**: You cannot unarchive repositories through the API. + * Pass \`true\` to create an initial commit with empty README. * @default false */ - archived?: boolean; - /** Updates the default branch for this repository. */ - default_branch?: string; + auto_init?: boolean; /** * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. * @default false @@ -29378,6 +29494,8 @@ export interface ReposUpdatePayload { delete_branch_on_merge?: boolean; /** A short description of the repository. */ description?: string; + /** Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ + gitignore_template?: string; /** * Either \`true\` to enable issues for this repository or \`false\` to disable them. * @default true @@ -29400,1573 +29518,808 @@ export interface ReposUpdatePayload { * @default false */ is_template?: boolean; + /** Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the \`license_template\` string. For example, "mit" or "mpl-2.0". */ + license_template?: string; /** The name of the repository. */ - name?: string; + name: string; /** - * Either \`true\` to make the repository private or \`false\` to make it public. Default: \`false\`. - * **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + * Either \`true\` to create a private repository or \`false\` to create a public one. * @default false */ private?: boolean; - /** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ - visibility?: ReposUpdateVisibilityEnum; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; + /** + * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. + * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. + */ + visibility?: ReposCreateInOrgVisibilityEnum; } -export type ReposUpdatePullRequestReviewProtectionData = - ProtectedBranchPullRequestReview; +/** + * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. + * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. + */ +export enum ReposCreateInOrgVisibilityEnum { + Public = "public", + Private = "private", + Visibility = "visibility", + Internal = "internal", +} -export interface ReposUpdatePullRequestReviewProtectionParams { - /** The name of the branch. */ - branch: string; +export type ReposCreateOrUpdateFileContentsData = FileCommit; + +export interface ReposCreateOrUpdateFileContentsParams { owner: string; + /** path+ parameter */ + path: string; repo: string; } -export interface ReposUpdatePullRequestReviewProtectionPayload { - /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ - dismiss_stale_reviews?: boolean; - /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ - dismissal_restrictions?: { - /** The list of team \`slug\`s with dismissal access */ - teams?: string[]; - /** The list of user \`login\`s with dismissal access */ - users?: string[]; +export interface ReposCreateOrUpdateFileContentsPayload { + /** The author of the file. Default: The \`committer\` or the authenticated user if you omit \`committer\`. */ + author?: { + /** @example ""2013-01-15T17:13:22+05:00"" */ + date?: string; + /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ + email: string; + /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ + name: string; }; - /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ - require_code_owner_reviews?: boolean; - /** Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ - required_approving_review_count?: number; + /** The branch name. Default: the repository’s default branch (usually \`master\`) */ + branch?: string; + /** The person that committed the file. Default: the authenticated user. */ + committer?: { + /** @example ""2013-01-05T13:13:22+05:00"" */ + date?: string; + /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ + email: string; + /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ + name: string; + }; + /** The new file content, using Base64 encoding. */ + content: string; + /** The commit message. */ + message: string; + /** **Required if you are updating a file**. The blob SHA of the file being replaced. */ + sha?: string; } -export type ReposUpdateReleaseAssetData = ReleaseAsset; +export type ReposCreatePagesSiteData = Page; -export interface ReposUpdateReleaseAssetParams { - /** asset_id parameter */ - assetId: number; +export interface ReposCreatePagesSiteParams { owner: string; repo: string; } -export interface ReposUpdateReleaseAssetPayload { - /** An alternate short description of the asset. Used in place of the filename. */ - label?: string; - /** The file name of the asset. */ - name?: string; - /** @example ""uploaded"" */ - state?: string; +/** + * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` + * @default "/" + */ +export enum ReposCreatePagesSitePathEnum { + Value = "/", + ValueDocs = "/docs", } -export type ReposUpdateReleaseData = Release; +/** The source branch and directory used to publish your Pages site. */ +export interface ReposCreatePagesSitePayload { + /** The source branch and directory used to publish your Pages site. */ + source: { + /** The repository branch used to publish your site's source files. */ + branch: string; + /** + * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` + * @default "/" + */ + path?: ReposCreatePagesSitePathEnum; + }; +} -export interface ReposUpdateReleaseParams { +export type ReposCreateReleaseData = Release; + +export interface ReposCreateReleaseParams { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; } -export interface ReposUpdateReleasePayload { +export interface ReposCreateReleasePayload { /** Text describing the contents of the tag. */ body?: string; - /** \`true\` makes the release a draft, and \`false\` publishes the release. */ + /** + * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. + * @default false + */ draft?: boolean; /** The name of the release. */ name?: string; - /** \`true\` to identify the release as a prerelease, \`false\` to identify the release as a full release. */ + /** + * \`true\` to identify the release as a prerelease. \`false\` to identify the release as a full release. + * @default false + */ prerelease?: boolean; /** The name of the tag. */ - tag_name?: string; + tag_name: string; /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ target_commitish?: string; } -export type ReposUpdateStatusCheckProtectionData = StatusCheckPolicy; - -export interface ReposUpdateStatusCheckProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export interface ReposUpdateStatusCheckProtectionPayload { - /** The list of status checks to require in order to merge into this branch */ - contexts?: string[]; - /** Require branches to be up to date before merging. */ - strict?: boolean; -} - -/** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ -export enum ReposUpdateVisibilityEnum { - Public = "public", - Private = "private", - Visibility = "visibility", - Internal = "internal", -} - -export type ReposUpdateWebhookConfigForRepoData = WebhookConfig; +export type ReposCreateUsingTemplateData = Repository; -export interface ReposUpdateWebhookConfigForRepoParams { - hookId: number; - owner: string; - repo: string; +export interface ReposCreateUsingTemplateParams { + templateOwner: string; + templateRepo: string; } -/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ -export interface ReposUpdateWebhookConfigForRepoPayload { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; +export interface ReposCreateUsingTemplatePayload { + /** A short description of the new repository. */ + description?: string; + /** + * Set to \`true\` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: \`false\`. + * @default false + */ + include_all_branches?: boolean; + /** The name of the new repository. */ + name: string; + /** The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ + owner?: string; + /** + * Either \`true\` to create a new private repository or \`false\` to create a new public one. + * @default false + */ + private?: boolean; } -export type ReposUpdateWebhookData = Hook; +export type ReposCreateWebhookData = Hook; -export interface ReposUpdateWebhookParams { - hookId: number; +export interface ReposCreateWebhookParams { owner: string; repo: string; } -export interface ReposUpdateWebhookPayload { +export interface ReposCreateWebhookPayload { /** * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. * @default true */ active?: boolean; - /** Determines a list of events to be added to the list of events that the Hook triggers for. */ - add_events?: string[]; /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ - config?: { - /** @example ""bar@example.com"" */ - address?: string; + config: { /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ content_type?: WebhookConfigContentType; + /** @example ""sha256"" */ + digest?: string; /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""The Serious Room"" */ - room?: string; /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ secret?: WebhookConfigSecret; + /** @example ""abc"" */ + token?: string; /** The URL to which the payloads will be delivered. */ url: WebhookConfigUrl; }; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. * @default ["push"] */ events?: string[]; - /** Determines a list of events to be removed from the list of events that the Hook triggers for. */ - remove_events?: string[]; + /** Use \`web\` to create a webhook. Default: \`web\`. This parameter only accepts the value \`web\`. */ + name?: string; } -export type ReposUploadReleaseAssetData = ReleaseAsset; +export type ReposDeclineInvitationData = any; -export interface ReposUploadReleaseAssetParams { - label?: string; - name?: string; +export interface ReposDeclineInvitationParams { + /** invitation_id parameter */ + invitationId: number; +} + +export type ReposDeleteAccessRestrictionsData = any; + +export interface ReposDeleteAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; owner: string; - /** release_id parameter */ - releaseId: number; repo: string; } -/** The raw file data */ -export type ReposUploadReleaseAssetPayload = string; +export type ReposDeleteAdminBranchProtectionData = any; -/** - * Repository - * A git repository - */ -export interface Repository { - /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true - */ - allow_merge_commit?: boolean; - /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true - */ - allow_rebase_merge?: boolean; - /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true - */ - allow_squash_merge?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - /** - * Whether the repository is archived. - * @default false - */ - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at: string | null; - /** - * The default branch of the repository. - * @example "master" - */ - default_branch: string; - /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false - */ - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" - */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** - * Whether downloads are enabled. - * @default true - * @example true - */ - has_downloads: boolean; - /** - * Whether issues are enabled. - * @default true - * @example true - */ - has_issues: boolean; - has_pages: boolean; - /** - * Whether projects are enabled. - * @default true - * @example true - */ - has_projects: boolean; - /** - * Whether the wiki is enabled. - * @default true - * @example true - */ - has_wiki: boolean; - /** - * @format uri - * @example "https://github.com" - */ - homepage: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" - */ - hooks_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World" - */ - html_url: string; - /** - * Unique identifier of the repository - * @example 42 - */ - id: number; - /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true - */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" - */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" - */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; - /** - * @format uri - * @example "git:git.example.com/octocat/Hello-World" - */ - mirror_url: string | null; - /** - * The name of the repository. - * @example "Team Environment" - */ - name: string; - network_count?: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ - node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - maintain?: boolean; - pull: boolean; - push: boolean; - triage?: boolean; - }; - /** - * Whether the repository is private or public. - * @default false - */ - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; - /** - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - pushed_at: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" - */ - stargazers_url: string; - /** @example ""2020-07-09T00:17:42Z"" */ - starred_at?: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" - */ - subscribers_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" - */ - subscription_url: string; - /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url?: string; - archived?: boolean; - assignees_url?: string; - blobs_url?: string; - branches_url?: string; - clone_url?: string; - collaborators_url?: string; - comments_url?: string; - commits_url?: string; - compare_url?: string; - contents_url?: string; - contributors_url?: string; - created_at?: string; - default_branch?: string; - delete_branch_on_merge?: boolean; - deployments_url?: string; - description?: string; - disabled?: boolean; - downloads_url?: string; - events_url?: string; - fork?: boolean; - forks_count?: number; - forks_url?: string; - full_name?: string; - git_commits_url?: string; - git_refs_url?: string; - git_tags_url?: string; - git_url?: string; - has_downloads?: boolean; - has_issues?: boolean; - has_pages?: boolean; - has_projects?: boolean; - has_wiki?: boolean; - homepage?: string; - hooks_url?: string; - html_url?: string; - id?: number; - is_template?: boolean; - issue_comment_url?: string; - issue_events_url?: string; - issues_url?: string; - keys_url?: string; - labels_url?: string; - language?: string; - languages_url?: string; - merges_url?: string; - milestones_url?: string; - mirror_url?: string; - name?: string; - network_count?: number; - node_id?: string; - notifications_url?: string; - open_issues_count?: number; - owner?: { - avatar_url?: string; - events_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string; - html_url?: string; - id?: number; - login?: string; - node_id?: string; - organizations_url?: string; - received_events_url?: string; - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - subscriptions_url?: string; - type?: string; - url?: string; - }; - permissions?: { - admin?: boolean; - pull?: boolean; - push?: boolean; - }; - private?: boolean; - pulls_url?: string; - pushed_at?: string; - releases_url?: string; - size?: number; - ssh_url?: string; - stargazers_count?: number; - stargazers_url?: string; - statuses_url?: string; - subscribers_count?: number; - subscribers_url?: string; - subscription_url?: string; - svn_url?: string; - tags_url?: string; - teams_url?: string; - temp_clone_token?: string; - topics?: string[]; - trees_url?: string; - updated_at?: string; - url?: string; - visibility?: string; - watchers_count?: number; - } | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - url: string; - /** - * The repository visibility: public, private, or internal. - * @default "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; +export interface ReposDeleteAdminBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Repository Collaborator Permission - * Repository Collaborator Permission - */ -export interface RepositoryCollaboratorPermission { - permission: string; - user: SimpleUser | null; +export type ReposDeleteBranchProtectionData = any; + +export interface ReposDeleteBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Repository Invitation - * Repository invitations let you manage who you collaborate with. - */ -export interface RepositoryInvitation { - /** - * @format date-time - * @example "2016-06-13T14:52:50-05:00" - */ - created_at: string; - /** Whether or not the invitation has expired */ - expired?: boolean; - /** @example "https://github.com/octocat/Hello-World/invitations" */ - html_url: string; - /** - * Unique identifier of the repository invitation. - * @example 42 - */ - id: number; - invitee: SimpleUser | null; - inviter: SimpleUser | null; - node_id: string; - /** - * The permission associated with the invitation. - * @example "read" - */ - permissions: RepositoryInvitationPermissionsEnum; - /** Minimal Repository */ - repository: MinimalRepository; - /** - * URL for the repository invitation - * @example "https://api.github.com/user/repository-invitations/1" - */ - url: string; +export type ReposDeleteCommitCommentData = any; + +export interface ReposDeleteCommitCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; } -/** - * The permission associated with the invitation. - * @example "read" - */ -export enum RepositoryInvitationPermissionsEnum { - Read = "read", - Write = "write", - Admin = "admin", +export type ReposDeleteCommitSignatureProtectionData = any; + +export interface ReposDeleteCommitSignatureProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Repository Invitation - * Repository invitations let you manage who you collaborate with. - */ -export interface RepositorySubscription { - /** - * @format date-time - * @example "2012-10-06T21:34:12Z" - */ - created_at: string; - /** Determines if all notifications should be blocked from this repository. */ - ignored: boolean; - reason: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example" - */ - repository_url: string; - /** - * Determines if notifications should be received from this repository. - * @example true - */ - subscribed: boolean; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/subscription" - */ - url: string; +export type ReposDeleteData = any; + +export type ReposDeleteDeployKeyData = any; + +export interface ReposDeleteDeployKeyParams { + /** key_id parameter */ + keyId: number; + owner: string; + repo: string; } -/** Requires Authentication */ -export type RequiresAuthentication = BasicError; +export type ReposDeleteDeploymentData = any; -/** - * Legacy Review Comment - * Legacy Review Comment - */ -export interface ReviewComment { - _links: { - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - pull_request: Link; - /** Hypermedia Link */ - self: Link; - }; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** @example "Great stuff" */ - body: string; - body_html?: string; - body_text?: string; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_id: string; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - created_at: string; - /** @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." */ - diff_hunk: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" - */ - html_url: string; - /** @example 10 */ - id: number; - /** @example 8 */ - in_reply_to_id?: number; - /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - line?: number; - /** @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" */ - node_id: string; - /** @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" */ - original_commit_id: string; - /** - * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - original_line?: number; - /** @example 4 */ - original_position: number; - /** - * The original first line of the range for a multi-line comment. - * @example 2 - */ - original_start_line?: number | null; - /** @example "file1.txt" */ +export interface ReposDeleteDeploymentParams { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; +} + +export type ReposDeleteError = { + documentation_url?: string; + message?: string; +}; + +export type ReposDeleteFileData = FileCommit; + +export interface ReposDeleteFileParams { + owner: string; + /** path+ parameter */ path: string; - /** @example 1 */ - position: number | null; - /** @example 42 */ - pull_request_review_id: number | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" - */ - pull_request_url: string; - /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" - */ - side?: ReviewCommentSideEnum; - /** - * The first line of the range for a multi-line comment. - * @example 2 - */ - start_line?: number | null; - /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" - */ - start_side?: ReviewCommentStartSideEnum | null; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" - */ - url: string; - user: SimpleUser | null; + repo: string; } -/** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" - */ -export enum ReviewCommentSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +export interface ReposDeleteFilePayload { + /** object containing information about the author. */ + author?: { + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The branch name. Default: the repository’s default branch (usually \`master\`) */ + branch?: string; + /** object containing information about the committer. */ + committer?: { + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The commit message. */ + message: string; + /** The blob SHA of the file being replaced. */ + sha: string; } -/** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" - */ -export enum ReviewCommentStartSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +export type ReposDeleteInvitationData = any; + +export interface ReposDeleteInvitationParams { + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; } -/** - * Filter members returned by their role. Can be one of: - * \\* \`all\` - All members of the organization, regardless of role. - * \\* \`admin\` - Organization owners. - * \\* \`member\` - Non-owner organization members. - * @default "all" - */ -export enum RoleEnum { - All = "all", - Admin = "admin", - Member = "member", +export type ReposDeletePagesSiteData = any; + +export interface ReposDeletePagesSiteParams { + owner: string; + repo: string; } -/** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ -export enum RoleEnum1 { - Member = "member", - Maintainer = "maintainer", - All = "all", +export interface ReposDeleteParams { + owner: string; + repo: string; } -/** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ -export enum RoleEnum2 { - Member = "member", - Maintainer = "maintainer", - All = "all", +export type ReposDeletePullRequestReviewProtectionData = any; + +export interface ReposDeletePullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Self hosted runners - * A self hosted runner - */ -export interface Runner { - busy: boolean; - /** - * The id of the runner. - * @example 5 - */ - id: number; - labels: { - /** Unique identifier of the label. */ - id?: number; - /** Name of the label. */ - name?: string; - /** The type of label. Read-only labels are applied automatically when the runner is configured. */ - type?: RunnerTypeEnum; - }[]; - /** - * The name of the runner. - * @example "iMac" - */ - name: string; - /** - * The Operating System of the runner. - * @example "macos" - */ - os: string; - /** - * The status of the runner. - * @example "online" - */ - status: string; +export type ReposDeleteReleaseAssetData = any; + +export interface ReposDeleteReleaseAssetParams { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; } -/** - * Runner Application - * Runner Application - */ -export interface RunnerApplication { - architecture: string; - download_url: string; - filename: string; - os: string; +export type ReposDeleteReleaseData = any; + +export interface ReposDeleteReleaseParams { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; } -export interface RunnerGroupsEnterprise { - allows_public_repositories: boolean; - default: boolean; - id: number; - name: string; - runners_url: string; - selected_organizations_url?: string; - visibility: string; +export type ReposDeleteWebhookData = any; + +export interface ReposDeleteWebhookParams { + hookId: number; + owner: string; + repo: string; } -export interface RunnerGroupsOrg { - allows_public_repositories: boolean; - default: boolean; - id: number; - inherited: boolean; - inherited_allows_public_repositories?: boolean; - name: string; - runners_url: string; - /** Link to the selected repositories resource for this runner group. Not present unless visibility was set to \`selected\` */ - selected_repositories_url?: string; - visibility: string; +export type ReposDisableAutomatedSecurityFixesData = any; + +export interface ReposDisableAutomatedSecurityFixesParams { + owner: string; + repo: string; } -/** The type of label. Read-only labels are applied automatically when the runner is configured. */ -export enum RunnerTypeEnum { - ReadOnly = "read-only", - Custom = "custom", +export type ReposDisableVulnerabilityAlertsData = any; + +export interface ReposDisableVulnerabilityAlertsParams { + owner: string; + repo: string; } -/** Bad Request */ -export type ScimBadRequest = ScimError; +export interface ReposDownloadTarballArchiveParams { + owner: string; + ref: string; + repo: string; +} -/** Conflict */ -export type ScimConflict = ScimError; +export interface ReposDownloadZipballArchiveParams { + owner: string; + ref: string; + repo: string; +} -export type ScimDeleteUserFromOrgData = any; +export type ReposEnableAutomatedSecurityFixesData = any; -export interface ScimDeleteUserFromOrgParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +export interface ReposEnableAutomatedSecurityFixesParams { + owner: string; + repo: string; } -export interface ScimEnterpriseGroup { - displayName?: string; - externalId?: string | null; - id: string; - members?: { - $ref?: string; - display?: string; - value?: string; - }[]; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - schemas: string[]; +export type ReposEnableVulnerabilityAlertsData = any; + +export interface ReposEnableVulnerabilityAlertsParams { + owner: string; + repo: string; } -export interface ScimEnterpriseUser { - active?: boolean; - emails?: { - primary?: boolean; - type?: string; - value?: string; - }[]; - externalId?: string; - groups?: { - value?: string; - }[]; - id: string; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - name?: { - familyName?: string; - givenName?: string; - }; - schemas: string[]; - userName?: string; +export type ReposGetAccessRestrictionsData = BranchRestrictionPolicy; + +export interface ReposGetAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Scim Error - * Scim Error - */ -export interface ScimError { - detail?: string | null; - documentation_url?: string | null; - message?: string | null; - schemas?: string[]; - scimType?: string | null; - status?: number; +export type ReposGetAdminBranchProtectionData = ProtectedBranchAdminEnforced; + +export interface ReposGetAdminBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** Forbidden */ -export type ScimForbidden = ScimError; +export type ReposGetAllStatusCheckContextsData = string[]; -export type ScimGetProvisioningInformationForUserData = ScimUser; +export interface ReposGetAllStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} -export interface ScimGetProvisioningInformationForUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +export type ReposGetAllTopicsData = Topic; + +export interface ReposGetAllTopicsParams { + owner: string; + repo: string; } -export interface ScimGroupListEnterprise { - Resources: { - displayName?: string; - externalId?: string | null; - id: string; - members?: { - $ref?: string; - display?: string; - value?: string; - }[]; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - schemas: string[]; - }[]; - itemsPerPage: number; - schemas: string[]; - startIndex: number; - totalResults: number; +export type ReposGetAppsWithAccessToProtectedBranchData = Integration[]; + +export interface ReposGetAppsWithAccessToProtectedBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** Internal Error */ -export type ScimInternalError = ScimError; +export type ReposGetBranchData = BranchWithProtection; -export type ScimListProvisionedIdentitiesData = ScimUserList; +export interface ReposGetBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} -export interface ScimListProvisionedIdentitiesParams { - /** Used for pagination: the number of results to return. */ - count?: number; +export type ReposGetBranchProtectionData = BranchProtection; + +export interface ReposGetBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +export type ReposGetClonesData = CloneTraffic; + +export interface ReposGetClonesParams { + owner: string; /** - * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: - * - * \`?filter=userName%20eq%20\\"Octocat\\"\`. - * - * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: - * - * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - filter?: string; - org: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + per?: PerEnum; + repo: string; } -/** Resource Not Found */ -export type ScimNotFound = ScimError; +/** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ +export enum ReposGetClonesParams1PerEnum { + Day = "day", + Week = "week", +} -export type ScimProvisionAndInviteUserData = ScimUser; +export type ReposGetCodeFrequencyStatsData = CodeFrequencyStat[]; -export interface ScimProvisionAndInviteUserParams { - org: string; +export interface ReposGetCodeFrequencyStatsParams { + owner: string; + repo: string; } -export interface ScimProvisionAndInviteUserPayload { - active?: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - type?: string; - value: string; - }[]; - externalId?: string; - groups?: string[]; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string; - formatted?: string; - givenName: string; - }; - schemas?: string[]; - /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" - */ - userName: string; +export type ReposGetCollaboratorPermissionLevelData = + RepositoryCollaboratorPermission; + +export interface ReposGetCollaboratorPermissionLevelParams { + owner: string; + repo: string; + username: string; } -export type ScimSetInformationForProvisionedUserData = ScimUser; +export type ReposGetCombinedStatusForRefData = CombinedCommitStatus; -export interface ScimSetInformationForProvisionedUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +export interface ReposGetCombinedStatusForRefParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; } -export interface ScimSetInformationForProvisionedUserPayload { - active?: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - type?: string; - value: string; - }[]; - externalId?: string; - groups?: string[]; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string; - formatted?: string; - givenName: string; - }; - schemas?: string[]; - /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" - */ - userName: string; -} +export type ReposGetCommitActivityStatsData = CommitActivity[]; -export type ScimUpdateAttributeForUserData = ScimUser; +export interface ReposGetCommitActivityStatsParams { + owner: string; + repo: string; +} -export type ScimUpdateAttributeForUserError = BasicError; +export type ReposGetCommitCommentData = CommitComment; -export enum ScimUpdateAttributeForUserOpEnum { - Add = "add", - Remove = "remove", - Replace = "replace", +export interface ReposGetCommitCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; } -export interface ScimUpdateAttributeForUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; -} +export type ReposGetCommitData = Commit; -export interface ScimUpdateAttributeForUserPayload { - /** - * Set of operations to be performed - * @minItems 1 - * @example [{"op":"replace","value":{"active":false}}] - */ - Operations: { - op: ScimUpdateAttributeForUserOpEnum; - path?: string; - value?: - | { - active?: boolean | null; - externalId?: string | null; - familyName?: string | null; - givenName?: string | null; - userName?: string | null; - } - | { - primary?: boolean; - value?: string; - }[] - | string; - }[]; - schemas?: string[]; +export interface ReposGetCommitParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; } -/** - * SCIM /Users - * SCIM /Users provisioning endpoints - */ -export interface ScimUser { - /** - * The active status of the User. - * @example true - */ - active: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string | null; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - value: string; - }[]; - /** - * The ID of the User. - * @example "a7b0f98395" - */ - externalId: string | null; - /** associated groups */ - groups?: { - display?: string; - value?: string; - }[]; - /** - * Unique identifier of an external identity - * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" - */ - id: string; - meta: { - /** - * @format date-time - * @example "2019-01-24T22:45:36.000Z" - */ - created?: string; - /** - * @format date-time - * @example "2019-01-24T22:45:36.000Z" - */ - lastModified?: string; - /** - * @format uri - * @example "https://api.github.com/scim/v2/organizations/myorg-123abc55141bfd8f/Users/c42772b5-2029-11e9-8543-9264a97dec8d" - */ - location?: string; - /** @example "User" */ - resourceType?: string; - }; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string | null; - formatted?: string | null; - givenName: string | null; - }; - /** - * Set of operations to be performed - * @minItems 1 - * @example [{"op":"replace","value":{"active":false}}] - */ - operations?: { - op: ScimUserOpEnum; - path?: string; - value?: string | object | any[]; - }[]; - /** The ID of the organization. */ - organization_id?: number; - /** - * SCIM schema used. - * @minItems 1 - */ - schemas: string[]; - /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" - */ - userName: string | null; -} +export type ReposGetCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; -/** - * SCIM User List - * SCIM User List - */ -export interface ScimUserList { - Resources: ScimUser[]; - /** @example 10 */ - itemsPerPage: number; - /** - * SCIM schema used. - * @minItems 1 - */ - schemas: string[]; - /** @example 1 */ - startIndex: number; - /** @example 3 */ - totalResults: number; +export interface ReposGetCommitSignatureProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export interface ScimUserListEnterprise { - Resources: { - active?: boolean; - emails?: { - primary?: boolean; - type?: string; - value?: string; - }[]; - externalId?: string; - groups?: { - value?: string; - }[]; - id: string; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - name?: { - familyName?: string; - givenName?: string; - }; - schemas: string[]; - userName?: string; - }[]; - itemsPerPage: number; - schemas: string[]; - startIndex: number; - totalResults: number; -} +export type ReposGetCommunityProfileMetricsData = CommunityProfile; -export enum ScimUserOpEnum { - Add = "add", - Remove = "remove", - Replace = "replace", +export interface ReposGetCommunityProfileMetricsParams { + owner: string; + repo: string; } -/** Scoped Installation */ -export interface ScopedInstallation { - /** Simple User */ - account: SimpleUser; - /** @example true */ - has_multiple_single_files?: boolean; - /** The permissions granted to the user-to-server access token. */ - permissions: AppPermissions; - /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" - */ - repositories_url: string; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection: ScopedInstallationRepositorySelectionEnum; - /** @example "config.yaml" */ - single_file_name: string | null; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; -} +export type ReposGetContentData = ContentTree; -/** Describe whether all repositories have been selected or there's a selection involved */ -export enum ScopedInstallationRepositorySelectionEnum { - All = "all", - Selected = "selected", +export interface ReposGetContentParams { + owner: string; + /** path+ parameter */ + path: string; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; + repo: string; } -export interface SearchCodeData { - incomplete_results: boolean; - items: CodeSearchResultItem[]; - total_count: number; +export type ReposGetContributorsStatsData = ContributorActivity[]; + +export interface ReposGetContributorsStatsParams { + owner: string; + repo: string; } -export interface SearchCodeParams { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: OrderEnum2; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum12; +export type ReposGetData = FullRepository; + +export type ReposGetDeployKeyData = DeployKey; + +export interface ReposGetDeployKeyParams { + /** key_id parameter */ + keyId: number; + owner: string; + repo: string; } -/** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ -export enum SearchCodeParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ReposGetDeploymentData = Deployment; + +export interface ReposGetDeploymentParams { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; } -/** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchCodeParams1SortEnum { - Indexed = "indexed", +export type ReposGetDeploymentStatusData = DeploymentStatus; + +export interface ReposGetDeploymentStatusParams { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; + statusId: number; } -export interface SearchCommitsData { - incomplete_results: boolean; - items: CommitSearchResultItem[]; - total_count: number; +export type ReposGetLatestPagesBuildData = PageBuild; + +export interface ReposGetLatestPagesBuildParams { + owner: string; + repo: string; } -export interface SearchCommitsParams { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: OrderEnum3; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum13; +export type ReposGetLatestReleaseData = Release; + +export interface ReposGetLatestReleaseParams { + owner: string; + repo: string; } -/** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ -export enum SearchCommitsParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ReposGetPagesBuildData = PageBuild; + +export interface ReposGetPagesBuildParams { + buildId: number; + owner: string; + repo: string; } -/** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchCommitsParams1SortEnum { - AuthorDate = "author-date", - CommitterDate = "committer-date", +export type ReposGetPagesData = Page; + +export interface ReposGetPagesParams { + owner: string; + repo: string; } -export interface SearchIssuesAndPullRequestsData { - incomplete_results: boolean; - items: IssueSearchResultItem[]; - total_count: number; +export interface ReposGetParams { + owner: string; + repo: string; } -export interface SearchIssuesAndPullRequestsParams { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: OrderEnum4; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum14; +export type ReposGetParticipationStatsData = ParticipationStats; + +export interface ReposGetParticipationStatsParams { + owner: string; + repo: string; } -/** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ -export enum SearchIssuesAndPullRequestsParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ReposGetPullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; + +export interface ReposGetPullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchIssuesAndPullRequestsParams1SortEnum { - Comments = "comments", - Reactions = "reactions", - Reactions1 = "reactions-+1", - Reactions11 = "reactions--1", - ReactionsSmile = "reactions-smile", - ReactionsThinkingFace = "reactions-thinking_face", - ReactionsHeart = "reactions-heart", - ReactionsTada = "reactions-tada", - Interactions = "interactions", - Created = "created", - Updated = "updated", +export type ReposGetPunchCardStatsData = CodeFrequencyStat[]; + +export interface ReposGetPunchCardStatsParams { + owner: string; + repo: string; } -export interface SearchLabelsData { - incomplete_results: boolean; - items: LabelSearchResultItem[]; - total_count: number; +export type ReposGetReadmeData = ContentFile; + +export interface ReposGetReadmeParams { + owner: string; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; + repo: string; } -export interface SearchLabelsParams { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: OrderEnum5; - /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; - /** The id of the repository. */ - repository_id: number; - /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum15; +export type ReposGetReleaseAssetData = ReleaseAsset; + +export interface ReposGetReleaseAssetParams { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; } -/** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ -export enum SearchLabelsParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ReposGetReleaseByTagData = Release; + +export interface ReposGetReleaseByTagParams { + owner: string; + repo: string; + /** tag+ parameter */ + tag: string; } -/** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchLabelsParams1SortEnum { - Created = "created", - Updated = "updated", +export type ReposGetReleaseData = Release; + +export interface ReposGetReleaseParams { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; } -export interface SearchReposData { - incomplete_results: boolean; - items: RepoSearchResultItem[]; - total_count: number; +export type ReposGetStatusChecksProtectionData = StatusCheckPolicy; + +export interface ReposGetStatusChecksProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export interface SearchReposParams { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: OrderEnum6; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export type ReposGetTeamsWithAccessToProtectedBranchData = Team[]; + +export interface ReposGetTeamsWithAccessToProtectedBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +export type ReposGetTopPathsData = ContentTraffic[]; + +export interface ReposGetTopPathsParams { + owner: string; + repo: string; +} + +export type ReposGetTopReferrersData = ReferrerTraffic[]; + +export interface ReposGetTopReferrersParams { + owner: string; + repo: string; +} + +export type ReposGetUsersWithAccessToProtectedBranchData = SimpleUser[]; + +export interface ReposGetUsersWithAccessToProtectedBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +export type ReposGetViewsData = ViewTraffic; + +export interface ReposGetViewsParams { + owner: string; /** - * Results per page (max 100) - * @default 30 + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum16; + per?: PerEnum1; + repo: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Must be one of: \`day\`, \`week\`. + * @default "day" */ -export enum SearchReposParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export enum ReposGetViewsParams1PerEnum { + Day = "day", + Week = "week", } -/** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchReposParams1SortEnum { - Stars = "stars", - Forks = "forks", - HelpWantedIssues = "help-wanted-issues", - Updated = "updated", +export type ReposGetWebhookConfigForRepoData = WebhookConfig; + +export interface ReposGetWebhookConfigForRepoParams { + hookId: number; + owner: string; + repo: string; } -/** Search Result Text Matches */ -export type SearchResultTextMatches = { - fragment?: string; - matches?: { - indices?: number[]; - text?: string; - }[]; - object_type?: string | null; - object_url?: string; - property?: string; -}[]; +export type ReposGetWebhookData = Hook; -export interface SearchTopicsData { - incomplete_results: boolean; - items: TopicSearchResultItem[]; - total_count: number; +export interface ReposGetWebhookParams { + hookId: number; + owner: string; + repo: string; } -export interface SearchTopicsParams { - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; +export type ReposListBranchesData = ShortBranch[]; + +export type ReposListBranchesForHeadCommitData = BranchShort[]; + +export interface ReposListBranchesForHeadCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; } -export interface SearchUsersData { - incomplete_results: boolean; - items: UserSearchResultItem[]; - total_count: number; +export interface ReposListBranchesParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ + protected?: boolean; + repo: string; } -export interface SearchUsersParams { +export type ReposListCollaboratorsData = Collaborator[]; + +export interface ReposListCollaboratorsParams { /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Filter collaborators returned by their affiliation. Can be one of: + * \\* \`outside\`: All outside collaborators of an organization-owned repository. + * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" */ - order?: OrderEnum7; + affiliation?: AffiliationEnum1; + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -30977,83 +30330,109 @@ export interface SearchUsersParams { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SortEnum17; + repo: string; } /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * Filter collaborators returned by their affiliation. Can be one of: + * \\* \`outside\`: All outside collaborators of an organization-owned repository. + * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" */ -export enum SearchUsersParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export enum ReposListCollaboratorsParams1AffiliationEnum { + Outside = "outside", + Direct = "direct", + All = "all", } -/** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SearchUsersParams1SortEnum { - Followers = "followers", - Repositories = "repositories", - Joined = "joined", -} +export type ReposListCommentsForCommitData = CommitComment[]; -export interface SecretScanningAlert { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at?: AlertCreatedAt; - /** The GitHub URL of the alert resource. */ - html_url?: AlertHtmlUrl; - /** The security alert number. */ - number?: AlertNumber; - /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ - resolution?: SecretScanningAlertResolution; +export interface ReposListCommentsForCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: string; /** - * The time that the alert was resolved in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time + * Page number of the results to fetch. + * @default 1 */ - resolved_at?: string | null; - /** Simple User */ - resolved_by?: SimpleUser; - /** The secret that was detected. */ - secret?: string; - /** The type of secret that secret scanning detected. */ - secret_type?: string; - /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ - state?: SecretScanningAlertState; - /** The REST API URL of the alert resource. */ - url?: AlertUrl; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ -export type SecretScanningAlertResolution = - SecretScanningAlertResolutionEnum | null; +export type ReposListCommitCommentsForRepoData = CommitComment[]; -export enum SecretScanningAlertResolutionEnum { - FalsePositive = "false_positive", - WontFix = "wont_fix", - Revoked = "revoked", - UsedInTests = "used_in_tests", +export interface ReposListCommitCommentsForRepoParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ -export enum SecretScanningAlertState { - Open = "open", - Resolved = "resolved", +export type ReposListCommitStatusesForRefData = Status[]; + +export interface ReposListCommitStatusesForRefParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** ref+ parameter */ + ref: string; + repo: string; } -export type SecretScanningGetAlertData = SecretScanningAlert; +export type ReposListCommitsData = Commit[]; -export interface SecretScanningGetAlertParams { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; +export interface ReposListCommitsParams { + /** GitHub login or email address by which to filter by commit author. */ + author?: string; owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** Only commits containing this file path will be returned. */ + path?: string; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; + /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ + sha?: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + until?: string; } -export type SecretScanningListAlertsForRepoData = SecretScanningAlert[]; +export type ReposListContributorsData = Contributor[]; -export interface SecretScanningListAlertsForRepoParams { +export interface ReposListContributorsParams { + /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ + anon?: string; owner: string; /** * Page number of the results to fetch. @@ -31066,314 +30445,260 @@ export interface SecretScanningListAlertsForRepoParams { */ per_page?: number; repo: string; - /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ - state?: StateEnum7; } -/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ -export enum SecretScanningListAlertsForRepoParams1StateEnum { - Open = "open", - Resolved = "resolved", +export type ReposListDeployKeysData = DeployKey[]; + +export interface ReposListDeployKeysParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -export type SecretScanningUpdateAlertData = SecretScanningAlert; +export type ReposListDeploymentStatusesData = DeploymentStatus[]; -export interface SecretScanningUpdateAlertParams { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; +export interface ReposListDeploymentStatusesParams { + /** deployment_id parameter */ + deploymentId: number; owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; } -export interface SecretScanningUpdateAlertPayload { - /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ - resolution?: SecretScanningAlertResolution; - /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ - state: SecretScanningAlertState; -} +export type ReposListDeploymentsData = Deployment[]; -export interface SelectedActions { - /** Whether GitHub-owned actions are allowed. For example, this includes the actions in the \`actions\` organization. */ - github_owned_allowed: boolean; - /** Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, \`monalisa/octocat@*\`, \`monalisa/octocat@v2\`, \`monalisa/*\`." */ - patterns_allowed: string[]; - /** Whether actions in GitHub Marketplace from verified creators are allowed. Set to \`true\` to allow all GitHub Marketplace actions by verified creators. */ - verified_allowed: boolean; +export interface ReposListDeploymentsParams { + /** + * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). + * @default "none" + */ + environment?: string; + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * The name of the ref. This can be a branch, tag, or SHA. + * @default "none" + */ + ref?: string; + repo: string; + /** + * The SHA recorded at creation time. + * @default "none" + */ + sha?: string; + /** + * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). + * @default "none" + */ + task?: string; } -/** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ -export type SelectedActionsUrl = string; +export type ReposListForAuthenticatedUserData = Repository[]; -/** Service Unavailable */ -export interface ServiceUnavailable { - code?: string; - documentation_url?: string; - message?: string; +export interface ReposListForAuthenticatedUserParams { + /** + * Comma-separated list of values. Can include: + * \\* \`owner\`: Repositories that are owned by the authenticated user. + * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. + * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + * @default "owner,collaborator,organization_member" + */ + affiliation?: string; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: DirectionEnum16; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: SortEnum19; + /** + * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` + * + * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * @default "all" + */ + type?: TypeEnum1; + /** + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" + */ + visibility?: VisibilityEnum; +} + +/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ +export enum ReposListForAuthenticatedUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * Short Blob - * Short Blob + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" */ -export interface ShortBlob { - sha: string; - url: string; +export enum ReposListForAuthenticatedUserParams1SortEnum { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", } /** - * Short Branch - * Short Branch + * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` + * + * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * @default "all" */ -export interface ShortBranch { - commit: { - sha: string; - /** @format uri */ - url: string; - }; - name: string; - protected: boolean; - /** Branch Protection */ - protection?: BranchProtection; - /** @format uri */ - protection_url?: string; +export enum ReposListForAuthenticatedUserParams1TypeEnum { + All = "all", + Owner = "owner", + Public = "public", + Private = "private", + Member = "member", } /** - * Simple Commit - * Simple Commit + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" */ -export interface SimpleCommit { - author: { - email: string; - name: string; - } | null; - committer: { - email: string; - name: string; - } | null; - id: string; - message: string; - /** @format date-time */ - timestamp: string; - tree_id: string; +export enum ReposListForAuthenticatedUserParams1VisibilityEnum { + All = "all", + Public = "public", + Private = "private", } -/** Simple Commit Status */ -export interface SimpleCommitStatus { - /** @format uri */ - avatar_url: string | null; - context: string; - /** @format date-time */ - created_at: string; - description: string | null; - id: number; - node_id: string; - required?: boolean | null; - state: string; - /** @format uri */ - target_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; -} +export type ReposListForOrgData = MinimalRepository[]; -/** - * Simple User - * Simple User - */ -export type SimpleUser = { +export interface ReposListForOrgParams { + /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ + direction?: DirectionEnum4; + org: string; /** - * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" - */ - avatar_url: string; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ - events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/followers" - */ - followers_url: string; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; - /** - * @format uri - * @example "https://github.com/octocat" - */ - html_url: string; - /** @example 1 */ - id: number; - /** @example "octocat" */ - login: string; - /** @example "MDQ6VXNlcjE=" */ - node_id: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/orgs" - */ - organizations_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" - */ - received_events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" + * Page number of the results to fetch. + * @default 1 */ - repos_url: string; - site_admin: boolean; - /** @example ""2020-07-09T00:17:55Z"" */ - starred_at?: string; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; + page?: number; /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" + * Results per page (max 100) + * @default 30 */ - subscriptions_url: string; - /** @example "User" */ - type: string; + per_page?: number; /** - * @format uri - * @example "https://api.github.com/users/octocat" + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "created" */ - url: string; -} | null; - -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", -} - -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum1 { - Created = "created", - Updated = "updated", + sort?: SortEnum4; + /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ + type?: TypeEnum; } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum10 { - Created = "created", - Updated = "updated", +/** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ +export enum ReposListForOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. * @default "created" */ -export enum SortEnum11 { - Created = "created", - Updated = "updated", -} - -/** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum12 { - Indexed = "indexed", -} - -/** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum13 { - AuthorDate = "author-date", - CommitterDate = "committer-date", -} - -/** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum14 { - Comments = "comments", - Reactions = "reactions", - Reactions1 = "reactions-+1", - Reactions11 = "reactions--1", - ReactionsSmile = "reactions-smile", - ReactionsThinkingFace = "reactions-thinking_face", - ReactionsHeart = "reactions-heart", - ReactionsTada = "reactions-tada", - Interactions = "interactions", - Created = "created", - Updated = "updated", -} - -/** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum15 { +export enum ReposListForOrgParams1SortEnum { Created = "created", Updated = "updated", + Pushed = "pushed", + FullName = "full_name", } -/** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum16 { - Stars = "stars", +/** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ +export enum ReposListForOrgParams1TypeEnum { + All = "all", + Public = "public", + Private = "private", Forks = "forks", - HelpWantedIssues = "help-wanted-issues", - Updated = "updated", -} - -/** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ -export enum SortEnum17 { - Followers = "followers", - Repositories = "repositories", - Joined = "joined", -} - -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum18 { - Created = "created", - Updated = "updated", - Comments = "comments", + Sources = "sources", + Member = "member", + Internal = "internal", } -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ -export enum SortEnum19 { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", -} +export type ReposListForUserData = MinimalRepository[]; -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum2 { - Created = "created", - Updated = "updated", +export interface ReposListForUserParams { + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: DirectionEnum18; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: SortEnum21; + /** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ + type?: TypeEnum2; + username: string; } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum20 { - Created = "created", - Updated = "updated", +/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ +export enum ReposListForUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } /** * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. * @default "full_name" */ -export enum SortEnum21 { +export enum ReposListForUserParams1SortEnum { Created = "created", Updated = "updated", Pushed = "pushed", @@ -31381,2622 +30706,1959 @@ export enum SortEnum21 { } /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" */ -export enum SortEnum22 { - Created = "created", - Updated = "updated", +export enum ReposListForUserParams1TypeEnum { + All = "all", + Owner = "owner", + Member = "member", } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum3 { - Created = "created", - Updated = "updated", - Comments = "comments", -} +export type ReposListForksData = MinimalRepository[]; -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ -export enum SortEnum4 { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", +export interface ReposListForksParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; + /** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ + sort?: SortEnum5; } /** * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. * @default "newest" */ -export enum SortEnum5 { +export enum ReposListForksParams1SortEnum { Newest = "newest", Oldest = "oldest", Stargazers = "stargazers", } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum6 { - Created = "created", - Updated = "updated", - Comments = "comments", -} +export type ReposListInvitationsData = RepositoryInvitation[]; -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum7 { - Created = "created", - Updated = "updated", -} +export type ReposListInvitationsForAuthenticatedUserData = + RepositoryInvitation[]; -/** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" - */ -export enum SortEnum8 { - DueOn = "due_on", - Completeness = "completeness", +export interface ReposListInvitationsForAuthenticatedUserParams { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). - * @default "created" - */ -export enum SortEnum9 { - Created = "created", - Updated = "updated", - Popularity = "popularity", - LongRunning = "long-running", +export interface ReposListInvitationsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Stargazer - * Stargazer - */ -export interface Stargazer { - /** @format date-time */ - starred_at: string; - user: SimpleUser | null; -} +export type ReposListLanguagesData = Language; -/** - * Starred Repository - * Starred Repository - */ -export interface StarredRepository { - /** A git repository */ - repo: Repository; - /** @format date-time */ - starred_at: string; +export interface ReposListLanguagesParams { + owner: string; + repo: string; } -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum { - Open = "open", - Closed = "closed", - All = "all", -} +export type ReposListPagesBuildsData = PageBuild[]; -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum1 { - Open = "open", - Closed = "closed", - All = "all", +export interface ReposListPagesBuildsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum10 { - Open = "open", - Closed = "closed", - All = "all", -} +export type ReposListPublicData = MinimalRepository[]; -/** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum2 { - Open = "open", - Closed = "closed", - All = "all", +export interface ReposListPublicParams { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: number; } -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum3 { - Open = "open", - Closed = "closed", - All = "all", -} +export type ReposListPullRequestsAssociatedWithCommitData = PullRequestSimple[]; -/** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum4 { - Open = "open", - Closed = "closed", - All = "all", +export interface ReposListPullRequestsAssociatedWithCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum5 { - Open = "open", - Closed = "closed", - All = "all", -} +export type ReposListReleaseAssetsData = ReleaseAsset[]; -/** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ -export enum StateEnum6 { - Open = "open", - Closed = "closed", - All = "all", +export interface ReposListReleaseAssetsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** release_id parameter */ + releaseId: number; + repo: string; } -/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ -export enum StateEnum7 { - Open = "open", - Resolved = "resolved", -} +export type ReposListReleasesData = Release[]; -/** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum8 { - Open = "open", - Closed = "closed", - All = "all", +export interface ReposListReleasesParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ -export enum StateEnum9 { - Active = "active", - Pending = "pending", +export type ReposListTagsData = Tag[]; + +export interface ReposListTagsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Status - * The status of a commit. - */ -export interface Status { - avatar_url: string | null; - context: string; - created_at: string; - /** Simple User */ - creator: SimpleUser; - description: string; - id: number; - node_id: string; - state: string; - target_url: string; - updated_at: string; - url: string; +export type ReposListTeamsData = Team[]; + +export interface ReposListTeamsParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -/** - * Status Check Policy - * Status Check Policy - */ -export interface StatusCheckPolicy { - /** @example ["continuous-integration/travis-ci"] */ - contexts: string[]; +export type ReposListWebhooksData = Hook[]; + +export interface ReposListWebhooksParams { + owner: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts" + * Page number of the results to fetch. + * @default 1 */ - contexts_url: string; - /** @example true */ - strict: boolean; + page?: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks" + * Results per page (max 100) + * @default 30 */ - url: string; + per_page?: number; + repo: string; } -/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ -export enum StatusEnum { - Completed = "completed", - Status = "status", - Conclusion = "conclusion", +export type ReposMergeData = Commit; + +export type ReposMergeError = { + /** @example ""https://docs.github.com/rest/reference/repos#perform-a-merge"" */ + documentation_url?: string; + message?: string; +}; + +export interface ReposMergeParams { + owner: string; + repo: string; } -/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ -export enum StatusEnum1 { - Completed = "completed", - Status = "status", - Conclusion = "conclusion", +export interface ReposMergePayload { + /** The name of the base branch that the head will be merged into. */ + base: string; + /** Commit message to use for the merge commit. If omitted, a default message will be used. */ + commit_message?: string; + /** The head to merge. This can be a branch name or a commit SHA1. */ + head: string; } -/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ -export enum StatusEnum2 { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +export type ReposPingWebhookData = any; + +export interface ReposPingWebhookParams { + hookId: number; + owner: string; + repo: string; } -/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ -export enum StatusEnum3 { - Queued = "queued", - InProgress = "in_progress", - Completed = "completed", +export type ReposRemoveAppAccessRestrictionsData = Integration[]; + +export interface ReposRemoveAppAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ -export enum SubjectTypeEnum { - Organization = "organization", - Repository = "repository", - Issue = "issue", - PullRequest = "pull_request", +/** @example {"apps":["my-app"]} */ +export interface ReposRemoveAppAccessRestrictionsPayload { + /** apps parameter */ + apps: string[]; } -/** - * Tag - * Tag - */ -export interface Tag { - commit: { - sha: string; - /** @format uri */ - url: string; - }; - /** @example "v0.1" */ - name: string; - node_id: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/tarball/v0.1" - */ - tarball_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/zipball/v0.1" - */ - zipball_url: string; +export type ReposRemoveCollaboratorData = any; + +export interface ReposRemoveCollaboratorParams { + owner: string; + repo: string; + username: string; } -/** - * Team - * Groups of organization members that gives permissions on specified repositories. - */ -export interface Team { - description: string | null; - /** - * @format uri - * @example "https://github.com/orgs/rails/teams/core" - */ - html_url: string; - id: number; - members_url: string; - name: string; - node_id: string; - parent?: TeamSimple | null; - permission: string; - privacy?: string; - /** @format uri */ - repositories_url: string; - slug: string; - /** @format uri */ - url: string; +export type ReposRemoveStatusCheckContextsData = string[]; + +export interface ReposRemoveStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Team Discussion - * A team discussion is a persistent record of a free-form conversation within a team. - */ -export interface TeamDiscussion { - author: SimpleUser | null; - /** - * The main text of the discussion. - * @example "Please suggest improvements to our workflow in comments." - */ - body: string; - /** @example "

Hi! This is an area for us to collaborate as a team

" */ - body_html: string; - /** - * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - * @example "0307116bbf7ced493b8d8a346c650b71" - */ - body_version: string; - /** @example 0 */ - comments_count: number; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2343027/discussions/1/comments" - */ - comments_url: string; - /** - * @format date-time - * @example "2018-01-25T18:56:31Z" - */ - created_at: string; - /** - * @format uri - * @example "https://github.com/orgs/github/teams/justice-league/discussions/1" - */ - html_url: string; - /** @format date-time */ - last_edited_at: string | null; - /** @example "MDE0OlRlYW1EaXNjdXNzaW9uMQ==" */ - node_id: string; - /** - * The unique sequence number of a team discussion. - * @example 42 - */ - number: number; - /** - * Whether or not this discussion should be pinned for easy retrieval. - * @example true - */ - pinned: boolean; - /** - * Whether or not this discussion should be restricted to team members and organization administrators. - * @example true - */ - private: boolean; - reactions?: ReactionRollup; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2343027" - */ - team_url: string; - /** - * The title of the discussion. - * @example "How can we improve our workflow?" - */ - title: string; - /** - * @format date-time - * @example "2018-01-25T18:56:31Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2343027/discussions/1" - */ - url: string; +/** @example {"contexts":["contexts"]} */ +export interface ReposRemoveStatusCheckContextsPayload { + /** contexts parameter */ + contexts: string[]; } -/** - * Team Discussion Comment - * A reply to a discussion within a team. - */ -export interface TeamDiscussionComment { - author: SimpleUser | null; - /** - * The main text of the comment. - * @example "I agree with this suggestion." - */ - body: string; - /** @example "

Do you like apples?

" */ - body_html: string; - /** - * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - * @example "0307116bbf7ced493b8d8a346c650b71" - */ - body_version: string; - /** - * @format date-time - * @example "2018-01-15T23:53:58Z" - */ - created_at: string; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2403582/discussions/1" - */ - discussion_url: string; - /** - * @format uri - * @example "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1" - */ - html_url: string; - /** @format date-time */ - last_edited_at: string | null; - /** @example "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=" */ - node_id: string; - /** - * The unique sequence number of a team discussion comment. - * @example 42 - */ - number: number; - reactions?: ReactionRollup; - /** - * @format date-time - * @example "2018-01-15T23:53:58Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1" - */ - url: string; +export type ReposRemoveStatusCheckProtectionData = any; + +export interface ReposRemoveStatusCheckProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Full Team - * Groups of organization members that gives permissions on specified repositories. - */ -export interface TeamFull { - /** - * @format date-time - * @example "2017-07-14T16:53:42Z" - */ - created_at: string; - /** @example "A great team." */ - description: string | null; - /** - * @format uri - * @example "https://github.com/orgs/rails/teams/core" - */ - html_url: string; - /** - * Unique identifier of the team - * @example 42 - */ - id: number; - /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" - */ - ldap_dn?: string; - /** @example 3 */ - members_count: number; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; - /** - * Name of the team - * @example "Developers" - */ - name: string; - /** @example "MDQ6VGVhbTE=" */ - node_id: string; - /** Organization Full */ - organization: OrganizationFull; - parent?: TeamSimple | null; - /** - * Permission that the team will have for its repositories - * @example "push" - */ - permission: string; - /** - * The level of privacy this team should have - * @example "closed" - */ - privacy?: TeamFullPrivacyEnum; - /** @example 10 */ - repos_count: number; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" - */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; - /** - * @format date-time - * @example "2017-08-17T12:37:15Z" - */ - updated_at: string; - /** - * URL for the team - * @format uri - * @example "https://api.github.com/organizations/1/team/1" - */ - url: string; +export type ReposRemoveTeamAccessRestrictionsData = Team[]; + +export interface ReposRemoveTeamAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * The level of privacy this team should have - * @example "closed" - */ -export enum TeamFullPrivacyEnum { - Closed = "closed", - Secret = "secret", +/** @example {"teams":["my-team"]} */ +export interface ReposRemoveTeamAccessRestrictionsPayload { + /** teams parameter */ + teams: string[]; } -/** - * Team Membership - * Team Membership - */ -export interface TeamMembership { - /** - * The role of the user in the team. - * @default "member" - * @example "member" - */ - role: TeamMembershipRoleEnum; - state: string; - /** @format uri */ - url: string; +export type ReposRemoveUserAccessRestrictionsData = SimpleUser[]; + +export interface ReposRemoveUserAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * The role of the user in the team. - * @default "member" - * @example "member" - */ -export enum TeamMembershipRoleEnum { - Member = "member", - Maintainer = "maintainer", +/** @example {"users":["mona"]} */ +export interface ReposRemoveUserAccessRestrictionsPayload { + /** users parameter */ + users: string[]; } -/** - * Team Project - * A team's access to a project. - */ -export interface TeamProject { - body: string | null; - columns_url: string; - created_at: string; - /** Simple User */ - creator: SimpleUser; - html_url: string; - id: number; - name: string; - node_id: string; - number: number; - /** The organization permission for this project. Only present when owner is an organization. */ - organization_permission?: string; - owner_url: string; - permissions: { - admin: boolean; - read: boolean; - write: boolean; - }; - /** Whether the project is private or not. Only present when owner is an organization. */ - private?: boolean; - state: string; - updated_at: string; - url: string; +export type ReposRenameBranchData = BranchWithProtection; + +export interface ReposRenameBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Team Repository - * A team's access to a repository. - */ -export interface TeamRepository { - /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true - */ - allow_merge_commit?: boolean; - /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true - */ - allow_rebase_merge?: boolean; - /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true - */ - allow_squash_merge?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - /** - * Whether the repository is archived. - * @default false - */ - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at: string | null; - /** - * The default branch of the repository. - * @example "master" - */ - default_branch: string; - /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false - */ - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" - */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** - * Whether downloads are enabled. - * @default true - * @example true - */ - has_downloads: boolean; - /** - * Whether issues are enabled. - * @default true - * @example true - */ - has_issues: boolean; - has_pages: boolean; - /** - * Whether projects are enabled. - * @default true - * @example true - */ - has_projects: boolean; - /** - * Whether the wiki is enabled. - * @default true - * @example true - */ - has_wiki: boolean; - /** - * @format uri - * @example "https://github.com" - */ - homepage: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" - */ - hooks_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World" - */ - html_url: string; - /** - * Unique identifier of the repository - * @example 42 - */ - id: number; - /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true - */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" - */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" - */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; - /** - * @format uri - * @example "git:git.example.com/octocat/Hello-World" - */ - mirror_url: string | null; - /** - * The name of the repository. - * @example "Team Environment" - */ - name: string; - network_count?: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ - node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - maintain?: boolean; - pull: boolean; - push: boolean; - triage?: boolean; - }; - /** - * Whether the repository is private or public. - * @default false - */ - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; - /** - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - pushed_at: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" - */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" - */ - subscribers_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" - */ - subscription_url: string; - /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: Repository | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - url: string; - /** - * The repository visibility: public, private, or internal. - * @default "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; +export interface ReposRenameBranchPayload { + /** The new name of the branch. */ + new_name: string; } -/** - * Team Simple - * Groups of organization members that gives permissions on specified repositories. - */ -export type TeamSimple = { - /** - * Description of the team - * @example "A great team." - */ - description: string | null; - /** - * @format uri - * @example "https://github.com/orgs/rails/teams/core" - */ - html_url: string; - /** - * Unique identifier of the team - * @example 1 - */ - id: number; - /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" - */ - ldap_dn?: string; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; - /** - * Name of the team - * @example "Justice League" - */ - name: string; - /** @example "MDQ6VGVhbTE=" */ - node_id: string; - /** - * Permission that the team will have for its repositories - * @example "admin" - */ - permission: string; - /** - * The level of privacy this team should have - * @example "closed" - */ - privacy?: string; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" - */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; - /** - * URL for the team - * @format uri - * @example "https://api.github.com/organizations/1/team/1" - */ - url: string; -} | null; - -export type TeamsAddMemberLegacyData = any; - -export type TeamsAddMemberLegacyError = { - /** @example ""https://docs.github.com/rest"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; -}; +export type ReposReplaceAllTopicsData = Topic; -export interface TeamsAddMemberLegacyParams { - teamId: number; - username: string; +export interface ReposReplaceAllTopicsParams { + owner: string; + repo: string; } -export type TeamsAddOrUpdateMembershipForUserInOrgData = TeamMembership; +export interface ReposReplaceAllTopicsPayload { + /** An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (\`[]\`) to clear all topics from the repository. **Note:** Topic \`names\` cannot contain uppercase letters. */ + names: string[]; +} -export type TeamsAddOrUpdateMembershipForUserInOrgError = { - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; -}; +export type ReposRequestPagesBuildData = PageBuildStatus; -export interface TeamsAddOrUpdateMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; +export interface ReposRequestPagesBuildParams { + owner: string; + repo: string; } -export interface TeamsAddOrUpdateMembershipForUserInOrgPayload { - /** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" - */ - role?: TeamsAddOrUpdateMembershipForUserInOrgRoleEnum; -} +export type ReposSetAdminBranchProtectionData = ProtectedBranchAdminEnforced; -/** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" - */ -export enum TeamsAddOrUpdateMembershipForUserInOrgRoleEnum { - Member = "member", - Maintainer = "maintainer", +export interface ReposSetAdminBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export type TeamsAddOrUpdateMembershipForUserLegacyData = TeamMembership; +export type ReposSetAppAccessRestrictionsData = Integration[]; -export type TeamsAddOrUpdateMembershipForUserLegacyError = { - /** @example ""https://help.github.com/articles/github-and-trade-controls"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; -}; +export interface ReposSetAppAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} -export interface TeamsAddOrUpdateMembershipForUserLegacyParams { - teamId: number; - username: string; +/** @example {"apps":["my-app"]} */ +export interface ReposSetAppAccessRestrictionsPayload { + /** apps parameter */ + apps: string[]; } -export interface TeamsAddOrUpdateMembershipForUserLegacyPayload { - /** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" - */ - role?: TeamsAddOrUpdateMembershipForUserLegacyRoleEnum; +export type ReposSetStatusCheckContextsData = string[]; + +export interface ReposSetStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" - */ -export enum TeamsAddOrUpdateMembershipForUserLegacyRoleEnum { - Member = "member", - Maintainer = "maintainer", +/** @example {"contexts":["contexts"]} */ +export interface ReposSetStatusCheckContextsPayload { + /** contexts parameter */ + contexts: string[]; } -export type TeamsAddOrUpdateProjectPermissionsInOrgData = any; +export type ReposSetTeamAccessRestrictionsData = Team[]; -export type TeamsAddOrUpdateProjectPermissionsInOrgError = { - documentation_url?: string; - message?: string; -}; +export interface ReposSetTeamAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} -export interface TeamsAddOrUpdateProjectPermissionsInOrgParams { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; +/** @example {"teams":["my-team"]} */ +export interface ReposSetTeamAccessRestrictionsPayload { + /** teams parameter */ + teams: string[]; } -export interface TeamsAddOrUpdateProjectPermissionsInOrgPayload { - /** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ - permission?: TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum; +export type ReposSetUserAccessRestrictionsData = SimpleUser[]; + +export interface ReposSetUserAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ -export enum TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", +/** @example {"users":["mona"]} */ +export interface ReposSetUserAccessRestrictionsPayload { + /** users parameter */ + users: string[]; } -export type TeamsAddOrUpdateProjectPermissionsLegacyData = any; +export type ReposTestPushWebhookData = any; -export type TeamsAddOrUpdateProjectPermissionsLegacyError = { - documentation_url?: string; - message?: string; -}; +export interface ReposTestPushWebhookParams { + hookId: number; + owner: string; + repo: string; +} -export interface TeamsAddOrUpdateProjectPermissionsLegacyParams { - projectId: number; - teamId: number; +export type ReposTransferData = Repository; + +export interface ReposTransferParams { + owner: string; + repo: string; } -export interface TeamsAddOrUpdateProjectPermissionsLegacyPayload { - /** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ - permission?: TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum; +export interface ReposTransferPayload { + /** The username or organization name the repository will be transferred to. */ + new_owner: string; + /** ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ + team_ids?: number[]; } -/** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ -export enum TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", -} - -export type TeamsAddOrUpdateRepoPermissionsInOrgData = any; +export type ReposUpdateBranchProtectionData = ProtectedBranch; -export interface TeamsAddOrUpdateRepoPermissionsInOrgParams { - org: string; +export interface ReposUpdateBranchProtectionParams { + /** The name of the branch. */ + branch: string; owner: string; repo: string; - /** team_slug parameter */ - teamSlug: string; -} - -export interface TeamsAddOrUpdateRepoPermissionsInOrgPayload { - /** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. - * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum; } -/** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. - * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ -export enum TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", - Maintain = "maintain", - Triage = "triage", +export interface ReposUpdateBranchProtectionPayload { + /** Allows deletion of the protected branch by anyone with write access to the repository. Set to \`false\` to prevent deletion of the protected branch. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ + allow_deletions?: boolean; + /** Permits force pushes to the protected branch by anyone with write access to the repository. Set to \`true\` to allow force pushes. Set to \`false\` or \`null\` to block force pushes. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ + allow_force_pushes?: boolean | null; + /** Enforce all configured restrictions for administrators. Set to \`true\` to enforce required status checks for repository administrators. Set to \`null\` to disable. */ + enforce_admins: boolean | null; + /** Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to \`true\` to enforce a linear commit history. Set to \`false\` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: \`false\`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ + required_linear_history?: boolean; + /** Require at least one approving review on a pull request, before merging. Set to \`null\` to disable. */ + required_pull_request_reviews: { + /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of team \`slug\`s with dismissal access */ + teams?: string[]; + /** The list of user \`login\`s with dismissal access */ + users?: string[]; + }; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ + require_code_owner_reviews?: boolean; + /** Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; + } | null; + /** Require status checks to pass before merging. Set to \`null\` to disable. */ + required_status_checks: { + /** The list of status checks to require in order to merge into this branch */ + contexts: string[]; + /** Require branches to be up to date before merging. */ + strict: boolean; + } | null; + /** Restrict who can push to the protected branch. User, app, and team \`restrictions\` are only available for organization-owned repositories. Set to \`null\` to disable. */ + restrictions: { + /** The list of app \`slug\`s with push access */ + apps?: string[]; + /** The list of team \`slug\`s with push access */ + teams: string[]; + /** The list of user \`login\`s with push access */ + users: string[]; + } | null; } -export type TeamsAddOrUpdateRepoPermissionsLegacyData = any; +export type ReposUpdateCommitCommentData = CommitComment; -export interface TeamsAddOrUpdateRepoPermissionsLegacyParams { +export interface ReposUpdateCommitCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; - teamId: number; -} - -export interface TeamsAddOrUpdateRepoPermissionsLegacyPayload { - /** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: TeamsAddOrUpdateRepoPermissionsLegacyPermissionEnum; } -/** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ -export enum TeamsAddOrUpdateRepoPermissionsLegacyPermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", -} - -export type TeamsCheckPermissionsForProjectInOrgData = TeamProject; - -export interface TeamsCheckPermissionsForProjectInOrgParams { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; +export interface ReposUpdateCommitCommentPayload { + /** The contents of the comment */ + body: string; } -export type TeamsCheckPermissionsForProjectLegacyData = TeamProject; - -export interface TeamsCheckPermissionsForProjectLegacyParams { - projectId: number; - teamId: number; -} +export type ReposUpdateData = FullRepository; -export type TeamsCheckPermissionsForRepoInOrgData = TeamRepository; +export type ReposUpdateInformationAboutPagesSiteData = any; -export interface TeamsCheckPermissionsForRepoInOrgParams { - org: string; +export interface ReposUpdateInformationAboutPagesSiteParams { owner: string; repo: string; - /** team_slug parameter */ - teamSlug: string; } -export type TeamsCheckPermissionsForRepoLegacyData = TeamRepository; - -export interface TeamsCheckPermissionsForRepoLegacyParams { - owner: string; - repo: string; - teamId: number; +/** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ +export enum ReposUpdateInformationAboutPagesSitePathEnum { + Value = "/", + ValueDocs = "/docs", } -export type TeamsCreateData = TeamFull; - -export type TeamsCreateDiscussionCommentInOrgData = TeamDiscussionComment; - -export interface TeamsCreateDiscussionCommentInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; +export interface ReposUpdateInformationAboutPagesSitePayload { + /** Specify a custom domain for the repository. Sending a \`null\` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ + cname?: string | null; + /** Configures access controls for the GitHub Pages site. If public is set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to \`internal\` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ + public?: boolean; + /** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ + source: + | ReposUpdateInformationAboutPagesSiteSourceEnum + | { + /** The repository branch used to publish your site's source files. */ + branch: string; + /** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ + path: ReposUpdateInformationAboutPagesSitePathEnum; + }; } -export interface TeamsCreateDiscussionCommentInOrgPayload { - /** The discussion comment's body text. */ - body: string; +/** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ +export enum ReposUpdateInformationAboutPagesSiteSourceEnum { + GhPages = "gh-pages", + Master = "master", + MasterDocs = "master /docs", } -export type TeamsCreateDiscussionCommentLegacyData = TeamDiscussionComment; +export type ReposUpdateInvitationData = RepositoryInvitation; -export interface TeamsCreateDiscussionCommentLegacyParams { - discussionNumber: number; - teamId: number; +export interface ReposUpdateInvitationParams { + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; } -export interface TeamsCreateDiscussionCommentLegacyPayload { - /** The discussion comment's body text. */ - body: string; +export interface ReposUpdateInvitationPayload { + /** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ + permissions?: ReposUpdateInvitationPermissionsEnum; } -export type TeamsCreateDiscussionInOrgData = TeamDiscussion; +/** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ +export enum ReposUpdateInvitationPermissionsEnum { + Read = "read", + Write = "write", + Maintain = "maintain", + Triage = "triage", + Admin = "admin", +} -export interface TeamsCreateDiscussionInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +export interface ReposUpdateParams { + owner: string; + repo: string; } -export interface TeamsCreateDiscussionInOrgPayload { - /** The discussion post's body text. */ - body: string; +export interface ReposUpdatePayload { /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. + * @default true + */ + allow_merge_commit?: boolean; + /** + * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. + * @default true + */ + allow_rebase_merge?: boolean; + /** + * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. + * @default true + */ + allow_squash_merge?: boolean; + /** + * \`true\` to archive this repository. **Note**: You cannot unarchive repositories through the API. * @default false */ - private?: boolean; - /** The discussion post's title. */ - title: string; -} - -export type TeamsCreateDiscussionLegacyData = TeamDiscussion; - -export interface TeamsCreateDiscussionLegacyParams { - teamId: number; -} - -export interface TeamsCreateDiscussionLegacyPayload { - /** The discussion post's body text. */ - body: string; + archived?: boolean; + /** Updates the default branch for this repository. */ + default_branch?: string; /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. + * @default false + */ + delete_branch_on_merge?: boolean; + /** A short description of the repository. */ + description?: string; + /** + * Either \`true\` to enable issues for this repository or \`false\` to disable them. + * @default true + */ + has_issues?: boolean; + /** + * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. + * @default true + */ + has_projects?: boolean; + /** + * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. + * @default true + */ + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. + * @default false + */ + is_template?: boolean; + /** The name of the repository. */ + name?: string; + /** + * Either \`true\` to make the repository private or \`false\` to make it public. Default: \`false\`. + * **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. * @default false */ private?: boolean; - /** The discussion post's title. */ - title: string; + /** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ + visibility?: ReposUpdateVisibilityEnum; } -export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgData = GroupMapping; +export type ReposUpdatePullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; -export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +export interface ReposUpdatePullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload { - /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ - groups: { - /** Description of the IdP group. */ - group_description: string; - /** ID of the IdP group. */ - group_id: string; - /** Name of the IdP group. */ - group_name: string; - }[]; +export interface ReposUpdatePullRequestReviewProtectionPayload { + /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of team \`slug\`s with dismissal access */ + teams?: string[]; + /** The list of user \`login\`s with dismissal access */ + users?: string[]; + }; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ + require_code_owner_reviews?: boolean; + /** Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; } -export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyData = GroupMapping; - -export interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams { - teamId: number; -} +export type ReposUpdateReleaseAssetData = ReleaseAsset; -export interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload { - /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ - groups: { - /** @example ""moar cheese pleese"" */ - description?: string; - /** Description of the IdP group. */ - group_description: string; - /** ID of the IdP group. */ - group_id: string; - /** Name of the IdP group. */ - group_name: string; - /** @example ""caceab43fc9ffa20081c"" */ - id?: string; - /** @example ""external-team-6c13e7288ef7"" */ - name?: string; - }[]; - /** @example ""I am not a timestamp"" */ - synced_at?: string; +export interface ReposUpdateReleaseAssetParams { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; } -export interface TeamsCreateParams { - org: string; +export interface ReposUpdateReleaseAssetPayload { + /** An alternate short description of the asset. Used in place of the filename. */ + label?: string; + /** The file name of the asset. */ + name?: string; + /** @example ""uploaded"" */ + state?: string; } -export interface TeamsCreatePayload { - /** The description of the team. */ - description?: string; - /** List GitHub IDs for organization members who will become team maintainers. */ - maintainers?: string[]; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number; - /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" - */ - permission?: TeamsCreatePermissionEnum; - /** - * The level of privacy this team should have. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * Default: \`secret\` - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. - * Default for child team: \`closed\` - */ - privacy?: TeamsCreatePrivacyEnum; - /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ - repo_names?: string[]; -} +export type ReposUpdateReleaseData = Release; -/** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" - */ -export enum TeamsCreatePermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", +export interface ReposUpdateReleaseParams { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; } -/** - * The level of privacy this team should have. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * Default: \`secret\` - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. - * Default for child team: \`closed\` - */ -export enum TeamsCreatePrivacyEnum { - Secret = "secret", - Closed = "closed", +export interface ReposUpdateReleasePayload { + /** Text describing the contents of the tag. */ + body?: string; + /** \`true\` makes the release a draft, and \`false\` publishes the release. */ + draft?: boolean; + /** The name of the release. */ + name?: string; + /** \`true\` to identify the release as a prerelease, \`false\` to identify the release as a full release. */ + prerelease?: boolean; + /** The name of the tag. */ + tag_name?: string; + /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ + target_commitish?: string; } -export type TeamsDeleteDiscussionCommentInOrgData = any; +export type ReposUpdateStatusCheckProtectionData = StatusCheckPolicy; -export interface TeamsDeleteDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; +export interface ReposUpdateStatusCheckProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export type TeamsDeleteDiscussionCommentLegacyData = any; - -export interface TeamsDeleteDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; +export interface ReposUpdateStatusCheckProtectionPayload { + /** The list of status checks to require in order to merge into this branch */ + contexts?: string[]; + /** Require branches to be up to date before merging. */ + strict?: boolean; } -export type TeamsDeleteDiscussionInOrgData = any; - -export interface TeamsDeleteDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; +/** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ +export enum ReposUpdateVisibilityEnum { + Public = "public", + Private = "private", + Visibility = "visibility", + Internal = "internal", } -export type TeamsDeleteDiscussionLegacyData = any; +export type ReposUpdateWebhookConfigForRepoData = WebhookConfig; -export interface TeamsDeleteDiscussionLegacyParams { - discussionNumber: number; - teamId: number; +export interface ReposUpdateWebhookConfigForRepoParams { + hookId: number; + owner: string; + repo: string; } -export type TeamsDeleteInOrgData = any; - -export interface TeamsDeleteInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +/** @example {"content_type":"json","insecure_ssl":"0","secret":"********","url":"https://example.com/webhook"} */ +export interface ReposUpdateWebhookConfigForRepoPayload { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; } -export type TeamsDeleteLegacyData = any; +export type ReposUpdateWebhookData = Hook; -export interface TeamsDeleteLegacyParams { - teamId: number; -} - -export type TeamsGetByNameData = TeamFull; - -export interface TeamsGetByNameParams { - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsGetDiscussionCommentInOrgData = TeamDiscussionComment; - -export interface TeamsGetDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsGetDiscussionCommentLegacyData = TeamDiscussionComment; - -export interface TeamsGetDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; -} - -export type TeamsGetDiscussionInOrgData = TeamDiscussion; - -export interface TeamsGetDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsGetDiscussionLegacyData = TeamDiscussion; - -export interface TeamsGetDiscussionLegacyParams { - discussionNumber: number; - teamId: number; -} - -export type TeamsGetLegacyData = TeamFull; - -export interface TeamsGetLegacyParams { - teamId: number; -} - -export type TeamsGetMemberLegacyData = any; - -export interface TeamsGetMemberLegacyParams { - teamId: number; - username: string; -} - -export type TeamsGetMembershipForUserInOrgData = TeamMembership; - -export interface TeamsGetMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; -} - -export type TeamsGetMembershipForUserLegacyData = TeamMembership; - -export interface TeamsGetMembershipForUserLegacyParams { - teamId: number; - username: string; +export interface ReposUpdateWebhookParams { + hookId: number; + owner: string; + repo: string; } -export type TeamsListChildInOrgData = Team[]; - -export interface TeamsListChildInOrgParams { - org: string; +export interface ReposUpdateWebhookPayload { /** - * Page number of the results to fetch. - * @default 1 + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - page?: number; + active?: boolean; + /** Determines a list of events to be added to the list of events that the Hook triggers for. */ + add_events?: string[]; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ + config?: { + /** @example ""bar@example.com"" */ + address?: string; + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""The Serious Room"" */ + room?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + }; /** - * Results per page (max 100) - * @default 30 + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. + * @default ["push"] */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; + events?: string[]; + /** Determines a list of events to be removed from the list of events that the Hook triggers for. */ + remove_events?: string[]; } -export type TeamsListChildLegacyData = Team[]; +export type ReposUploadReleaseAssetData = ReleaseAsset; -export interface TeamsListChildLegacyParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - teamId: number; +export interface ReposUploadReleaseAssetParams { + label?: string; + name?: string; + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; } -export type TeamsListData = Team[]; - -export type TeamsListDiscussionCommentsInOrgData = TeamDiscussionComment[]; - -export interface TeamsListDiscussionCommentsInOrgParams { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: DirectionEnum6; - discussionNumber: number; - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; -} +/** The raw file data */ +export type ReposUploadReleaseAssetPayload = string; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Repository + * A git repository */ -export enum TeamsListDiscussionCommentsInOrgParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -export type TeamsListDiscussionCommentsLegacyData = TeamDiscussionComment[]; - -export interface TeamsListDiscussionCommentsLegacyParams { +export interface Repository { /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Whether to allow merge commits for pull requests. + * @default true + * @example true */ - direction?: DirectionEnum14; - discussionNumber: number; + allow_merge_commit?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether to allow rebase merges for pull requests. + * @default true + * @example true */ - page?: number; + allow_rebase_merge?: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether to allow squash merges for pull requests. + * @default true + * @example true */ - per_page?: number; - teamId: number; -} - -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum TeamsListDiscussionCommentsLegacyParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -export type TeamsListDiscussionsInOrgData = TeamDiscussion[]; - -export interface TeamsListDiscussionsInOrgParams { + allow_squash_merge?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Whether the repository is archived. + * @default false */ - direction?: DirectionEnum5; - org: string; + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - page?: number; + contributors_url: string; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; -} - -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum TeamsListDiscussionsInOrgParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -export type TeamsListDiscussionsLegacyData = TeamDiscussion[]; - -export interface TeamsListDiscussionsLegacyParams { + created_at: string | null; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * The default branch of the repository. + * @example "master" */ - direction?: DirectionEnum13; + default_branch: string; /** - * Page number of the results to fetch. - * @default 1 + * Whether to delete head branches when pull requests are merged + * @default false + * @example false */ - page?: number; + delete_branch_on_merge?: boolean; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - per_page?: number; - teamId: number; -} - -/** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ -export enum TeamsListDiscussionsLegacyParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -export type TeamsListForAuthenticatedUserData = TeamFull[]; - -export interface TeamsListForAuthenticatedUserParams { + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - page?: number; + downloads_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - per_page?: number; -} - -export type TeamsListIdpGroupsForLegacyData = GroupMapping; - -export interface TeamsListIdpGroupsForLegacyParams { - teamId: number; -} - -export type TeamsListIdpGroupsForOrgData = GroupMapping; - -export interface TeamsListIdpGroupsForOrgParams { - org: string; + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - page?: number; + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; /** - * Results per page (max 100) - * @default 30 + * Whether downloads are enabled. + * @default true + * @example true */ - per_page?: number; -} - -export type TeamsListIdpGroupsInOrgData = GroupMapping; - -export interface TeamsListIdpGroupsInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsListMembersInOrgData = SimpleUser[]; - -export interface TeamsListMembersInOrgParams { - org: string; + has_downloads: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether issues are enabled. + * @default true + * @example true */ - page?: number; + has_issues: boolean; + has_pages: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether projects are enabled. + * @default true + * @example true */ - per_page?: number; + has_projects: boolean; /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" + * Whether the wiki is enabled. + * @default true + * @example true */ - role?: RoleEnum1; - /** team_slug parameter */ - teamSlug: string; -} - -/** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ -export enum TeamsListMembersInOrgParams1RoleEnum { - Member = "member", - Maintainer = "maintainer", - All = "all", -} - -export type TeamsListMembersLegacyData = SimpleUser[]; - -export interface TeamsListMembersLegacyParams { + has_wiki: boolean; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://github.com" */ - page?: number; + homepage: string | null; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - per_page?: number; + hooks_url: string; /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" + * @format uri + * @example "https://github.com/octocat/Hello-World" */ - role?: RoleEnum2; - teamId: number; -} - -/** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ -export enum TeamsListMembersLegacyParams1RoleEnum { - Member = "member", - Maintainer = "maintainer", - All = "all", -} - -export interface TeamsListParams { - org: string; + html_url: string; /** - * Page number of the results to fetch. - * @default 1 + * Unique identifier of the repository + * @example 42 */ - page?: number; + id: number; /** - * Results per page (max 100) - * @default 30 + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true */ - per_page?: number; -} - -export type TeamsListPendingInvitationsInOrgData = OrganizationInvitation[]; - -export interface TeamsListPendingInvitationsInOrgParams { - org: string; + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - page?: number; + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsListPendingInvitationsLegacyData = OrganizationInvitation[]; - -export interface TeamsListPendingInvitationsLegacyParams { + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "git:git.example.com/octocat/Hello-World" */ - page?: number; + mirror_url: string | null; /** - * Results per page (max 100) - * @default 30 + * The name of the repository. + * @example "Team Environment" */ - per_page?: number; - teamId: number; -} - -export type TeamsListProjectsInOrgData = TeamProject[]; - -export interface TeamsListProjectsInOrgParams { - org: string; + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + maintain?: boolean; + pull: boolean; + push: boolean; + triage?: boolean; + }; /** - * Page number of the results to fetch. - * @default 1 + * Whether the repository is private or public. + * @default false */ - page?: number; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsListProjectsLegacyData = TeamProject[]; - -export interface TeamsListProjectsLegacyParams { + pushed_at: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - page?: number; + stargazers_url: string; + /** @example ""2020-07-09T00:17:42Z"" */ + starred_at?: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - per_page?: number; - teamId: number; -} - -export type TeamsListReposInOrgData = MinimalRepository[]; - -export interface TeamsListReposInOrgParams { - org: string; + subscribers_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - page?: number; + subscription_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsListReposLegacyData = MinimalRepository[]; - -export interface TeamsListReposLegacyParams { + svn_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - page?: number; + tags_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" */ - per_page?: number; - teamId: number; -} - -export type TeamsRemoveMemberLegacyData = any; - -export interface TeamsRemoveMemberLegacyParams { - teamId: number; - username: string; -} - -export type TeamsRemoveMembershipForUserInOrgData = any; - -export interface TeamsRemoveMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; -} - -export type TeamsRemoveMembershipForUserLegacyData = any; - -export interface TeamsRemoveMembershipForUserLegacyParams { - teamId: number; - username: string; -} - -export type TeamsRemoveProjectInOrgData = any; - -export interface TeamsRemoveProjectInOrgParams { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsRemoveProjectLegacyData = any; - -export interface TeamsRemoveProjectLegacyParams { - projectId: number; - teamId: number; -} - -export type TeamsRemoveRepoInOrgData = any; - -export interface TeamsRemoveRepoInOrgParams { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsRemoveRepoLegacyData = any; - -export interface TeamsRemoveRepoLegacyParams { - owner: string; - repo: string; - teamId: number; -} - -export type TeamsUpdateDiscussionCommentInOrgData = TeamDiscussionComment; - -export interface TeamsUpdateDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export interface TeamsUpdateDiscussionCommentInOrgPayload { - /** The discussion comment's body text. */ - body: string; -} - -export type TeamsUpdateDiscussionCommentLegacyData = TeamDiscussionComment; - -export interface TeamsUpdateDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; -} - -export interface TeamsUpdateDiscussionCommentLegacyPayload { - /** The discussion comment's body text. */ - body: string; -} - -export type TeamsUpdateDiscussionInOrgData = TeamDiscussion; - -export interface TeamsUpdateDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export interface TeamsUpdateDiscussionInOrgPayload { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; -} - -export type TeamsUpdateDiscussionLegacyData = TeamDiscussion; - -export interface TeamsUpdateDiscussionLegacyParams { - discussionNumber: number; - teamId: number; -} - -export interface TeamsUpdateDiscussionLegacyPayload { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; -} - -export type TeamsUpdateInOrgData = TeamFull; - -export interface TeamsUpdateInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; -} - -export interface TeamsUpdateInOrgPayload { - /** The description of the team. */ - description?: string; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number; + teams_url: string; + temp_clone_token?: string; + template_repository?: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url?: string; + archived?: boolean; + assignees_url?: string; + blobs_url?: string; + branches_url?: string; + clone_url?: string; + collaborators_url?: string; + comments_url?: string; + commits_url?: string; + compare_url?: string; + contents_url?: string; + contributors_url?: string; + created_at?: string; + default_branch?: string; + delete_branch_on_merge?: boolean; + deployments_url?: string; + description?: string; + disabled?: boolean; + downloads_url?: string; + events_url?: string; + fork?: boolean; + forks_count?: number; + forks_url?: string; + full_name?: string; + git_commits_url?: string; + git_refs_url?: string; + git_tags_url?: string; + git_url?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_pages?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + homepage?: string; + hooks_url?: string; + html_url?: string; + id?: number; + is_template?: boolean; + issue_comment_url?: string; + issue_events_url?: string; + issues_url?: string; + keys_url?: string; + labels_url?: string; + language?: string; + languages_url?: string; + merges_url?: string; + milestones_url?: string; + mirror_url?: string; + name?: string; + network_count?: number; + node_id?: string; + notifications_url?: string; + open_issues_count?: number; + owner?: { + avatar_url?: string; + events_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string; + html_url?: string; + id?: number; + login?: string; + node_id?: string; + organizations_url?: string; + received_events_url?: string; + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + subscriptions_url?: string; + type?: string; + url?: string; + }; + permissions?: { + admin?: boolean; + pull?: boolean; + push?: boolean; + }; + private?: boolean; + pulls_url?: string; + pushed_at?: string; + releases_url?: string; + size?: number; + ssh_url?: string; + stargazers_count?: number; + stargazers_url?: string; + statuses_url?: string; + subscribers_count?: number; + subscribers_url?: string; + subscription_url?: string; + svn_url?: string; + tags_url?: string; + teams_url?: string; + temp_clone_token?: string; + topics?: string[]; + trees_url?: string; + updated_at?: string; + url?: string; + visibility?: string; + watchers_count?: number; + } | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" + * @format date-time + * @example "2011-01-26T19:14:43Z" */ - permission?: TeamsUpdateInOrgPermissionEnum; + updated_at: string | null; /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" */ - privacy?: TeamsUpdateInOrgPrivacyEnum; + url: string; + /** + * The repository visibility: public, private, or internal. + * @default "public" + */ + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; } /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" + * Repository Collaborator Permission + * Repository Collaborator Permission */ -export enum TeamsUpdateInOrgPermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", +export interface RepositoryCollaboratorPermission { + permission: string; + user: SimpleUser | null; } /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. + * Repository Invitation + * Repository invitations let you manage who you collaborate with. */ -export enum TeamsUpdateInOrgPrivacyEnum { - Secret = "secret", - Closed = "closed", -} - -export type TeamsUpdateLegacyData = TeamFull; - -export interface TeamsUpdateLegacyParams { - teamId: number; -} - -export interface TeamsUpdateLegacyPayload { - /** The description of the team. */ - description?: string; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number | null; +export interface RepositoryInvitation { /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" + * @format date-time + * @example "2016-06-13T14:52:50-05:00" */ - permission?: TeamsUpdateLegacyPermissionEnum; + created_at: string; + /** Whether or not the invitation has expired */ + expired?: boolean; + /** @example "https://github.com/octocat/Hello-World/invitations" */ + html_url: string; /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. + * Unique identifier of the repository invitation. + * @example 42 */ - privacy?: TeamsUpdateLegacyPrivacyEnum; + id: number; + invitee: SimpleUser | null; + inviter: SimpleUser | null; + node_id: string; + /** + * The permission associated with the invitation. + * @example "read" + */ + permissions: RepositoryInvitationPermissionsEnum; + /** Minimal Repository */ + repository: MinimalRepository; + /** + * URL for the repository invitation + * @example "https://api.github.com/user/repository-invitations/1" + */ + url: string; } /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" + * The permission associated with the invitation. + * @example "read" */ -export enum TeamsUpdateLegacyPermissionEnum { - Pull = "pull", - Push = "push", +export enum RepositoryInvitationPermissionsEnum { + Read = "read", + Write = "write", Admin = "admin", } /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. + * Repository Invitation + * Repository invitations let you manage who you collaborate with. */ -export enum TeamsUpdateLegacyPrivacyEnum { - Secret = "secret", - Closed = "closed", +export interface RepositorySubscription { + /** + * @format date-time + * @example "2012-10-06T21:34:12Z" + */ + created_at: string; + /** Determines if all notifications should be blocked from this repository. */ + ignored: boolean; + reason: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example" + */ + repository_url: string; + /** + * Determines if notifications should be received from this repository. + * @example true + */ + subscribed: boolean; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/subscription" + */ + url: string; } -/** - * Thread - * Thread - */ -export interface Thread { - id: string; - last_read_at: string | null; - reason: string; - /** Minimal Repository */ - repository: MinimalRepository; - subject: { - latest_comment_url: string; - title: string; - type: string; - url: string; - }; - /** @example "https://api.github.com/notifications/threads/2/subscription" */ - subscription_url: string; - unread: boolean; - updated_at: string; - url: string; -} +/** Requires Authentication */ +export type RequiresAuthentication = BasicError; /** - * Thread Subscription - * Thread Subscription + * Legacy Review Comment + * Legacy Review Comment */ -export interface ThreadSubscription { +export interface ReviewComment { + _links: { + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + pull_request: Link; + /** Hypermedia Link */ + self: Link; + }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** @example "Great stuff" */ + body: string; + body_html?: string; + body_text?: string; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_id: string; /** * @format date-time - * @example "2012-10-06T21:34:12Z" + * @example "2011-04-14T16:00:49Z" */ - created_at: string | null; - ignored: boolean; - reason: string | null; + created_at: string; + /** @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." */ + diff_hunk: string; /** * @format uri - * @example "https://api.github.com/repos/1" + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" */ - repository_url?: string; - /** @example true */ - subscribed: boolean; + html_url: string; + /** @example 10 */ + id: number; + /** @example 8 */ + in_reply_to_id?: number; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + line?: number; + /** @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" */ + node_id: string; + /** @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" */ + original_commit_id: string; + /** + * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + original_line?: number; + /** @example 4 */ + original_position: number; + /** + * The original first line of the range for a multi-line comment. + * @example 2 + */ + original_start_line?: number | null; + /** @example "file1.txt" */ + path: string; + /** @example 1 */ + position: number | null; + /** @example 42 */ + pull_request_review_id: number | null; /** * @format uri - * @example "https://api.github.com/notifications/threads/1" + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" */ - thread_url?: string; + pull_request_url: string; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + side?: ReviewCommentSideEnum; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + start_line?: number | null; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + start_side?: ReviewCommentStartSideEnum | null; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + updated_at: string; /** * @format uri - * @example "https://api.github.com/notifications/threads/1/subscription" + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" */ url: string; + user: SimpleUser | null; } /** - * Topic - * A topic aggregates entities that are related to a subject. + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" */ -export interface Topic { - names: string[]; +export enum ReviewCommentSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } /** - * Topic Search Result Item - * Topic Search Result Item + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" */ -export interface TopicSearchResultItem { - aliases?: - | { - topic_relation?: { - id?: number; - name?: string; - relation_type?: string; - topic_id?: number; - }; - }[] - | null; - /** @format date-time */ - created_at: string; - created_by: string | null; - curated: boolean; - description: string | null; - display_name: string | null; - featured: boolean; - /** @format uri */ - logo_url?: string | null; - name: string; - related?: - | { - topic_relation?: { - id?: number; - name?: string; - relation_type?: string; - topic_id?: number; - }; - }[] - | null; - released: string | null; - repository_count?: number | null; - score: number; - short_description: string | null; - text_matches?: SearchResultTextMatches; - /** @format date-time */ - updated_at: string; -} - -/** Traffic */ -export interface Traffic { - count: number; - /** @format date-time */ - timestamp: string; - uniques: number; +export enum ReviewCommentStartSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } -/** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ -export enum TypeEnum { +/** + * Filter members returned by their role. Can be one of: + * \\* \`all\` - All members of the organization, regardless of role. + * \\* \`admin\` - Organization owners. + * \\* \`member\` - Non-owner organization members. + * @default "all" + */ +export enum RoleEnum { All = "all", - Public = "public", - Private = "private", - Forks = "forks", - Sources = "sources", + Admin = "admin", Member = "member", - Internal = "internal", } /** - * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` - * - * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. * @default "all" */ -export enum TypeEnum1 { - All = "all", - Owner = "owner", - Public = "public", - Private = "private", +export enum RoleEnum1 { Member = "member", + Maintainer = "maintainer", + All = "all", } /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" */ -export enum TypeEnum2 { - All = "all", - Owner = "owner", +export enum RoleEnum2 { Member = "member", + Maintainer = "maintainer", + All = "all", } /** - * User Marketplace Purchase - * User Marketplace Purchase + * Self hosted runners + * A self hosted runner */ -export interface UserMarketplacePurchase { - account: MarketplaceAccount; - /** @example "monthly" */ - billing_cycle: string; +export interface Runner { + busy: boolean; /** - * @format date-time - * @example "2017-11-11T00:00:00Z" + * The id of the runner. + * @example 5 */ - free_trial_ends_on: string | null; + id: number; + labels: { + /** Unique identifier of the label. */ + id?: number; + /** Name of the label. */ + name?: string; + /** The type of label. Read-only labels are applied automatically when the runner is configured. */ + type?: RunnerTypeEnum; + }[]; /** - * @format date-time - * @example "2017-11-11T00:00:00Z" + * The name of the runner. + * @example "iMac" */ - next_billing_date: string | null; - /** @example true */ - on_free_trial: boolean; - /** Marketplace Listing Plan */ - plan: MarketplaceListingPlan; - unit_count: number | null; + name: string; /** - * @format date-time - * @example "2017-11-02T01:12:12Z" + * The Operating System of the runner. + * @example "macos" */ - updated_at: string | null; + os: string; + /** + * The status of the runner. + * @example "online" + */ + status: string; } /** - * User Search Result Item - * User Search Result Item + * Runner Application + * Runner Application */ -export interface UserSearchResultItem { - /** @format uri */ - avatar_url: string; - bio?: string | null; - blog?: string | null; - company?: string | null; - /** @format date-time */ - created_at?: string; - /** @format email */ - email?: string | null; - events_url: string; - followers?: number; - /** @format uri */ - followers_url: string; - following?: number; - following_url: string; - gists_url: string; - gravatar_id: string | null; - hireable?: boolean | null; - /** @format uri */ - html_url: string; +export interface RunnerApplication { + architecture: string; + download_url: string; + filename: string; + os: string; +} + +export interface RunnerGroupsEnterprise { + allows_public_repositories: boolean; + default: boolean; id: number; - location?: string | null; - login: string; - name?: string | null; - node_id: string; - /** @format uri */ - organizations_url: string; - public_gists?: number; - public_repos?: number; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - score: number; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - /** @format date-time */ - suspended_at?: string | null; - text_matches?: SearchResultTextMatches; - type: string; - /** @format date-time */ - updated_at?: string; - /** @format uri */ - url: string; + name: string; + runners_url: string; + selected_organizations_url?: string; + visibility: string; } -export type UsersAddEmailForAuthenticatedData = Email[]; +export interface RunnerGroupsOrg { + allows_public_repositories: boolean; + default: boolean; + id: number; + inherited: boolean; + inherited_allows_public_repositories?: boolean; + name: string; + runners_url: string; + /** Link to the selected repositories resource for this runner group. Not present unless visibility was set to \`selected\` */ + selected_repositories_url?: string; + visibility: string; +} -export type UsersAddEmailForAuthenticatedPayload = - | { - /** - * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. - * @example [] - */ - emails: string[]; - } - | string[] - | string; +/** The type of label. Read-only labels are applied automatically when the runner is configured. */ +export enum RunnerTypeEnum { + ReadOnly = "read-only", + Custom = "custom", +} -export type UsersBlockData = any; +/** Bad Request */ +export type ScimBadRequest = ScimError; -export interface UsersBlockParams { - username: string; -} +/** Conflict */ +export type ScimConflict = ScimError; -export type UsersCheckBlockedData = any; +export type ScimDeleteUserFromOrgData = any; -export type UsersCheckBlockedError = BasicError; +export interface ScimDeleteUserFromOrgParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; +} -export interface UsersCheckBlockedParams { - username: string; +export interface ScimEnterpriseGroup { + displayName?: string; + externalId?: string | null; + id: string; + members?: { + $ref?: string; + display?: string; + value?: string; + }[]; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + schemas: string[]; } -export type UsersCheckFollowingForUserData = any; +export interface ScimEnterpriseUser { + active?: boolean; + emails?: { + primary?: boolean; + type?: string; + value?: string; + }[]; + externalId?: string; + groups?: { + value?: string; + }[]; + id: string; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + name?: { + familyName?: string; + givenName?: string; + }; + schemas: string[]; + userName?: string; +} -export interface UsersCheckFollowingForUserParams { - targetUser: string; - username: string; +/** + * Scim Error + * Scim Error + */ +export interface ScimError { + detail?: string | null; + documentation_url?: string | null; + message?: string | null; + schemas?: string[]; + scimType?: string | null; + status?: number; } -export type UsersCheckPersonIsFollowedByAuthenticatedData = any; +/** Forbidden */ +export type ScimForbidden = ScimError; -export type UsersCheckPersonIsFollowedByAuthenticatedError = BasicError; +export type ScimGetProvisioningInformationForUserData = ScimUser; -export interface UsersCheckPersonIsFollowedByAuthenticatedParams { - username: string; +export interface ScimGetProvisioningInformationForUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; } -export type UsersCreateGpgKeyForAuthenticatedData = GpgKey; - -export interface UsersCreateGpgKeyForAuthenticatedPayload { - /** A GPG key in ASCII-armored format. */ - armored_public_key: string; +export interface ScimGroupListEnterprise { + Resources: { + displayName?: string; + externalId?: string | null; + id: string; + members?: { + $ref?: string; + display?: string; + value?: string; + }[]; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + schemas: string[]; + }[]; + itemsPerPage: number; + schemas: string[]; + startIndex: number; + totalResults: number; } -export type UsersCreatePublicSshKeyForAuthenticatedData = Key; +/** Internal Error */ +export type ScimInternalError = ScimError; -export interface UsersCreatePublicSshKeyForAuthenticatedPayload { - /** - * The public SSH key to add to your GitHub account. - * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) - */ - key: string; +export type ScimListProvisionedIdentitiesData = ScimUserList; + +export interface ScimListProvisionedIdentitiesParams { + /** Used for pagination: the number of results to return. */ + count?: number; /** - * A descriptive name for the new key. - * @example "Personal MacBook Air" + * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: + * + * \`?filter=userName%20eq%20\\"Octocat\\"\`. + * + * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: + * + * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. */ - title?: string; + filter?: string; + org: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; } -export type UsersDeleteEmailForAuthenticatedData = any; +/** Resource Not Found */ +export type ScimNotFound = ScimError; -/** Deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. */ -export type UsersDeleteEmailForAuthenticatedPayload = - | { - /** Email addresses associated with the GitHub user account. */ - emails: string[]; - } - | string[] - | string; +export type ScimProvisionAndInviteUserData = ScimUser; -export type UsersDeleteGpgKeyForAuthenticatedData = any; - -export interface UsersDeleteGpgKeyForAuthenticatedParams { - /** gpg_key_id parameter */ - gpgKeyId: number; +export interface ScimProvisionAndInviteUserParams { + org: string; } -export type UsersDeletePublicSshKeyForAuthenticatedData = any; - -export interface UsersDeletePublicSshKeyForAuthenticatedParams { - /** key_id parameter */ - keyId: number; +export interface ScimProvisionAndInviteUserPayload { + active?: boolean; + /** + * The name of the user, suitable for display to end-users + * @example "Jon Doe" + */ + displayName?: string; + /** + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + */ + emails: { + primary?: boolean; + type?: string; + value: string; + }[]; + externalId?: string; + groups?: string[]; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string; + formatted?: string; + givenName: string; + }; + schemas?: string[]; + /** + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" + */ + userName: string; } -export type UsersFollowData = any; +export type ScimSetInformationForProvisionedUserData = ScimUser; -export interface UsersFollowParams { - username: string; +export interface ScimSetInformationForProvisionedUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; } -export type UsersGetAuthenticatedData = PrivateUser | PublicUser; - -export type UsersGetByUsernameData = PrivateUser | PublicUser; - -export interface UsersGetByUsernameParams { - username: string; +export interface ScimSetInformationForProvisionedUserPayload { + active?: boolean; + /** + * The name of the user, suitable for display to end-users + * @example "Jon Doe" + */ + displayName?: string; + /** + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + */ + emails: { + primary?: boolean; + type?: string; + value: string; + }[]; + externalId?: string; + groups?: string[]; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string; + formatted?: string; + givenName: string; + }; + schemas?: string[]; + /** + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" + */ + userName: string; } -export type UsersGetContextForUserData = Hovercard; +export type ScimUpdateAttributeForUserData = ScimUser; -export interface UsersGetContextForUserParams { - /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ - subject_id?: string; - /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ - subject_type?: SubjectTypeEnum; - username: string; -} +export type ScimUpdateAttributeForUserError = BasicError; -/** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ -export enum UsersGetContextForUserParams1SubjectTypeEnum { - Organization = "organization", - Repository = "repository", - Issue = "issue", - PullRequest = "pull_request", +export enum ScimUpdateAttributeForUserOpEnum { + Add = "add", + Remove = "remove", + Replace = "replace", } -export type UsersGetGpgKeyForAuthenticatedData = GpgKey; - -export interface UsersGetGpgKeyForAuthenticatedParams { - /** gpg_key_id parameter */ - gpgKeyId: number; +export interface ScimUpdateAttributeForUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; } -export type UsersGetPublicSshKeyForAuthenticatedData = Key; - -export interface UsersGetPublicSshKeyForAuthenticatedParams { - /** key_id parameter */ - keyId: number; +export interface ScimUpdateAttributeForUserPayload { + /** + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] + */ + Operations: { + op: ScimUpdateAttributeForUserOpEnum; + path?: string; + value?: + | { + active?: boolean | null; + externalId?: string | null; + familyName?: string | null; + givenName?: string | null; + userName?: string | null; + } + | { + primary?: boolean; + value?: string; + }[] + | string; + }[]; + schemas?: string[]; } -export type UsersListBlockedByAuthenticatedData = SimpleUser[]; - -export type UsersListData = SimpleUser[]; - -export type UsersListEmailsForAuthenticatedData = Email[]; - -export interface UsersListEmailsForAuthenticatedParams { +/** + * SCIM /Users + * SCIM /Users provisioning endpoints + */ +export interface ScimUser { /** - * Page number of the results to fetch. - * @default 1 + * The active status of the User. + * @example true */ - page?: number; + active: boolean; /** - * Results per page (max 100) - * @default 30 + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - per_page?: number; -} - -export type UsersListFollowedByAuthenticatedData = SimpleUser[]; - -export interface UsersListFollowedByAuthenticatedParams { + displayName?: string | null; /** - * Page number of the results to fetch. - * @default 1 + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] */ - page?: number; + emails: { + primary?: boolean; + value: string; + }[]; /** - * Results per page (max 100) - * @default 30 + * The ID of the User. + * @example "a7b0f98395" */ - per_page?: number; -} - -export type UsersListFollowersForAuthenticatedUserData = SimpleUser[]; - -export interface UsersListFollowersForAuthenticatedUserParams { + externalId: string | null; + /** associated groups */ + groups?: { + display?: string; + value?: string; + }[]; /** - * Page number of the results to fetch. - * @default 1 + * Unique identifier of an external identity + * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" */ - page?: number; + id: string; + meta: { + /** + * @format date-time + * @example "2019-01-24T22:45:36.000Z" + */ + created?: string; + /** + * @format date-time + * @example "2019-01-24T22:45:36.000Z" + */ + lastModified?: string; + /** + * @format uri + * @example "https://api.github.com/scim/v2/organizations/myorg-123abc55141bfd8f/Users/c42772b5-2029-11e9-8543-9264a97dec8d" + */ + location?: string; + /** @example "User" */ + resourceType?: string; + }; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string | null; + formatted?: string | null; + givenName: string | null; + }; /** - * Results per page (max 100) - * @default 30 + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] */ - per_page?: number; -} - -export type UsersListFollowersForUserData = SimpleUser[]; - -export interface UsersListFollowersForUserParams { + operations?: { + op: ScimUserOpEnum; + path?: string; + value?: string | object | any[]; + }[]; + /** The ID of the organization. */ + organization_id?: number; /** - * Page number of the results to fetch. - * @default 1 + * SCIM schema used. + * @minItems 1 */ - page?: number; + schemas: string[]; /** - * Results per page (max 100) - * @default 30 + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" */ - per_page?: number; - username: string; + userName: string | null; } -export type UsersListFollowingForUserData = SimpleUser[]; - -export interface UsersListFollowingForUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +/** + * SCIM User List + * SCIM User List + */ +export interface ScimUserList { + Resources: ScimUser[]; + /** @example 10 */ + itemsPerPage: number; /** - * Results per page (max 100) - * @default 30 + * SCIM schema used. + * @minItems 1 */ - per_page?: number; - username: string; + schemas: string[]; + /** @example 1 */ + startIndex: number; + /** @example 3 */ + totalResults: number; } -export type UsersListGpgKeysForAuthenticatedData = GpgKey[]; +export interface ScimUserListEnterprise { + Resources: { + active?: boolean; + emails?: { + primary?: boolean; + type?: string; + value?: string; + }[]; + externalId?: string; + groups?: { + value?: string; + }[]; + id: string; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + name?: { + familyName?: string; + givenName?: string; + }; + schemas: string[]; + userName?: string; + }[]; + itemsPerPage: number; + schemas: string[]; + startIndex: number; + totalResults: number; +} -export interface UsersListGpgKeysForAuthenticatedParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export enum ScimUserOpEnum { + Add = "add", + Remove = "remove", + Replace = "replace", +} + +/** Scoped Installation */ +export interface ScopedInstallation { + /** Simple User */ + account: SimpleUser; + /** @example true */ + has_multiple_single_files?: boolean; + /** The permissions granted to the user-to-server access token. */ + permissions: AppPermissions; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://api.github.com/users/octocat/repos" */ - per_page?: number; + repositories_url: string; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: ScopedInstallationRepositorySelectionEnum; + /** @example "config.yaml" */ + single_file_name: string | null; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; } -export type UsersListGpgKeysForUserData = GpgKey[]; +/** Describe whether all repositories have been selected or there's a selection involved */ +export enum ScopedInstallationRepositorySelectionEnum { + All = "all", + Selected = "selected", +} -export interface UsersListGpgKeysForUserParams { +export interface SearchCodeData { + incomplete_results: boolean; + items: CodeSearchResultItem[]; + total_count: number; +} + +export interface SearchCodeParams { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: OrderEnum2; /** * Page number of the results to fetch. * @default 1 @@ -34007,22 +32669,38 @@ export interface UsersListGpgKeysForUserParams { * @default 30 */ per_page?: number; - username: string; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum12; } -export interface UsersListParams { - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum SearchCodeParams1OrderEnum { + Desc = "desc", + Asc = "asc", } -export type UsersListPublicEmailsForAuthenticatedData = Email[]; +/** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchCodeParams1SortEnum { + Indexed = "indexed", +} -export interface UsersListPublicEmailsForAuthenticatedParams { +export interface SearchCommitsData { + incomplete_results: boolean; + items: CommitSearchResultItem[]; + total_count: number; +} + +export interface SearchCommitsParams { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: OrderEnum3; /** * Page number of the results to fetch. * @default 1 @@ -34033,27 +32711,39 @@ export interface UsersListPublicEmailsForAuthenticatedParams { * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum13; } -export type UsersListPublicKeysForUserData = KeySimple[]; +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum SearchCommitsParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} -export interface UsersListPublicKeysForUserParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - username: string; +/** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchCommitsParams1SortEnum { + AuthorDate = "author-date", + CommitterDate = "committer-date", } -export type UsersListPublicSshKeysForAuthenticatedData = Key[]; +export interface SearchIssuesAndPullRequestsData { + incomplete_results: boolean; + items: IssueSearchResultItem[]; + total_count: number; +} -export interface UsersListPublicSshKeysForAuthenticatedParams { +export interface SearchIssuesAndPullRequestsParams { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: OrderEnum4; /** * Page number of the results to fetch. * @default 1 @@ -34064,6601 +32754,4640 @@ export interface UsersListPublicSshKeysForAuthenticatedParams { * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum14; } -export type UsersSetPrimaryEmailVisibilityForAuthenticatedData = Email[]; - -export interface UsersSetPrimaryEmailVisibilityForAuthenticatedPayload { - /** - * An email address associated with the GitHub user account to manage. - * @example "org@example.com" - */ - email: string; - /** Denotes whether an email is publically visible. */ - visibility: UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum; -} - -/** Denotes whether an email is publically visible. */ -export enum UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum { - Public = "public", - Private = "private", +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum SearchIssuesAndPullRequestsParams1OrderEnum { + Desc = "desc", + Asc = "asc", } -export type UsersUnblockData = any; - -export interface UsersUnblockParams { - username: string; +/** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchIssuesAndPullRequestsParams1SortEnum { + Comments = "comments", + Reactions = "reactions", + Reactions1 = "reactions-+1", + Reactions11 = "reactions--1", + ReactionsSmile = "reactions-smile", + ReactionsThinkingFace = "reactions-thinking_face", + ReactionsHeart = "reactions-heart", + ReactionsTada = "reactions-tada", + Interactions = "interactions", + Created = "created", + Updated = "updated", } -export type UsersUnfollowData = any; - -export interface UsersUnfollowParams { - username: string; +export interface SearchLabelsData { + incomplete_results: boolean; + items: LabelSearchResultItem[]; + total_count: number; } -export type UsersUpdateAuthenticatedData = PrivateUser; - -export interface UsersUpdateAuthenticatedPayload { - /** The new short biography of the user. */ - bio?: string; +export interface SearchLabelsParams { /** - * The new blog URL of the user. - * @example "blog.example.com" + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" */ - blog?: string; + order?: OrderEnum5; + /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + /** The id of the repository. */ + repository_id: number; + /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum15; +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum SearchLabelsParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} + +/** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchLabelsParams1SortEnum { + Created = "created", + Updated = "updated", +} + +export interface SearchReposData { + incomplete_results: boolean; + items: RepoSearchResultItem[]; + total_count: number; +} + +export interface SearchReposParams { /** - * The new company of the user. - * @example "Acme corporation" + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" */ - company?: string; + order?: OrderEnum6; /** - * The publicly visible email address of the user. - * @example "omar@example.com" + * Page number of the results to fetch. + * @default 1 */ - email?: string; - /** The new hiring availability of the user. */ - hireable?: boolean; + page?: number; /** - * The new location of the user. - * @example "Berlin, Germany" + * Results per page (max 100) + * @default 30 */ - location?: string; + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum16; +} + +/** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ +export enum SearchReposParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} + +/** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchReposParams1SortEnum { + Stars = "stars", + Forks = "forks", + HelpWantedIssues = "help-wanted-issues", + Updated = "updated", +} + +/** Search Result Text Matches */ +export type SearchResultTextMatches = { + fragment?: string; + matches?: { + indices?: number[]; + text?: string; + }[]; + object_type?: string | null; + object_url?: string; + property?: string; +}[]; + +export interface SearchTopicsData { + incomplete_results: boolean; + items: TopicSearchResultItem[]; + total_count: number; +} + +export interface SearchTopicsParams { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; +} + +export interface SearchUsersData { + incomplete_results: boolean; + items: UserSearchResultItem[]; + total_count: number; +} + +export interface SearchUsersParams { /** - * The new name of the user. - * @example "Omar Jahandar" + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" */ - name?: string; + order?: OrderEnum7; /** - * The new Twitter username of the user. - * @example "therealomarj" + * Page number of the results to fetch. + * @default 1 */ - twitter_username?: string | null; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SortEnum17; } /** - * Validation Error - * Validation Error + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" */ -export interface ValidationError { - documentation_url: string; - errors?: { - code: string; - field?: string; - index?: number; - message?: string; - resource?: string; - value?: string | null | number | null | string[] | null; - }[]; - message: string; +export enum SearchUsersParams1OrderEnum { + Desc = "desc", + Asc = "asc", } -/** - * Validation Error Simple - * Validation Error Simple - */ -export interface ValidationErrorSimple { - documentation_url: string; - errors?: string[]; - message: string; +/** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SearchUsersParams1SortEnum { + Followers = "followers", + Repositories = "repositories", + Joined = "joined", } -/** Validation Failed */ -export type ValidationFailed = ValidationError; +export interface SecretScanningAlert { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at?: AlertCreatedAt; + /** The GitHub URL of the alert resource. */ + html_url?: AlertHtmlUrl; + /** The security alert number. */ + number?: AlertNumber; + /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ + resolution?: SecretScanningAlertResolution; + /** + * The time that the alert was resolved in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time + */ + resolved_at?: string | null; + /** Simple User */ + resolved_by?: SimpleUser; + /** The secret that was detected. */ + secret?: string; + /** The type of secret that secret scanning detected. */ + secret_type?: string; + /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ + state?: SecretScanningAlertState; + /** The REST API URL of the alert resource. */ + url?: AlertUrl; +} -/** Validation Failed */ -export type ValidationFailedSimple = ValidationErrorSimple; +/** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ +export type SecretScanningAlertResolution = + SecretScanningAlertResolutionEnum | null; -/** Verification */ -export interface Verification { - payload: string | null; - reason: string; - signature: string | null; - verified: boolean; +export enum SecretScanningAlertResolutionEnum { + FalsePositive = "false_positive", + WontFix = "wont_fix", + Revoked = "revoked", + UsedInTests = "used_in_tests", } -/** - * View Traffic - * View Traffic - */ -export interface ViewTraffic { - /** @example 14850 */ - count: number; - /** @example 3782 */ - uniques: number; - views: Traffic[]; +/** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ +export enum SecretScanningAlertState { + Open = "open", + Resolved = "resolved", } -/** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ -export enum VisibilityEnum { - All = "all", - Public = "public", - Private = "private", +export type SecretScanningGetAlertData = SecretScanningAlert; + +export interface SecretScanningGetAlertParams { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; } -/** - * Webhook Configuration - * Configuration object of the webhook - */ -export interface WebhookConfig { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; +export type SecretScanningListAlertsForRepoData = SecretScanningAlert[]; + +export interface SecretScanningListAlertsForRepoParams { + owner: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; + /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ + state?: StateEnum7; } -/** - * The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. - * @example ""json"" - */ -export type WebhookConfigContentType = string; +/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ +export enum SecretScanningListAlertsForRepoParams1StateEnum { + Open = "open", + Resolved = "resolved", +} -/** - * Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** - * @example ""0"" - */ -export type WebhookConfigInsecureSsl = string; +export type SecretScanningUpdateAlertData = SecretScanningAlert; + +export interface SecretScanningUpdateAlertParams { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; +} + +export interface SecretScanningUpdateAlertPayload { + /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ + resolution?: SecretScanningAlertResolution; + /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ + state: SecretScanningAlertState; +} + +export interface SelectedActions { + /** Whether GitHub-owned actions are allowed. For example, this includes the actions in the \`actions\` organization. */ + github_owned_allowed: boolean; + /** Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, \`monalisa/octocat@*\`, \`monalisa/octocat@v2\`, \`monalisa/*\`." */ + patterns_allowed: string[]; + /** Whether actions in GitHub Marketplace from verified creators are allowed. Set to \`true\` to allow all GitHub Marketplace actions by verified creators. */ + verified_allowed: boolean; +} + +/** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ +export type SelectedActionsUrl = string; + +/** Service Unavailable */ +export interface ServiceUnavailable { + code?: string; + documentation_url?: string; + message?: string; +} /** - * If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). - * @example ""********"" + * Short Blob + * Short Blob */ -export type WebhookConfigSecret = string; +export interface ShortBlob { + sha: string; + url: string; +} /** - * The URL to which the payloads will be delivered. - * @format uri - * @example "https://example.com/webhook" + * Short Branch + * Short Branch */ -export type WebhookConfigUrl = string; +export interface ShortBranch { + commit: { + sha: string; + /** @format uri */ + url: string; + }; + name: string; + protected: boolean; + /** Branch Protection */ + protection?: BranchProtection; + /** @format uri */ + protection_url?: string; +} /** - * Workflow - * A GitHub Actions workflow + * Simple Commit + * Simple Commit */ -export interface Workflow { - /** @example "https://github.com/actions/setup-ruby/workflows/CI/badge.svg" */ - badge_url: string; - /** - * @format date-time - * @example "2019-12-06T14:20:20.000Z" - */ +export interface SimpleCommit { + author: { + email: string; + name: string; + } | null; + committer: { + email: string; + name: string; + } | null; + id: string; + message: string; + /** @format date-time */ + timestamp: string; + tree_id: string; +} + +/** Simple Commit Status */ +export interface SimpleCommitStatus { + /** @format uri */ + avatar_url: string | null; + context: string; + /** @format date-time */ created_at: string; - /** - * @format date-time - * @example "2019-12-06T14:20:20.000Z" - */ - deleted_at?: string; - /** @example "https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml" */ - html_url: string; - /** @example 5 */ + description: string | null; id: number; - /** @example "CI" */ - name: string; - /** @example "MDg6V29ya2Zsb3cxMg==" */ node_id: string; - /** @example "ruby.yaml" */ - path: string; - /** @example "active" */ - state: WorkflowStateEnum; - /** - * @format date-time - * @example "2019-12-06T14:20:20.000Z" - */ + required?: boolean | null; + state: string; + /** @format uri */ + target_url: string; + /** @format date-time */ updated_at: string; - /** @example "https://api.github.com/repos/actions/setup-ruby/workflows/5" */ + /** @format uri */ url: string; } /** - * Workflow Run - * An invocation of a workflow + * Simple User + * Simple User */ -export interface WorkflowRun { - /** - * The URL to the artifacts for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" - */ - artifacts_url: string; +export type SimpleUser = { /** - * The URL to cancel the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/cancel" + * @format uri + * @example "https://github.com/images/error/octocat_happy.gif" */ - cancel_url: string; + avatar_url: string; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; /** - * The URL to the associated check suite. - * @example "https://api.github.com/repos/github/hello-world/check-suites/12" + * @format uri + * @example "https://api.github.com/users/octocat/followers" */ - check_suite_url: string; - /** @example "neutral" */ - conclusion: string | null; - /** @format date-time */ - created_at: string; - /** @example "push" */ - event: string; - /** @example "master" */ - head_branch: string | null; - /** Simple Commit */ - head_commit: SimpleCommit; - /** Minimal Repository */ - head_repository: MinimalRepository; - /** @example 5 */ - head_repository_id?: number; + followers_url: string; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; /** - * The SHA of the head commit that points to the version of the worflow being run. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * @format uri + * @example "https://github.com/octocat" */ - head_sha: string; - /** @example "https://github.com/github/hello-world/suites/4" */ html_url: string; - /** - * The ID of the workflow run. - * @example 5 - */ + /** @example 1 */ id: number; + /** @example "octocat" */ + login: string; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; /** - * The URL to the jobs for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/jobs" - */ - jobs_url: string; - /** - * The URL to download the logs for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/logs" + * @format uri + * @example "https://api.github.com/users/octocat/orgs" */ - logs_url: string; + organizations_url: string; /** - * The name of the workflow run. - * @example "Build" + * @format uri + * @example "https://api.github.com/users/octocat/received_events" */ - name?: string; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - pull_requests: PullRequestMinimal[] | null; - /** Minimal Repository */ - repository: MinimalRepository; + received_events_url: string; /** - * The URL to rerun the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun" + * @format uri + * @example "https://api.github.com/users/octocat/repos" */ - rerun_url: string; + repos_url: string; + site_admin: boolean; + /** @example ""2020-07-09T00:17:55Z"" */ + starred_at?: string; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; /** - * The auto incrementing run number for the workflow run. - * @example 106 + * @format uri + * @example "https://api.github.com/users/octocat/subscriptions" */ - run_number: number; - /** @example "completed" */ - status: string | null; - /** @format date-time */ - updated_at: string; + subscriptions_url: string; + /** @example "User" */ + type: string; /** - * The URL to the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5" + * @format uri + * @example "https://api.github.com/users/octocat" */ url: string; - /** - * The ID of the parent workflow. - * @example 5 - */ - workflow_id: number; - /** - * The URL to the workflow. - * @example "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" - */ - workflow_url: string; +} | null; + +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", } /** - * Workflow Run Usage - * Workflow Run Usage + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export interface WorkflowRunUsage { - billable: { - MACOS?: { - jobs: number; - total_ms: number; - }; - UBUNTU?: { - jobs: number; - total_ms: number; - }; - WINDOWS?: { - jobs: number; - total_ms: number; - }; - }; - run_duration_ms: number; +export enum SortEnum1 { + Created = "created", + Updated = "updated", } -/** @example "active" */ -export enum WorkflowStateEnum { - Active = "active", - Deleted = "deleted", +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum SortEnum10 { + Created = "created", + Updated = "updated", } /** - * Workflow Usage - * Workflow Usage + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export interface WorkflowUsage { - billable: { - MACOS?: { - total_ms?: number; - }; - UBUNTU?: { - total_ms?: number; - }; - WINDOWS?: { - total_ms?: number; - }; - }; +export enum SortEnum11 { + Created = "created", + Updated = "updated", } -export namespace App { - /** - * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsCreateInstallationAccessToken - * @summary Create an installation access token for an app - * @request POST:/app/installations/{installation_id}/access_tokens - */ - export namespace AppsCreateInstallationAccessToken { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = AppsCreateInstallationAccessTokenPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsCreateInstallationAccessTokenData; - } +/** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum12 { + Indexed = "indexed", +} - /** - * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsDeleteInstallation - * @summary Delete an installation for the authenticated app - * @request DELETE:/app/installations/{installation_id} - */ - export namespace AppsDeleteInstallation { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsDeleteInstallationData; - } +/** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum13 { + AuthorDate = "author-date", + CommitterDate = "committer-date", +} - /** - * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetAuthenticated - * @summary Get the authenticated app - * @request GET:/app - */ - export namespace AppsGetAuthenticated { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetAuthenticatedData; - } +/** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum14 { + Comments = "comments", + Reactions = "reactions", + Reactions1 = "reactions-+1", + Reactions11 = "reactions--1", + ReactionsSmile = "reactions-smile", + ReactionsThinkingFace = "reactions-thinking_face", + ReactionsHeart = "reactions-heart", + ReactionsTada = "reactions-tada", + Interactions = "interactions", + Created = "created", + Updated = "updated", +} - /** - * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetInstallation - * @summary Get an installation for the authenticated app - * @request GET:/app/installations/{installation_id} - */ - export namespace AppsGetInstallation { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetInstallationData; - } +/** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum15 { + Created = "created", + Updated = "updated", +} - /** - * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetWebhookConfigForApp - * @summary Get a webhook configuration for an app - * @request GET:/app/hook/config - */ - export namespace AppsGetWebhookConfigForApp { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetWebhookConfigForAppData; - } +/** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum16 { + Stars = "stars", + Forks = "forks", + HelpWantedIssues = "help-wanted-issues", + Updated = "updated", +} - /** - * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. - * @tags apps - * @name AppsListInstallations - * @summary List installations for the authenticated app - * @request GET:/app/installations - */ - export namespace AppsListInstallations { - export type RequestParams = {}; - export type RequestQuery = { - outdated?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListInstallationsData; - } +/** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ +export enum SortEnum17 { + Followers = "followers", + Repositories = "repositories", + Joined = "joined", +} - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsSuspendInstallation - * @summary Suspend an app installation - * @request PUT:/app/installations/{installation_id}/suspended - */ - export namespace AppsSuspendInstallation { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsSuspendInstallationData; - } +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum18 { + Created = "created", + Updated = "updated", + Comments = "comments", +} - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsUnsuspendInstallation - * @summary Unsuspend an app installation - * @request DELETE:/app/installations/{installation_id}/suspended - */ - export namespace AppsUnsuspendInstallation { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsUnsuspendInstallationData; - } +/** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ +export enum SortEnum19 { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", +} - /** - * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsUpdateWebhookConfigForApp - * @summary Update a webhook configuration for an app - * @request PATCH:/app/hook/config - */ - export namespace AppsUpdateWebhookConfigForApp { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = AppsUpdateWebhookConfigForAppPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsUpdateWebhookConfigForAppData; - } +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum SortEnum2 { + Created = "created", + Updated = "updated", } -export namespace AppManifests { - /** - * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. - * @tags apps - * @name AppsCreateFromManifest - * @summary Create a GitHub App from a manifest - * @request POST:/app-manifests/{code}/conversions - */ - export namespace AppsCreateFromManifest { - export type RequestParams = { - code: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsCreateFromManifestData; - } +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum SortEnum20 { + Created = "created", + Updated = "updated", } -export namespace Applications { - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * @tags apps - * @name AppsCheckAuthorization - * @summary Check an authorization - * @request GET:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - export namespace AppsCheckAuthorization { - export type RequestParams = { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsCheckAuthorizationData; - } +/** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ +export enum SortEnum21 { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", +} - /** - * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. - * @tags apps - * @name AppsCheckToken - * @summary Check a token - * @request POST:/applications/{client_id}/token - */ - export namespace AppsCheckToken { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = AppsCheckTokenPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsCheckTokenData; - } +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum SortEnum22 { + Created = "created", + Updated = "updated", +} - /** - * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * @tags apps - * @name AppsDeleteAuthorization - * @summary Delete an app authorization - * @request DELETE:/applications/{client_id}/grant - */ - export namespace AppsDeleteAuthorization { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = AppsDeleteAuthorizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsDeleteAuthorizationData; - } +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum3 { + Created = "created", + Updated = "updated", + Comments = "comments", +} - /** - * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * @tags apps - * @name AppsDeleteToken - * @summary Delete an app token - * @request DELETE:/applications/{client_id}/token - */ - export namespace AppsDeleteToken { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = AppsDeleteTokenPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsDeleteTokenData; - } +/** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "created" + */ +export enum SortEnum4 { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", +} - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * @tags apps - * @name AppsResetAuthorization - * @summary Reset an authorization - * @request POST:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - export namespace AppsResetAuthorization { - export type RequestParams = { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsResetAuthorizationData; - } +/** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ +export enum SortEnum5 { + Newest = "newest", + Oldest = "oldest", + Stargazers = "stargazers", +} - /** - * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * @tags apps - * @name AppsResetToken - * @summary Reset a token - * @request PATCH:/applications/{client_id}/token - */ - export namespace AppsResetToken { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = AppsResetTokenPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsResetTokenData; - } +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum6 { + Created = "created", + Updated = "updated", + Comments = "comments", +} - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * @tags apps - * @name AppsRevokeAuthorizationForApplication - * @summary Revoke an authorization for an application - * @request DELETE:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - export namespace AppsRevokeAuthorizationForApplication { - export type RequestParams = { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsRevokeAuthorizationForApplicationData; - } +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum SortEnum7 { + Created = "created", + Updated = "updated", +} - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). - * @tags apps - * @name AppsRevokeGrantForApplication - * @summary Revoke a grant for an application - * @request DELETE:/applications/{client_id}/grants/{access_token} - * @deprecated - */ - export namespace AppsRevokeGrantForApplication { - export type RequestParams = { - accessToken: string; - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsRevokeGrantForApplicationData; - } +/** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ +export enum SortEnum8 { + DueOn = "due_on", + Completeness = "completeness", +} + +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). + * @default "created" + */ +export enum SortEnum9 { + Created = "created", + Updated = "updated", + Popularity = "popularity", + LongRunning = "long-running", +} + +/** + * Stargazer + * Stargazer + */ +export interface Stargazer { + /** @format date-time */ + starred_at: string; + user: SimpleUser | null; +} + +/** + * Starred Repository + * Starred Repository + */ +export interface StarredRepository { + /** A git repository */ + repo: Repository; + /** @format date-time */ + starred_at: string; +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum1 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum10 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum2 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum3 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum4 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum5 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ +export enum StateEnum6 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ +export enum StateEnum7 { + Open = "open", + Resolved = "resolved", +} + +/** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum8 { + Open = "open", + Closed = "closed", + All = "all", +} + +/** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ +export enum StateEnum9 { + Active = "active", + Pending = "pending", +} + +/** + * Status + * The status of a commit. + */ +export interface Status { + avatar_url: string | null; + context: string; + created_at: string; + /** Simple User */ + creator: SimpleUser; + description: string; + id: number; + node_id: string; + state: string; + target_url: string; + updated_at: string; + url: string; +} +/** + * Status Check Policy + * Status Check Policy + */ +export interface StatusCheckPolicy { + /** @example ["continuous-integration/travis-ci"] */ + contexts: string[]; /** - * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * @tags apps - * @name AppsScopeToken - * @summary Create a scoped access token - * @request POST:/applications/{client_id}/token/scoped + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts" */ - export namespace AppsScopeToken { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = AppsScopeTokenPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsScopeTokenData; - } - + contexts_url: string; + /** @example true */ + strict: boolean; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteGrant - * @summary Delete a grant - * @request DELETE:/applications/grants/{grant_id} - * @deprecated + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks" */ - export namespace OauthAuthorizationsDeleteGrant { - export type RequestParams = { - /** grant_id parameter */ - grantId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsDeleteGrantData; - } + url: string; +} + +/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ +export enum StatusEnum { + Completed = "completed", + Status = "status", + Conclusion = "conclusion", +} + +/** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ +export enum StatusEnum1 { + Completed = "completed", + Status = "status", + Conclusion = "conclusion", +} + +/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ +export enum StatusEnum2 { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", +} + +/** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ +export enum StatusEnum3 { + Queued = "queued", + InProgress = "in_progress", + Completed = "completed", +} + +/** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ +export enum SubjectTypeEnum { + Organization = "organization", + Repository = "repository", + Issue = "issue", + PullRequest = "pull_request", +} +/** + * Tag + * Tag + */ +export interface Tag { + commit: { + sha: string; + /** @format uri */ + url: string; + }; + /** @example "v0.1" */ + name: string; + node_id: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * @tags oauth-authorizations - * @name OauthAuthorizationsGetGrant - * @summary Get a single grant - * @request GET:/applications/grants/{grant_id} - * @deprecated + * @format uri + * @example "https://github.com/octocat/Hello-World/tarball/v0.1" */ - export namespace OauthAuthorizationsGetGrant { - export type RequestParams = { - /** grant_id parameter */ - grantId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsGetGrantData; - } - + tarball_url: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. - * @tags oauth-authorizations - * @name OauthAuthorizationsListGrants - * @summary List your grants - * @request GET:/applications/grants - * @deprecated + * @format uri + * @example "https://github.com/octocat/Hello-World/zipball/v0.1" */ - export namespace OauthAuthorizationsListGrants { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsListGrantsData; - } + zipball_url: string; } -export namespace Apps { +/** + * Team + * Groups of organization members that gives permissions on specified repositories. + */ +export interface Team { + description: string | null; /** - * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * @tags apps - * @name AppsGetBySlug - * @summary Get an app - * @request GET:/apps/{app_slug} + * @format uri + * @example "https://github.com/orgs/rails/teams/core" */ - export namespace AppsGetBySlug { - export type RequestParams = { - appSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetBySlugData; - } + html_url: string; + id: number; + members_url: string; + name: string; + node_id: string; + parent?: TeamSimple | null; + permission: string; + privacy?: string; + /** @format uri */ + repositories_url: string; + slug: string; + /** @format uri */ + url: string; } -export namespace Authorizations { +/** + * Team Discussion + * A team discussion is a persistent record of a free-form conversation within a team. + */ +export interface TeamDiscussion { + author: SimpleUser | null; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). - * @tags oauth-authorizations - * @name OauthAuthorizationsCreateAuthorization - * @summary Create a new authorization - * @request POST:/authorizations - * @deprecated + * The main text of the discussion. + * @example "Please suggest improvements to our workflow in comments." */ - export namespace OauthAuthorizationsCreateAuthorization { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = OauthAuthorizationsCreateAuthorizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsCreateAuthorizationData; - } - + body: string; + /** @example "

Hi! This is an area for us to collaborate as a team

" */ + body_html: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteAuthorization - * @summary Delete an authorization - * @request DELETE:/authorizations/{authorization_id} - * @deprecated + * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + * @example "0307116bbf7ced493b8d8a346c650b71" */ - export namespace OauthAuthorizationsDeleteAuthorization { - export type RequestParams = { - /** authorization_id parameter */ - authorizationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsDeleteAuthorizationData; - } - + body_version: string; + /** @example 0 */ + comments_count: number; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * @tags oauth-authorizations - * @name OauthAuthorizationsGetAuthorization - * @summary Get a single authorization - * @request GET:/authorizations/{authorization_id} - * @deprecated + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027/discussions/1/comments" */ - export namespace OauthAuthorizationsGetAuthorization { - export type RequestParams = { - /** authorization_id parameter */ - authorizationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsGetAuthorizationData; - } - + comments_url: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForApp - * @summary Get-or-create an authorization for a specific app - * @request PUT:/authorizations/clients/{client_id} - * @deprecated + * @format date-time + * @example "2018-01-25T18:56:31Z" */ - export namespace OauthAuthorizationsGetOrCreateAuthorizationForApp { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - }; - export type RequestQuery = {}; - export type RequestBody = - OauthAuthorizationsGetOrCreateAuthorizationForAppPayload; - export type RequestHeaders = {}; - export type ResponseBody = - OauthAuthorizationsGetOrCreateAuthorizationForAppData; - } - + created_at: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint - * @summary Get-or-create an authorization for a specific app and fingerprint - * @request PUT:/authorizations/clients/{client_id}/{fingerprint} - * @deprecated + * @format uri + * @example "https://github.com/orgs/github/teams/justice-league/discussions/1" */ - export namespace OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint { - export type RequestParams = { - /** The client ID of your GitHub app. */ - clientId: string; - fingerprint: string; - }; - export type RequestQuery = {}; - export type RequestBody = - OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload; - export type RequestHeaders = {}; - export type ResponseBody = - OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData; - } - + html_url: string; + /** @format date-time */ + last_edited_at: string | null; + /** @example "MDE0OlRlYW1EaXNjdXNzaW9uMQ==" */ + node_id: string; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * @tags oauth-authorizations - * @name OauthAuthorizationsListAuthorizations - * @summary List your authorizations - * @request GET:/authorizations - * @deprecated + * The unique sequence number of a team discussion. + * @example 42 */ - export namespace OauthAuthorizationsListAuthorizations { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsListAuthorizationsData; - } - + number: number; /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. - * @tags oauth-authorizations - * @name OauthAuthorizationsUpdateAuthorization - * @summary Update an existing authorization - * @request PATCH:/authorizations/{authorization_id} - * @deprecated + * Whether or not this discussion should be pinned for easy retrieval. + * @example true */ - export namespace OauthAuthorizationsUpdateAuthorization { - export type RequestParams = { - /** authorization_id parameter */ - authorizationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = OauthAuthorizationsUpdateAuthorizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsUpdateAuthorizationData; - } -} - -export namespace CodesOfConduct { + pinned: boolean; /** - * No description - * @tags codes-of-conduct - * @name CodesOfConductGetAllCodesOfConduct - * @summary Get all codes of conduct - * @request GET:/codes_of_conduct + * Whether or not this discussion should be restricted to team members and organization administrators. + * @example true */ - export namespace CodesOfConductGetAllCodesOfConduct { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetAllCodesOfConductData; - } - + private: boolean; + reactions?: ReactionRollup; /** - * No description - * @tags codes-of-conduct - * @name CodesOfConductGetConductCode - * @summary Get a code of conduct - * @request GET:/codes_of_conduct/{key} + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027" */ - export namespace CodesOfConductGetConductCode { - export type RequestParams = { - key: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetConductCodeData; - } -} - -export namespace ContentReferences { + team_url: string; /** - * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * @tags apps - * @name AppsCreateContentAttachment - * @summary Create a content attachment - * @request POST:/content_references/{content_reference_id}/attachments + * The title of the discussion. + * @example "How can we improve our workflow?" */ - export namespace AppsCreateContentAttachment { - export type RequestParams = { - contentReferenceId: number; - }; - export type RequestQuery = {}; - export type RequestBody = AppsCreateContentAttachmentPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsCreateContentAttachmentData; - } -} - -export namespace Emojis { + title: string; /** - * @description Lists all the emojis available to use on GitHub. - * @tags emojis - * @name EmojisGet - * @summary Get emojis - * @request GET:/emojis + * @format date-time + * @example "2018-01-25T18:56:31Z" */ - export namespace EmojisGet { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = EmojisGetData; - } + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027/discussions/1" + */ + url: string; } -export namespace Enterprises { +/** + * Team Discussion Comment + * A reply to a discussion within a team. + */ +export interface TeamDiscussionComment { + author: SimpleUser | null; /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. - * @tags audit-log - * @name AuditLogGetAuditLog - * @summary Get the audit log for an enterprise - * @request GET:/enterprises/{enterprise}/audit-log + * The main text of the comment. + * @example "I agree with this suggestion." */ - export namespace AuditLogGetAuditLog { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: AuditLogGetAuditLogParams1IncludeEnum; - /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ - order?: AuditLogGetAuditLogParams1OrderEnum; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AuditLogGetAuditLogData; - } - + body: string; + /** @example "

Do you like apples?

" */ + body_html: string; /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. - * @tags billing - * @name BillingGetGithubActionsBillingGhe - * @summary Get GitHub Actions billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/actions + * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + * @example "0307116bbf7ced493b8d8a346c650b71" */ - export namespace BillingGetGithubActionsBillingGhe { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubActionsBillingGheData; - } - + body_version: string; /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * @tags billing - * @name BillingGetGithubPackagesBillingGhe - * @summary Get GitHub Packages billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/packages + * @format date-time + * @example "2018-01-15T23:53:58Z" */ - export namespace BillingGetGithubPackagesBillingGhe { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubPackagesBillingGheData; - } - + created_at: string; /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * @tags billing - * @name BillingGetSharedStorageBillingGhe - * @summary Get shared storage billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage + * @format uri + * @example "https://api.github.com/organizations/1/team/2403582/discussions/1" */ - export namespace BillingGetSharedStorageBillingGhe { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetSharedStorageBillingGheData; - } - + discussion_url: string; /** - * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Add organization access to a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + * @format uri + * @example "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1" */ - export namespace EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData; - } - + html_url: string; + /** @format date-time */ + last_edited_at: string | null; + /** @example "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=" */ + node_id: string; /** - * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise - * @summary Add a self-hosted runner to a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + * The unique sequence number of a team discussion comment. + * @example 42 */ - export namespace EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData; - } - + number: number; + reactions?: ReactionRollup; /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` - * @tags enterprise-admin - * @name EnterpriseAdminCreateRegistrationTokenForEnterprise - * @summary Create a registration token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/registration-token + * @format date-time + * @example "2018-01-15T23:53:58Z" */ - export namespace EnterpriseAdminCreateRegistrationTokenForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminCreateRegistrationTokenForEnterpriseData; - } - + updated_at: string; /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * @tags enterprise-admin - * @name EnterpriseAdminCreateRemoveTokenForEnterprise - * @summary Create a remove token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/remove-token + * @format uri + * @example "https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1" */ - export namespace EnterpriseAdminCreateRemoveTokenForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminCreateRemoveTokenForEnterpriseData; - } + url: string; +} +/** + * Full Team + * Groups of organization members that gives permissions on specified repositories. + */ +export interface TeamFull { /** - * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise - * @summary Create a self-hosted runner group for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runner-groups + * @format date-time + * @example "2017-07-14T16:53:42Z" */ - export namespace EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData; - } - + created_at: string; + /** @example "A great team." */ + description: string | null; /** - * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise - * @summary Delete a self-hosted runner from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} + * @format uri + * @example "https://github.com/orgs/rails/teams/core" */ - export namespace EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData; - } - + html_url: string; /** - * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise - * @summary Delete a self-hosted runner group from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + * Unique identifier of the team + * @example 42 */ - export namespace EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData; - } - + id: number; /** - * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise - * @summary Disable a selected organization for GitHub Actions in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} + * Distinguished Name (DN) that team maps to within LDAP environment + * @example "uid=example,ou=users,dc=github,dc=com" */ - export namespace EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData; - } - + ldap_dn?: string; + /** @example 3 */ + members_count: number; + /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ + members_url: string; /** - * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise - * @summary Enable a selected organization for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} + * Name of the team + * @example "Developers" */ - export namespace EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData; - } - + name: string; + /** @example "MDQ6VGVhbTE=" */ + node_id: string; + /** Organization Full */ + organization: OrganizationFull; + parent?: TeamSimple | null; /** - * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminGetAllowedActionsEnterprise - * @summary Get allowed actions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions + * Permission that the team will have for its repositories + * @example "push" */ - export namespace EnterpriseAdminGetAllowedActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminGetAllowedActionsEnterpriseData; - } - + permission: string; /** - * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise - * @summary Get GitHub Actions permissions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions + * The level of privacy this team should have + * @example "closed" */ - export namespace EnterpriseAdminGetGithubActionsPermissionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetGithubActionsPermissionsEnterpriseData; - } - + privacy?: TeamFullPrivacyEnum; + /** @example 10 */ + repos_count: number; /** - * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise - * @summary Get a self-hosted runner for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} + * @format uri + * @example "https://api.github.com/organizations/1/team/1/repos" */ - export namespace EnterpriseAdminGetSelfHostedRunnerForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetSelfHostedRunnerForEnterpriseData; - } - + repositories_url: string; + /** @example "justice-league" */ + slug: string; /** - * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise - * @summary Get a self-hosted runner group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + * @format date-time + * @example "2017-08-17T12:37:15Z" */ - export namespace EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData; - } - + updated_at: string; /** - * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary List organization access to a self-hosted runner group in an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + * URL for the team + * @format uri + * @example "https://api.github.com/organizations/1/team/1" */ - export namespace EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData; - } + url: string; +} - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListRunnerApplicationsForEnterprise - * @summary List runner applications for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/downloads - */ - export namespace EnterpriseAdminListRunnerApplicationsForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListRunnerApplicationsForEnterpriseData; - } +/** + * The level of privacy this team should have + * @example "closed" + */ +export enum TeamFullPrivacyEnum { + Closed = "closed", + Secret = "secret", +} +/** + * Team Membership + * Team Membership + */ +export interface TeamMembership { /** - * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary List selected organizations enabled for GitHub Actions in an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/organizations + * The role of the user in the team. + * @default "member" + * @example "member" */ - export namespace EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData; - } + role: TeamMembershipRoleEnum; + state: string; + /** @format uri */ + url: string; +} + +/** + * The role of the user in the team. + * @default "member" + * @example "member" + */ +export enum TeamMembershipRoleEnum { + Member = "member", + Maintainer = "maintainer", +} + +/** + * Team Project + * A team's access to a project. + */ +export interface TeamProject { + body: string | null; + columns_url: string; + created_at: string; + /** Simple User */ + creator: SimpleUser; + html_url: string; + id: number; + name: string; + node_id: string; + number: number; + /** The organization permission for this project. Only present when owner is an organization. */ + organization_permission?: string; + owner_url: string; + permissions: { + admin: boolean; + read: boolean; + write: boolean; + }; + /** Whether the project is private or not. Only present when owner is an organization. */ + private?: boolean; + state: string; + updated_at: string; + url: string; +} +/** + * Team Repository + * A team's access to a repository. + */ +export interface TeamRepository { /** - * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise - * @summary List self-hosted runner groups for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups + * Whether to allow merge commits for pull requests. + * @default true + * @example true */ - export namespace EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData; - } - + allow_merge_commit?: boolean; /** - * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersForEnterprise - * @summary List self-hosted runners for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners + * Whether to allow rebase merges for pull requests. + * @default true + * @example true */ - export namespace EnterpriseAdminListSelfHostedRunnersForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListSelfHostedRunnersForEnterpriseData; - } - + allow_rebase_merge?: boolean; /** - * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise - * @summary List self-hosted runners in a group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + * Whether to allow squash merges for pull requests. + * @default true + * @example true */ - export namespace EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData; - } - + allow_squash_merge?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; /** - * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Remove organization access to a self-hosted runner group in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} + * Whether the repository is archived. + * @default false */ - export namespace EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of an organization. */ - orgId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData; - } - + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** - * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise - * @summary Remove a self-hosted runner from a group for an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - export namespace EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData; - } - + contributors_url: string; /** - * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminSetAllowedActionsEnterprise - * @summary Set allowed actions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - export namespace EnterpriseAdminSetAllowedActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = SelectedActions; - export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminSetAllowedActionsEnterpriseData; - } - + created_at: string | null; /** - * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise - * @summary Set GitHub Actions permissions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions + * The default branch of the repository. + * @example "master" */ - export namespace EnterpriseAdminSetGithubActionsPermissionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetGithubActionsPermissionsEnterpriseData; - } - + default_branch: string; /** - * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Set organization access for a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations + * Whether to delete head branches when pull requests are merged + * @default false + * @example false */ - export namespace EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData; - } - + delete_branch_on_merge?: boolean; /** - * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary Set selected organizations enabled for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - export namespace EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData; - } - + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; /** - * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise - * @summary Set self-hosted runners in a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - export namespace EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData; - } - + downloads_url: string; /** - * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * @tags enterprise-admin - * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise - * @summary Update a self-hosted runner group for an enterprise - * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - export namespace EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData; - } -} - -export namespace Events { + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** - * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. - * @tags activity - * @name ActivityListPublicEvents - * @summary List public events - * @request GET:/events + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - export namespace ActivityListPublicEvents { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicEventsData; - } -} - -export namespace Feeds { + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; /** - * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. - * @tags activity - * @name ActivityGetFeeds - * @summary Get feeds - * @request GET:/feeds + * Whether downloads are enabled. + * @default true + * @example true */ - export namespace ActivityGetFeeds { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityGetFeedsData; - } -} - -export namespace Gists { + has_downloads: boolean; /** - * No description - * @tags gists - * @name GistsCheckIsStarred - * @summary Check if a gist is starred - * @request GET:/gists/{gist_id}/star + * Whether issues are enabled. + * @default true + * @example true */ - export namespace GistsCheckIsStarred { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsCheckIsStarredData; - } - + has_issues: boolean; + has_pages: boolean; /** - * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. - * @tags gists - * @name GistsCreate - * @summary Create a gist - * @request POST:/gists + * Whether projects are enabled. + * @default true + * @example true */ - export namespace GistsCreate { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = GistsCreatePayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsCreateData; - } - + has_projects: boolean; /** - * No description - * @tags gists - * @name GistsCreateComment - * @summary Create a gist comment - * @request POST:/gists/{gist_id}/comments + * Whether the wiki is enabled. + * @default true + * @example true */ - export namespace GistsCreateComment { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = GistsCreateCommentPayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsCreateCommentData; - } - + has_wiki: boolean; /** - * No description - * @tags gists - * @name GistsDelete - * @summary Delete a gist - * @request DELETE:/gists/{gist_id} + * @format uri + * @example "https://github.com" */ - export namespace GistsDelete { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsDeleteData; - } - + homepage: string | null; /** - * No description - * @tags gists - * @name GistsDeleteComment - * @summary Delete a gist comment - * @request DELETE:/gists/{gist_id}/comments/{comment_id} + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - export namespace GistsDeleteComment { - export type RequestParams = { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsDeleteCommentData; - } - + hooks_url: string; /** - * @description **Note**: This was previously \`/gists/:gist_id/fork\`. - * @tags gists - * @name GistsFork - * @summary Fork a gist - * @request POST:/gists/{gist_id}/forks + * @format uri + * @example "https://github.com/octocat/Hello-World" */ - export namespace GistsFork { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsForkData; - } - + html_url: string; /** - * No description - * @tags gists - * @name GistsGet - * @summary Get a gist - * @request GET:/gists/{gist_id} + * Unique identifier of the repository + * @example 42 */ - export namespace GistsGet { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsGetData; - } - + id: number; /** - * No description - * @tags gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true */ - export namespace GistsGetComment { - export type RequestParams = { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsGetCommentData; - } - + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; /** - * No description - * @tags gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - export namespace GistsGetRevision { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - sha: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsGetRevisionData; - } - + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; /** - * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: - * @tags gists - * @name GistsList - * @summary List gists for the authenticated user - * @request GET:/gists + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - export namespace GistsList { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListData; - } - + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; /** - * No description - * @tags gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments + * @format uri + * @example "git:git.example.com/octocat/Hello-World" */ - export namespace GistsListComments { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListCommentsData; - } - + mirror_url: string | null; /** - * No description - * @tags gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits + * The name of the repository. + * @example "Team Environment" */ - export namespace GistsListCommits { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListCommitsData; - } - + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + maintain?: boolean; + pull: boolean; + push: boolean; + triage?: boolean; + }; /** - * No description - * @tags gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks + * Whether the repository is private or public. + * @default false */ - export namespace GistsListForks { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListForksData; - } - + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. - * @tags gists - * @name GistsListPublic - * @summary List public gists - * @request GET:/gists/public + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - export namespace GistsListPublic { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListPublicData; - } - + pushed_at: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; /** - * @description List the authenticated user's starred gists: - * @tags gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - export namespace GistsListStarred { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsListStarredData; - } - + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags gists - * @name GistsStar - * @summary Star a gist - * @request PUT:/gists/{gist_id}/star + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - export namespace GistsStar { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsStarData; - } - + subscribers_url: string; /** - * No description - * @tags gists - * @name GistsUnstar - * @summary Unstar a gist - * @request DELETE:/gists/{gist_id}/star + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - export namespace GistsUnstar { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsUnstarData; - } - + subscription_url: string; /** - * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. - * @tags gists - * @name GistsUpdate - * @summary Update a gist - * @request PATCH:/gists/{gist_id} + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" */ - export namespace GistsUpdate { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = GistsUpdatePayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsUpdateData; - } - + svn_url: string; /** - * No description - * @tags gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_id} + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - export namespace GistsUpdateComment { - export type RequestParams = { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = GistsUpdateCommentPayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsUpdateCommentData; - } -} - -export namespace Gitignore { + tags_url: string; /** - * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). - * @tags gitignore - * @name GitignoreGetAllTemplates - * @summary Get all gitignore templates - * @request GET:/gitignore/templates + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" */ - export namespace GitignoreGetAllTemplates { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GitignoreGetAllTemplatesData; - } - + teams_url: string; + temp_clone_token?: string; + template_repository?: Repository | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; /** - * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. - * @tags gitignore - * @name GitignoreGetTemplate - * @summary Get a gitignore template - * @request GET:/gitignore/templates/{name} + * @format date-time + * @example "2011-01-26T19:14:43Z" */ - export namespace GitignoreGetTemplate { - export type RequestParams = { - name: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GitignoreGetTemplateData; - } -} - -export namespace Installation { + updated_at: string | null; /** - * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * @tags apps - * @name AppsListReposAccessibleToInstallation - * @summary List repositories accessible to the app installation - * @request GET:/installation/repositories + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" */ - export namespace AppsListReposAccessibleToInstallation { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListReposAccessibleToInstallationData; - } - + url: string; /** - * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * @tags apps - * @name AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token + * The repository visibility: public, private, or internal. + * @default "public" */ - export namespace AppsRevokeInstallationAccessToken { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsRevokeInstallationAccessTokenData; - } + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; } -export namespace Issues { +/** + * Team Simple + * Groups of organization members that gives permissions on specified repositories. + */ +export type TeamSimple = { /** - * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags issues - * @name IssuesList - * @summary List issues assigned to the authenticated user - * @request GET:/issues + * Description of the team + * @example "A great team." */ - export namespace IssuesList { - export type RequestParams = {}; - export type RequestQuery = { - collab?: boolean; - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: IssuesListParams1DirectionEnum; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: IssuesListParams1FilterEnum; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - orgs?: boolean; - owned?: boolean; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - pulls?: boolean; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: IssuesListParams1SortEnum; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListParams1StateEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = IssuesListData; - } -} - -export namespace Licenses { + description: string | null; /** - * No description - * @tags licenses - * @name LicensesGet - * @summary Get a license - * @request GET:/licenses/{license} + * @format uri + * @example "https://github.com/orgs/rails/teams/core" */ - export namespace LicensesGet { - export type RequestParams = { - license: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = LicensesGetData; - } - + html_url: string; /** - * No description - * @tags licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses + * Unique identifier of the team + * @example 1 */ - export namespace LicensesGetAllCommonlyUsed { - export type RequestParams = {}; - export type RequestQuery = { - featured?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = LicensesGetAllCommonlyUsedData; - } -} - -export namespace Markdown { + id: number; /** - * No description - * @tags markdown - * @name MarkdownRender - * @summary Render a Markdown document - * @request POST:/markdown + * Distinguished Name (DN) that team maps to within LDAP environment + * @example "uid=example,ou=users,dc=github,dc=com" */ - export namespace MarkdownRender { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = MarkdownRenderPayload; - export type RequestHeaders = {}; - export type ResponseBody = MarkdownRenderData; - } - + ldap_dn?: string; + /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ + members_url: string; /** - * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. - * @tags markdown - * @name MarkdownRenderRaw - * @summary Render a Markdown document in raw mode - * @request POST:/markdown/raw + * Name of the team + * @example "Justice League" */ - export namespace MarkdownRenderRaw { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = MarkdownRenderRawPayload; - export type RequestHeaders = {}; - export type ResponseBody = MarkdownRenderRawData; - } -} - -export namespace MarketplaceListing { + name: string; + /** @example "MDQ6VGVhbTE=" */ + node_id: string; /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} + * Permission that the team will have for its repositories + * @example "admin" */ - export namespace AppsGetSubscriptionPlanForAccount { - export type RequestParams = { - /** account_id parameter */ - accountId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetSubscriptionPlanForAccountData; - } - + permission: string; /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} + * The level of privacy this team should have + * @example "closed" */ - export namespace AppsGetSubscriptionPlanForAccountStubbed { - export type RequestParams = { - /** account_id parameter */ - accountId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetSubscriptionPlanForAccountStubbedData; - } - + privacy?: string; /** - * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts + * @format uri + * @example "https://api.github.com/organizations/1/team/1/repos" */ - export namespace AppsListAccountsForPlan { - export type RequestParams = { - /** plan_id parameter */ - planId: number; - }; - export type RequestQuery = { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: AppsListAccountsForPlanParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: AppsListAccountsForPlanParams1SortEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListAccountsForPlanData; - } - + repositories_url: string; + /** @example "justice-league" */ + slug: string; /** - * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts + * URL for the team + * @format uri + * @example "https://api.github.com/organizations/1/team/1" */ - export namespace AppsListAccountsForPlanStubbed { - export type RequestParams = { - /** plan_id parameter */ - planId: number; - }; - export type RequestQuery = { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: AppsListAccountsForPlanStubbedParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: AppsListAccountsForPlanStubbedParams1SortEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListAccountsForPlanStubbedData; - } + url: string; +} | null; - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsListPlans - * @summary List plans - * @request GET:/marketplace_listing/plans - */ - export namespace AppsListPlans { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListPlansData; - } +export type TeamsAddMemberLegacyData = any; - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * @tags apps - * @name AppsListPlansStubbed - * @summary List plans (stubbed) - * @request GET:/marketplace_listing/stubbed/plans - */ - export namespace AppsListPlansStubbed { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsListPlansStubbedData; - } +export type TeamsAddMemberLegacyError = { + /** @example ""https://docs.github.com/rest"" */ + documentation_url?: string; + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; +}; + +export interface TeamsAddMemberLegacyParams { + teamId: number; + username: string; } -export namespace Meta { - /** - * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. - * @tags meta - * @name MetaGet - * @summary Get GitHub meta information - * @request GET:/meta - */ - export namespace MetaGet { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MetaGetData; - } +export type TeamsAddOrUpdateMembershipForUserInOrgData = TeamMembership; + +export type TeamsAddOrUpdateMembershipForUserInOrgError = { + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; +}; + +export interface TeamsAddOrUpdateMembershipForUserInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; } -export namespace Networks { +export interface TeamsAddOrUpdateMembershipForUserInOrgPayload { /** - * No description - * @tags activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" */ - export namespace ActivityListPublicEventsForRepoNetwork { - export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicEventsForRepoNetworkData; - } + role?: TeamsAddOrUpdateMembershipForUserInOrgRoleEnum; } -export namespace Notifications { - /** - * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. - * @tags activity - * @name ActivityDeleteThreadSubscription - * @summary Delete a thread subscription - * @request DELETE:/notifications/threads/{thread_id}/subscription - */ - export namespace ActivityDeleteThreadSubscription { - export type RequestParams = { - /** thread_id parameter */ - threadId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityDeleteThreadSubscriptionData; - } +/** + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" + */ +export enum TeamsAddOrUpdateMembershipForUserInOrgRoleEnum { + Member = "member", + Maintainer = "maintainer", +} - /** - * No description - * @tags activity - * @name ActivityGetThread - * @summary Get a thread - * @request GET:/notifications/threads/{thread_id} - */ - export namespace ActivityGetThread { - export type RequestParams = { - /** thread_id parameter */ - threadId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityGetThreadData; - } +export type TeamsAddOrUpdateMembershipForUserLegacyData = TeamMembership; + +export type TeamsAddOrUpdateMembershipForUserLegacyError = { + /** @example ""https://help.github.com/articles/github-and-trade-controls"" */ + documentation_url?: string; + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; +}; + +export interface TeamsAddOrUpdateMembershipForUserLegacyParams { + teamId: number; + username: string; +} +export interface TeamsAddOrUpdateMembershipForUserLegacyPayload { /** - * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. - * @tags activity - * @name ActivityGetThreadSubscriptionForAuthenticatedUser - * @summary Get a thread subscription for the authenticated user - * @request GET:/notifications/threads/{thread_id}/subscription + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" */ - export namespace ActivityGetThreadSubscriptionForAuthenticatedUser { - export type RequestParams = { - /** thread_id parameter */ - threadId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActivityGetThreadSubscriptionForAuthenticatedUserData; - } + role?: TeamsAddOrUpdateMembershipForUserLegacyRoleEnum; +} - /** - * @description List all notifications for the current user, sorted by most recently updated. - * @tags activity - * @name ActivityListNotificationsForAuthenticatedUser - * @summary List notifications for the authenticated user - * @request GET:/notifications - */ - export namespace ActivityListNotificationsForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActivityListNotificationsForAuthenticatedUserData; - } +/** + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" + */ +export enum TeamsAddOrUpdateMembershipForUserLegacyRoleEnum { + Member = "member", + Maintainer = "maintainer", +} - /** - * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. - * @tags activity - * @name ActivityMarkNotificationsAsRead - * @summary Mark notifications as read - * @request PUT:/notifications - */ - export namespace ActivityMarkNotificationsAsRead { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = ActivityMarkNotificationsAsReadPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkNotificationsAsReadData; - } +export type TeamsAddOrUpdateProjectPermissionsInOrgData = any; - /** - * No description - * @tags activity - * @name ActivityMarkThreadAsRead - * @summary Mark a thread as read - * @request PATCH:/notifications/threads/{thread_id} - */ - export namespace ActivityMarkThreadAsRead { - export type RequestParams = { - /** thread_id parameter */ - threadId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkThreadAsReadData; - } +export type TeamsAddOrUpdateProjectPermissionsInOrgError = { + documentation_url?: string; + message?: string; +}; - /** - * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. - * @tags activity - * @name ActivitySetThreadSubscription - * @summary Set a thread subscription - * @request PUT:/notifications/threads/{thread_id}/subscription - */ - export namespace ActivitySetThreadSubscription { - export type RequestParams = { - /** thread_id parameter */ - threadId: number; - }; - export type RequestQuery = {}; - export type RequestBody = ActivitySetThreadSubscriptionPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActivitySetThreadSubscriptionData; - } +export interface TeamsAddOrUpdateProjectPermissionsInOrgParams { + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; } -export namespace Octocat { +export interface TeamsAddOrUpdateProjectPermissionsInOrgPayload { /** - * @description Get the octocat as ASCII art - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ - export namespace MetaGetOctocat { - export type RequestParams = {}; - export type RequestQuery = { - /** The words to show in Octocat's speech bubble */ - s?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MetaGetOctocatData; - } + permission?: TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum; } -export namespace Organizations { - /** - * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. - * @tags orgs - * @name OrgsList - * @summary List organizations - * @request GET:/organizations - */ - export namespace OrgsList { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** An organization ID. Only return organizations with an ID greater than this ID. */ - since?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListData; - } +/** + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ +export enum TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", } -export namespace Orgs { - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Add repository access to a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - */ - export namespace ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { - export type RequestParams = { - org: string; - repositoryId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; - } +export type TeamsAddOrUpdateProjectPermissionsLegacyData = any; - /** - * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsAddSelectedRepoToOrgSecret - * @summary Add selected repository to an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - */ - export namespace ActionsAddSelectedRepoToOrgSecret { - export type RequestParams = { - org: string; - repositoryId: number; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsAddSelectedRepoToOrgSecretData; - } +export type TeamsAddOrUpdateProjectPermissionsLegacyError = { + documentation_url?: string; + message?: string; +}; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsAddSelfHostedRunnerToGroupForOrg - * @summary Add a self-hosted runner to a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - export namespace ActionsAddSelfHostedRunnerToGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsAddSelfHostedRunnerToGroupForOrgData; - } +export interface TeamsAddOrUpdateProjectPermissionsLegacyParams { + projectId: number; + teamId: number; +} +export interface TeamsAddOrUpdateProjectPermissionsLegacyPayload { /** - * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` - * @tags actions - * @name ActionsCreateOrUpdateOrgSecret - * @summary Create or update an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name} + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ - export namespace ActionsCreateOrUpdateOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = ActionsCreateOrUpdateOrgSecretPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateOrUpdateOrgSecretData; - } + permission?: TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum; +} - /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` - * @tags actions - * @name ActionsCreateRegistrationTokenForOrg - * @summary Create a registration token for an organization - * @request POST:/orgs/{org}/actions/runners/registration-token - */ - export namespace ActionsCreateRegistrationTokenForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateRegistrationTokenForOrgData; - } +/** + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ +export enum TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", +} - /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * @tags actions - * @name ActionsCreateRemoveTokenForOrg - * @summary Create a remove token for an organization - * @request POST:/orgs/{org}/actions/runners/remove-token - */ - export namespace ActionsCreateRemoveTokenForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateRemoveTokenForOrgData; - } +export type TeamsAddOrUpdateRepoPermissionsInOrgData = any; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsCreateSelfHostedRunnerGroupForOrg - * @summary Create a self-hosted runner group for an organization - * @request POST:/orgs/{org}/actions/runner-groups - */ - export namespace ActionsCreateSelfHostedRunnerGroupForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = ActionsCreateSelfHostedRunnerGroupForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateSelfHostedRunnerGroupForOrgData; - } +export interface TeamsAddOrUpdateRepoPermissionsInOrgParams { + org: string; + owner: string; + repo: string; + /** team_slug parameter */ + teamSlug: string; +} +export interface TeamsAddOrUpdateRepoPermissionsInOrgPayload { /** - * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsDeleteOrgSecret - * @summary Delete an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. + * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. */ - export namespace ActionsDeleteOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteOrgSecretData; - } + permission?: TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum; +} - /** - * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromOrg - * @summary Delete a self-hosted runner from an organization - * @request DELETE:/orgs/{org}/actions/runners/{runner_id} - */ - export namespace ActionsDeleteSelfHostedRunnerFromOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteSelfHostedRunnerFromOrgData; - } +/** + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. + * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. + */ +export enum TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", + Maintain = "maintain", + Triage = "triage", +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsDeleteSelfHostedRunnerGroupFromOrg - * @summary Delete a self-hosted runner group from an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - export namespace ActionsDeleteSelfHostedRunnerGroupFromOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteSelfHostedRunnerGroupFromOrgData; - } +export type TeamsAddOrUpdateRepoPermissionsLegacyData = any; - /** - * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsDisableSelectedRepositoryGithubActionsOrganization - * @summary Disable a selected repository for GitHub Actions in an organization - * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} - */ - export namespace ActionsDisableSelectedRepositoryGithubActionsOrganization { - export type RequestParams = { - org: string; - repositoryId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsDisableSelectedRepositoryGithubActionsOrganizationData; - } +export interface TeamsAddOrUpdateRepoPermissionsLegacyParams { + owner: string; + repo: string; + teamId: number; +} +export interface TeamsAddOrUpdateRepoPermissionsLegacyPayload { /** - * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsEnableSelectedRepositoryGithubActionsOrganization - * @summary Enable a selected repository for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. */ - export namespace ActionsEnableSelectedRepositoryGithubActionsOrganization { - export type RequestParams = { - org: string; - repositoryId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsEnableSelectedRepositoryGithubActionsOrganizationData; - } + permission?: TeamsAddOrUpdateRepoPermissionsLegacyPermissionEnum; +} - /** - * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsGetAllowedActionsOrganization - * @summary Get allowed actions for an organization - * @request GET:/orgs/{org}/actions/permissions/selected-actions - */ - export namespace ActionsGetAllowedActionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsGetAllowedActionsOrganizationData; - } +/** + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. + */ +export enum TeamsAddOrUpdateRepoPermissionsLegacyPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", +} - /** - * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsGetGithubActionsPermissionsOrganization - * @summary Get GitHub Actions permissions for an organization - * @request GET:/orgs/{org}/actions/permissions - */ - export namespace ActionsGetGithubActionsPermissionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsGetGithubActionsPermissionsOrganizationData; - } +export type TeamsCheckPermissionsForProjectInOrgData = TeamProject; - /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsGetOrgPublicKey - * @summary Get an organization public key - * @request GET:/orgs/{org}/actions/secrets/public-key - */ - export namespace ActionsGetOrgPublicKey { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsGetOrgPublicKeyData; - } +export interface TeamsCheckPermissionsForProjectInOrgParams { + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsGetOrgSecret - * @summary Get an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name} - */ - export namespace ActionsGetOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsGetOrgSecretData; - } +export type TeamsCheckPermissionsForProjectLegacyData = TeamProject; - /** - * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsGetSelfHostedRunnerForOrg - * @summary Get a self-hosted runner for an organization - * @request GET:/orgs/{org}/actions/runners/{runner_id} - */ - export namespace ActionsGetSelfHostedRunnerForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsGetSelfHostedRunnerForOrgData; - } +export interface TeamsCheckPermissionsForProjectLegacyParams { + projectId: number; + teamId: number; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsGetSelfHostedRunnerGroupForOrg - * @summary Get a self-hosted runner group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - export namespace ActionsGetSelfHostedRunnerGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsGetSelfHostedRunnerGroupForOrgData; - } +export type TeamsCheckPermissionsForRepoInOrgData = TeamRepository; - /** - * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsListOrgSecrets - * @summary List organization secrets - * @request GET:/orgs/{org}/actions/secrets - */ - export namespace ActionsListOrgSecrets { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListOrgSecretsData; - } +export interface TeamsCheckPermissionsForRepoInOrgParams { + org: string; + owner: string; + repo: string; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg - * @summary List repository access to a self-hosted runner group in an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - */ - export namespace ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData; - } +export type TeamsCheckPermissionsForRepoLegacyData = TeamRepository; - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsListRunnerApplicationsForOrg - * @summary List runner applications for an organization - * @request GET:/orgs/{org}/actions/runners/downloads - */ - export namespace ActionsListRunnerApplicationsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListRunnerApplicationsForOrgData; - } +export interface TeamsCheckPermissionsForRepoLegacyParams { + owner: string; + repo: string; + teamId: number; +} - /** - * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsListSelectedReposForOrgSecret - * @summary List selected repositories for an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories - */ - export namespace ActionsListSelectedReposForOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelectedReposForOrgSecretData; - } +export type TeamsCreateData = TeamFull; - /** - * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization - * @summary List selected repositories enabled for GitHub Actions in an organization - * @request GET:/orgs/{org}/actions/permissions/repositories - */ - export namespace ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; - } +export type TeamsCreateDiscussionCommentInOrgData = TeamDiscussionComment; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsListSelfHostedRunnerGroupsForOrg - * @summary List self-hosted runner groups for an organization - * @request GET:/orgs/{org}/actions/runner-groups - */ - export namespace ActionsListSelfHostedRunnerGroupsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnerGroupsForOrgData; - } +export interface TeamsCreateDiscussionCommentInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsListSelfHostedRunnersForOrg - * @summary List self-hosted runners for an organization - * @request GET:/orgs/{org}/actions/runners - */ - export namespace ActionsListSelfHostedRunnersForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnersForOrgData; - } +export interface TeamsCreateDiscussionCommentInOrgPayload { + /** The discussion comment's body text. */ + body: string; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsListSelfHostedRunnersInGroupForOrg - * @summary List self-hosted runners in a group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners - */ - export namespace ActionsListSelfHostedRunnersInGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnersInGroupForOrgData; - } +export type TeamsCreateDiscussionCommentLegacyData = TeamDiscussionComment; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Remove repository access to a self-hosted runner group in an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - */ - export namespace ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { - export type RequestParams = { - org: string; - repositoryId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; - } +export interface TeamsCreateDiscussionCommentLegacyParams { + discussionNumber: number; + teamId: number; +} - /** - * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsRemoveSelectedRepoFromOrgSecret - * @summary Remove selected repository from an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - */ - export namespace ActionsRemoveSelectedRepoFromOrgSecret { - export type RequestParams = { - org: string; - repositoryId: number; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsRemoveSelectedRepoFromOrgSecretData; - } +export interface TeamsCreateDiscussionCommentLegacyPayload { + /** The discussion comment's body text. */ + body: string; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg - * @summary Remove a self-hosted runner from a group for an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - export namespace ActionsRemoveSelfHostedRunnerFromGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsRemoveSelfHostedRunnerFromGroupForOrgData; - } +export type TeamsCreateDiscussionInOrgData = TeamDiscussion; - /** - * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsSetAllowedActionsOrganization - * @summary Set allowed actions for an organization - * @request PUT:/orgs/{org}/actions/permissions/selected-actions - */ - export namespace ActionsSetAllowedActionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = SelectedActions; - export type RequestHeaders = {}; - export type ResponseBody = ActionsSetAllowedActionsOrganizationData; - } +export interface TeamsCreateDiscussionInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} +export interface TeamsCreateDiscussionInOrgPayload { + /** The discussion post's body text. */ + body: string; /** - * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsSetGithubActionsPermissionsOrganization - * @summary Set GitHub Actions permissions for an organization - * @request PUT:/orgs/{org}/actions/permissions + * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * @default false */ - export namespace ActionsSetGithubActionsPermissionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = - ActionsSetGithubActionsPermissionsOrganizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsSetGithubActionsPermissionsOrganizationData; - } + private?: boolean; + /** The discussion post's title. */ + title: string; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Set repository access for a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - */ - export namespace ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = - ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData; - } +export type TeamsCreateDiscussionLegacyData = TeamDiscussion; - /** - * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * @tags actions - * @name ActionsSetSelectedReposForOrgSecret - * @summary Set selected repositories for an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories - */ - export namespace ActionsSetSelectedReposForOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; - }; - export type RequestQuery = {}; - export type RequestBody = ActionsSetSelectedReposForOrgSecretPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActionsSetSelectedReposForOrgSecretData; - } +export interface TeamsCreateDiscussionLegacyParams { + teamId: number; +} +export interface TeamsCreateDiscussionLegacyPayload { + /** The discussion post's body text. */ + body: string; /** - * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * @tags actions - * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization - * @summary Set selected repositories enabled for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories + * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * @default false */ - export namespace ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; - } + private?: boolean; + /** The discussion post's title. */ + title: string; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsSetSelfHostedRunnersInGroupForOrg - * @summary Set self-hosted runners in a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners - */ - export namespace ActionsSetSelfHostedRunnersInGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = ActionsSetSelfHostedRunnersInGroupForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActionsSetSelfHostedRunnersInGroupForOrgData; - } +export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgData = GroupMapping; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * @tags actions - * @name ActionsUpdateSelfHostedRunnerGroupForOrg - * @summary Update a self-hosted runner group for an organization - * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - export namespace ActionsUpdateSelfHostedRunnerGroupForOrg { - export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - }; - export type RequestQuery = {}; - export type RequestBody = ActionsUpdateSelfHostedRunnerGroupForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ActionsUpdateSelfHostedRunnerGroupForOrgData; - } +export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload { + /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups: { + /** Description of the IdP group. */ + group_description: string; + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + }[]; +} + +export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyData = GroupMapping; + +export interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams { + teamId: number; +} + +export interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload { + /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups: { + /** @example ""moar cheese pleese"" */ + description?: string; + /** Description of the IdP group. */ + group_description: string; + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + /** @example ""caceab43fc9ffa20081c"" */ + id?: string; + /** @example ""external-team-6c13e7288ef7"" */ + name?: string; + }[]; + /** @example ""I am not a timestamp"" */ + synced_at?: string; +} + +export interface TeamsCreateParams { + org: string; +} +export interface TeamsCreatePayload { + /** The description of the team. */ + description?: string; + /** List GitHub IDs for organization members who will become team maintainers. */ + maintainers?: string[]; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number; /** - * No description - * @tags activity - * @name ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" */ - export namespace ActivityListPublicOrgEvents { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicOrgEventsData; - } - + permission?: TeamsCreatePermissionEnum; /** - * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetOrgInstallation - * @summary Get an organization installation for the authenticated app - * @request GET:/orgs/{org}/installation + * The level of privacy this team should have. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * Default: \`secret\` + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + * Default for child team: \`closed\` */ - export namespace AppsGetOrgInstallation { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetOrgInstallationData; - } + privacy?: TeamsCreatePrivacyEnum; + /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ + repo_names?: string[]; +} + +/** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ +export enum TeamsCreatePermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", +} + +/** + * The level of privacy this team should have. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * Default: \`secret\` + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + * Default for child team: \`closed\` + */ +export enum TeamsCreatePrivacyEnum { + Secret = "secret", + Closed = "closed", +} + +export type TeamsDeleteDiscussionCommentInOrgData = any; + +export interface TeamsDeleteDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsDeleteDiscussionCommentLegacyData = any; + +export interface TeamsDeleteDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; +} + +export type TeamsDeleteDiscussionInOrgData = any; + +export interface TeamsDeleteDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsDeleteDiscussionLegacyData = any; + +export interface TeamsDeleteDiscussionLegacyParams { + discussionNumber: number; + teamId: number; +} + +export type TeamsDeleteInOrgData = any; + +export interface TeamsDeleteInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsDeleteLegacyData = any; + +export interface TeamsDeleteLegacyParams { + teamId: number; +} + +export type TeamsGetByNameData = TeamFull; + +export interface TeamsGetByNameParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsGetDiscussionCommentInOrgData = TeamDiscussionComment; + +export interface TeamsGetDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsGetDiscussionCommentLegacyData = TeamDiscussionComment; + +export interface TeamsGetDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; +} + +export type TeamsGetDiscussionInOrgData = TeamDiscussion; + +export interface TeamsGetDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsGetDiscussionLegacyData = TeamDiscussion; + +export interface TeamsGetDiscussionLegacyParams { + discussionNumber: number; + teamId: number; +} + +export type TeamsGetLegacyData = TeamFull; + +export interface TeamsGetLegacyParams { + teamId: number; +} + +export type TeamsGetMemberLegacyData = any; + +export interface TeamsGetMemberLegacyParams { + teamId: number; + username: string; +} + +export type TeamsGetMembershipForUserInOrgData = TeamMembership; + +export interface TeamsGetMembershipForUserInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; +} + +export type TeamsGetMembershipForUserLegacyData = TeamMembership; + +export interface TeamsGetMembershipForUserLegacyParams { + teamId: number; + username: string; +} +export type TeamsListChildInOrgData = Team[]; + +export interface TeamsListChildInOrgParams { + org: string; /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. - * @tags billing - * @name BillingGetGithubActionsBillingOrg - * @summary Get GitHub Actions billing for an organization - * @request GET:/orgs/{org}/settings/billing/actions + * Page number of the results to fetch. + * @default 1 */ - export namespace BillingGetGithubActionsBillingOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubActionsBillingOrgData; - } - + page?: number; /** - * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. - * @tags billing - * @name BillingGetGithubPackagesBillingOrg - * @summary Get GitHub Packages billing for an organization - * @request GET:/orgs/{org}/settings/billing/packages + * Results per page (max 100) + * @default 30 */ - export namespace BillingGetGithubPackagesBillingOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubPackagesBillingOrgData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsListChildLegacyData = Team[]; +export interface TeamsListChildLegacyParams { /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. - * @tags billing - * @name BillingGetSharedStorageBillingOrg - * @summary Get shared storage billing for an organization - * @request GET:/orgs/{org}/settings/billing/shared-storage + * Page number of the results to fetch. + * @default 1 */ - export namespace BillingGetSharedStorageBillingOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = BillingGetSharedStorageBillingOrgData; - } - + page?: number; /** - * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. - * @tags interactions - * @name InteractionsGetRestrictionsForOrg - * @summary Get interaction restrictions for an organization - * @request GET:/orgs/{org}/interaction-limits + * Results per page (max 100) + * @default 30 */ - export namespace InteractionsGetRestrictionsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = InteractionsGetRestrictionsForOrgData; - } + per_page?: number; + teamId: number; +} + +export type TeamsListData = Team[]; +export type TeamsListDiscussionCommentsInOrgData = TeamDiscussionComment[]; + +export interface TeamsListDiscussionCommentsInOrgParams { /** - * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. - * @tags interactions - * @name InteractionsRemoveRestrictionsForOrg - * @summary Remove interaction restrictions for an organization - * @request DELETE:/orgs/{org}/interaction-limits + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - export namespace InteractionsRemoveRestrictionsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = InteractionsRemoveRestrictionsForOrgData; - } - + direction?: DirectionEnum6; + discussionNumber: number; + org: string; /** - * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. - * @tags interactions - * @name InteractionsSetRestrictionsForOrg - * @summary Set interaction restrictions for an organization - * @request PUT:/orgs/{org}/interaction-limits + * Page number of the results to fetch. + * @default 1 */ - export namespace InteractionsSetRestrictionsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = InteractionLimit; - export type RequestHeaders = {}; - export type ResponseBody = InteractionsSetRestrictionsForOrgData; - } - + page?: number; /** - * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags issues - * @name IssuesListForOrg - * @summary List organization issues assigned to the authenticated user - * @request GET:/orgs/{org}/issues + * Results per page (max 100) + * @default 30 */ - export namespace IssuesListForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: IssuesListForOrgParams1DirectionEnum; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: IssuesListForOrgParams1FilterEnum; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: IssuesListForOrgParams1SortEnum; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListForOrgParams1StateEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = IssuesListForOrgData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} + +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionCommentsInOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} + +export type TeamsListDiscussionCommentsLegacyData = TeamDiscussionComment[]; +export interface TeamsListDiscussionCommentsLegacyParams { /** - * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. - * @tags migrations - * @name MigrationsDeleteArchiveForOrg - * @summary Delete an organization migration archive - * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - export namespace MigrationsDeleteArchiveForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsDeleteArchiveForOrgData; - } - + direction?: DirectionEnum14; + discussionNumber: number; /** - * @description Fetches the URL to a migration archive. - * @tags migrations - * @name MigrationsDownloadArchiveForOrg - * @summary Download an organization migration archive - * @request GET:/orgs/{org}/migrations/{migration_id}/archive + * Page number of the results to fetch. + * @default 1 */ - export namespace MigrationsDownloadArchiveForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = any; - } - + page?: number; /** - * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. - * @tags migrations - * @name MigrationsGetStatusForOrg - * @summary Get an organization migration status - * @request GET:/orgs/{org}/migrations/{migration_id} + * Results per page (max 100) + * @default 30 */ - export namespace MigrationsGetStatusForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetStatusForOrgData; - } + per_page?: number; + teamId: number; +} + +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionCommentsLegacyParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} +export type TeamsListDiscussionsInOrgData = TeamDiscussion[]; + +export interface TeamsListDiscussionsInOrgParams { /** - * @description Lists the most recent migrations. - * @tags migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - export namespace MigrationsListForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsListForOrgData; - } - + direction?: DirectionEnum5; + org: string; /** - * @description List all the repositories for this organization migration. - * @tags migrations - * @name MigrationsListReposForOrg - * @summary List repositories in an organization migration - * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + * Page number of the results to fetch. + * @default 1 */ - export namespace MigrationsListReposForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsListReposForOrgData; - } - + page?: number; /** - * @description Initiates the generation of a migration archive. - * @tags migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations + * Results per page (max 100) + * @default 30 */ - export namespace MigrationsStartForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = MigrationsStartForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsStartForOrgData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} + +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionsInOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} + +export type TeamsListDiscussionsLegacyData = TeamDiscussion[]; +export interface TeamsListDiscussionsLegacyParams { /** - * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. - * @tags migrations - * @name MigrationsUnlockRepoForOrg - * @summary Unlock an organization repository - * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - export namespace MigrationsUnlockRepoForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - /** repo_name parameter */ - repoName: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MigrationsUnlockRepoForOrgData; - } - + direction?: DirectionEnum13; /** - * No description - * @tags orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsBlockUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsBlockUserData; - } - + page?: number; /** - * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). - * @tags orgs - * @name OrgsCancelInvitation - * @summary Cancel an organization invitation - * @request DELETE:/orgs/{org}/invitations/{invitation_id} + * Results per page (max 100) + * @default 30 */ - export namespace OrgsCancelInvitation { - export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCancelInvitationData; - } + per_page?: number; + teamId: number; +} + +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionsLegacyParams1DirectionEnum { + Asc = "asc", + Desc = "desc", +} + +export type TeamsListForAuthenticatedUserData = TeamFull[]; +export interface TeamsListForAuthenticatedUserParams { /** - * No description - * @tags orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsCheckBlockedUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckBlockedUserData; - } - + page?: number; /** - * @description Check if a user is, publicly or privately, a member of the organization. - * @tags orgs - * @name OrgsCheckMembershipForUser - * @summary Check organization membership for a user - * @request GET:/orgs/{org}/members/{username} + * Results per page (max 100) + * @default 30 */ - export namespace OrgsCheckMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckMembershipForUserData; - } + per_page?: number; +} + +export type TeamsListIdpGroupsForLegacyData = GroupMapping; + +export interface TeamsListIdpGroupsForLegacyParams { + teamId: number; +} + +export type TeamsListIdpGroupsForOrgData = GroupMapping; +export interface TeamsListIdpGroupsForOrgParams { + org: string; /** - * No description - * @tags orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsCheckPublicMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckPublicMembershipForUserData; - } - + page?: number; /** - * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". - * @tags orgs - * @name OrgsConvertMemberToOutsideCollaborator - * @summary Convert an organization member to outside collaborator - * @request PUT:/orgs/{org}/outside_collaborators/{username} + * Results per page (max 100) + * @default 30 */ - export namespace OrgsConvertMemberToOutsideCollaborator { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsConvertMemberToOutsideCollaboratorData; - } + per_page?: number; +} + +export type TeamsListIdpGroupsInOrgData = GroupMapping; + +export interface TeamsListIdpGroupsInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} +export type TeamsListMembersInOrgData = SimpleUser[]; + +export interface TeamsListMembersInOrgParams { + org: string; /** - * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags orgs - * @name OrgsCreateInvitation - * @summary Create an organization invitation - * @request POST:/orgs/{org}/invitations + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsCreateInvitation { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsCreateInvitationPayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCreateInvitationData; - } - + page?: number; /** - * @description Here's how you can create a hook that posts payloads in JSON format: - * @tags orgs - * @name OrgsCreateWebhook - * @summary Create an organization webhook - * @request POST:/orgs/{org}/hooks + * Results per page (max 100) + * @default 30 */ - export namespace OrgsCreateWebhook { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsCreateWebhookPayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsCreateWebhookData; - } - + per_page?: number; /** - * No description - * @tags orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" */ - export namespace OrgsDeleteWebhook { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsDeleteWebhookData; - } + role?: RoleEnum1; + /** team_slug parameter */ + teamSlug: string; +} + +/** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ +export enum TeamsListMembersInOrgParams1RoleEnum { + Member = "member", + Maintainer = "maintainer", + All = "all", +} + +export type TeamsListMembersLegacyData = SimpleUser[]; +export interface TeamsListMembersLegacyParams { /** - * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." - * @tags orgs - * @name OrgsGet - * @summary Get an organization - * @request GET:/orgs/{org} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsGet { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsGetData; - } - + page?: number; /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. - * @tags orgs - * @name OrgsGetAuditLog - * @summary Get the audit log for an organization - * @request GET:/orgs/{org}/audit-log + * Results per page (max 100) + * @default 30 */ - export namespace OrgsGetAuditLog { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: OrgsGetAuditLogParams1IncludeEnum; - /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ - order?: OrgsGetAuditLogParams1OrderEnum; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsGetAuditLogData; - } - + per_page?: number; /** - * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. - * @tags orgs - * @name OrgsGetMembershipForUser - * @summary Get organization membership for a user - * @request GET:/orgs/{org}/memberships/{username} + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" */ - export namespace OrgsGetMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsGetMembershipForUserData; - } + role?: RoleEnum2; + teamId: number; +} + +/** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ +export enum TeamsListMembersLegacyParams1RoleEnum { + Member = "member", + Maintainer = "maintainer", + All = "all", +} +export interface TeamsListParams { + org: string; /** - * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." - * @tags orgs - * @name OrgsGetWebhook - * @summary Get an organization webhook - * @request GET:/orgs/{org}/hooks/{hook_id} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsGetWebhook { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsGetWebhookData; - } - + page?: number; /** - * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. - * @tags orgs - * @name OrgsGetWebhookConfigForOrg - * @summary Get a webhook configuration for an organization - * @request GET:/orgs/{org}/hooks/{hook_id}/config + * Results per page (max 100) + * @default 30 */ - export namespace OrgsGetWebhookConfigForOrg { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsGetWebhookConfigForOrgData; - } + per_page?: number; +} +export type TeamsListPendingInvitationsInOrgData = OrganizationInvitation[]; + +export interface TeamsListPendingInvitationsInOrgParams { + org: string; /** - * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. - * @tags orgs - * @name OrgsListAppInstallations - * @summary List app installations for an organization - * @request GET:/orgs/{org}/installations + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsListAppInstallations { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListAppInstallationsData; - } - + page?: number; /** - * @description List the users blocked by an organization. - * @tags orgs - * @name OrgsListBlockedUsers - * @summary List users blocked by an organization - * @request GET:/orgs/{org}/blocks + * Results per page (max 100) + * @default 30 */ - export namespace OrgsListBlockedUsers { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListBlockedUsersData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. - * @tags orgs - * @name OrgsListFailedInvitations - * @summary List failed organization invitations - * @request GET:/orgs/{org}/failed_invitations - */ - export namespace OrgsListFailedInvitations { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListFailedInvitationsData; - } +export type TeamsListPendingInvitationsLegacyData = OrganizationInvitation[]; +export interface TeamsListPendingInvitationsLegacyParams { /** - * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. - * @tags orgs - * @name OrgsListInvitationTeams - * @summary List organization invitation teams - * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsListInvitationTeams { - export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListInvitationTeamsData; - } - + page?: number; /** - * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. - * @tags orgs - * @name OrgsListMembers - * @summary List organization members - * @request GET:/orgs/{org}/members + * Results per page (max 100) + * @default 30 */ - export namespace OrgsListMembers { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Filter members returned in the list. Can be one of: - * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \\* \`all\` - All members the authenticated user can see. - * @default "all" - */ - filter?: OrgsListMembersParams1FilterEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Filter members returned by their role. Can be one of: - * \\* \`all\` - All members of the organization, regardless of role. - * \\* \`admin\` - Organization owners. - * \\* \`member\` - Non-owner organization members. - * @default "all" - */ - role?: OrgsListMembersParams1RoleEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListMembersData; - } + per_page?: number; + teamId: number; +} - /** - * @description List all users who are outside collaborators of an organization. - * @tags orgs - * @name OrgsListOutsideCollaborators - * @summary List outside collaborators for an organization - * @request GET:/orgs/{org}/outside_collaborators - */ - export namespace OrgsListOutsideCollaborators { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Filter the list of outside collaborators. Can be one of: - * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \\* \`all\`: All outside collaborators. - * @default "all" - */ - filter?: OrgsListOutsideCollaboratorsParams1FilterEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListOutsideCollaboratorsData; - } +export type TeamsListProjectsInOrgData = TeamProject[]; +export interface TeamsListProjectsInOrgParams { + org: string; /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. - * @tags orgs - * @name OrgsListPendingInvitations - * @summary List pending organization invitations - * @request GET:/orgs/{org}/invitations + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsListPendingInvitations { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListPendingInvitationsData; - } - + page?: number; /** - * @description Members of an organization can choose to have their membership publicized or not. - * @tags orgs - * @name OrgsListPublicMembers - * @summary List public organization members - * @request GET:/orgs/{org}/public_members + * Results per page (max 100) + * @default 30 */ - export namespace OrgsListPublicMembers { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListPublicMembersData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). - * @tags orgs - * @name OrgsListSamlSsoAuthorizations - * @summary List SAML SSO authorizations for an organization - * @request GET:/orgs/{org}/credential-authorizations - */ - export namespace OrgsListSamlSsoAuthorizations { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListSamlSsoAuthorizationsData; - } +export type TeamsListProjectsLegacyData = TeamProject[]; +export interface TeamsListProjectsLegacyParams { /** - * No description - * @tags orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsListWebhooks { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListWebhooksData; - } - + page?: number; /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. - * @tags orgs - * @name OrgsPingWebhook - * @summary Ping an organization webhook - * @request POST:/orgs/{org}/hooks/{hook_id}/pings + * Results per page (max 100) + * @default 30 */ - export namespace OrgsPingWebhook { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsPingWebhookData; - } + per_page?: number; + teamId: number; +} - /** - * @description 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. - * @tags orgs - * @name OrgsRemoveMember - * @summary Remove an organization member - * @request DELETE:/orgs/{org}/members/{username} - */ - export namespace OrgsRemoveMember { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveMemberData; - } +export type TeamsListReposInOrgData = MinimalRepository[]; +export interface TeamsListReposInOrgParams { + org: string; /** - * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. - * @tags orgs - * @name OrgsRemoveMembershipForUser - * @summary Remove organization membership for a user - * @request DELETE:/orgs/{org}/memberships/{username} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsRemoveMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveMembershipForUserData; - } - + page?: number; /** - * @description Removing a user from this list will remove them from all the organization's repositories. - * @tags orgs - * @name OrgsRemoveOutsideCollaborator - * @summary Remove outside collaborator from an organization - * @request DELETE:/orgs/{org}/outside_collaborators/{username} + * Results per page (max 100) + * @default 30 */ - export namespace OrgsRemoveOutsideCollaborator { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveOutsideCollaboratorData; - } + per_page?: number; + /** team_slug parameter */ + teamSlug: string; +} - /** - * No description - * @tags orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} - */ - export namespace OrgsRemovePublicMembershipForAuthenticatedUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - OrgsRemovePublicMembershipForAuthenticatedUserData; - } +export type TeamsListReposLegacyData = MinimalRepository[]; +export interface TeamsListReposLegacyParams { /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. - * @tags orgs - * @name OrgsRemoveSamlSsoAuthorization - * @summary Remove a SAML SSO authorization for an organization - * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} + * Page number of the results to fetch. + * @default 1 */ - export namespace OrgsRemoveSamlSsoAuthorization { - export type RequestParams = { - credentialId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveSamlSsoAuthorizationData; - } - + page?: number; /** - * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. - * @tags orgs - * @name OrgsSetMembershipForUser - * @summary Set organization membership for a user - * @request PUT:/orgs/{org}/memberships/{username} + * Results per page (max 100) + * @default 30 */ - export namespace OrgsSetMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsSetMembershipForUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsSetMembershipForUserData; - } + per_page?: number; + teamId: number; +} - /** - * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags orgs - * @name OrgsSetPublicMembershipForAuthenticatedUser - * @summary Set public organization membership for the authenticated user - * @request PUT:/orgs/{org}/public_members/{username} - */ - export namespace OrgsSetPublicMembershipForAuthenticatedUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsSetPublicMembershipForAuthenticatedUserData; - } +export type TeamsRemoveMemberLegacyData = any; - /** - * No description - * @tags orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} - */ - export namespace OrgsUnblockUser { - export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsUnblockUserData; - } +export interface TeamsRemoveMemberLegacyParams { + teamId: number; + username: string; +} - /** - * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. - * @tags orgs - * @name OrgsUpdate - * @summary Update an organization - * @request PATCH:/orgs/{org} - */ - export namespace OrgsUpdate { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsUpdatePayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateData; - } +export type TeamsRemoveMembershipForUserInOrgData = any; - /** - * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." - * @tags orgs - * @name OrgsUpdateWebhook - * @summary Update an organization webhook - * @request PATCH:/orgs/{org}/hooks/{hook_id} - */ - export namespace OrgsUpdateWebhook { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsUpdateWebhookPayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateWebhookData; - } +export interface TeamsRemoveMembershipForUserInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; +} - /** - * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. - * @tags orgs - * @name OrgsUpdateWebhookConfigForOrg - * @summary Update a webhook configuration for an organization - * @request PATCH:/orgs/{org}/hooks/{hook_id}/config - */ - export namespace OrgsUpdateWebhookConfigForOrg { - export type RequestParams = { - hookId: number; - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = OrgsUpdateWebhookConfigForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateWebhookConfigForOrgData; - } +export type TeamsRemoveMembershipForUserLegacyData = any; - /** - * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsCreateForOrg - * @summary Create an organization project - * @request POST:/orgs/{org}/projects - */ - export namespace ProjectsCreateForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForOrgData; - } +export interface TeamsRemoveMembershipForUserLegacyParams { + teamId: number; + username: string; +} - /** - * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsListForOrg - * @summary List organization projects - * @request GET:/orgs/{org}/projects - */ - export namespace ProjectsListForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: ProjectsListForOrgParams1StateEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ProjectsListForOrgData; - } +export type TeamsRemoveProjectInOrgData = any; - /** - * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentInOrg - * @summary Create reaction for a team discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions - */ - export namespace ReactionsCreateForTeamDiscussionCommentInOrg { - export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = - ReactionsCreateForTeamDiscussionCommentInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionCommentInOrgData; - } +export interface TeamsRemoveProjectInOrgParams { + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsRemoveProjectLegacyData = any; + +export interface TeamsRemoveProjectLegacyParams { + projectId: number; + teamId: number; +} + +export type TeamsRemoveRepoInOrgData = any; + +export interface TeamsRemoveRepoInOrgParams { + org: string; + owner: string; + repo: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsRemoveRepoLegacyData = any; + +export interface TeamsRemoveRepoLegacyParams { + owner: string; + repo: string; + teamId: number; +} + +export type TeamsUpdateDiscussionCommentInOrgData = TeamDiscussionComment; + +export interface TeamsUpdateDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export interface TeamsUpdateDiscussionCommentInOrgPayload { + /** The discussion comment's body text. */ + body: string; +} + +export type TeamsUpdateDiscussionCommentLegacyData = TeamDiscussionComment; + +export interface TeamsUpdateDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; +} + +export interface TeamsUpdateDiscussionCommentLegacyPayload { + /** The discussion comment's body text. */ + body: string; +} + +export type TeamsUpdateDiscussionInOrgData = TeamDiscussion; + +export interface TeamsUpdateDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} +export interface TeamsUpdateDiscussionInOrgPayload { + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; +} + +export type TeamsUpdateDiscussionLegacyData = TeamDiscussion; + +export interface TeamsUpdateDiscussionLegacyParams { + discussionNumber: number; + teamId: number; +} + +export interface TeamsUpdateDiscussionLegacyPayload { + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; +} + +export type TeamsUpdateInOrgData = TeamFull; + +export interface TeamsUpdateInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export interface TeamsUpdateInOrgPayload { + /** The description of the team. */ + description?: string; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number; /** - * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. - * @tags reactions - * @name ReactionsCreateForTeamDiscussionInOrg - * @summary Create reaction for a team discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" */ - export namespace ReactionsCreateForTeamDiscussionInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForTeamDiscussionInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionInOrgData; - } - + permission?: TeamsUpdateInOrgPermissionEnum; /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags reactions - * @name ReactionsDeleteForTeamDiscussion - * @summary Delete team discussion reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. */ - export namespace ReactionsDeleteForTeamDiscussion { - export type RequestParams = { - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForTeamDiscussionData; - } + privacy?: TeamsUpdateInOrgPrivacyEnum; +} + +/** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ +export enum TeamsUpdateInOrgPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", +} + +/** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + */ +export enum TeamsUpdateInOrgPrivacyEnum { + Secret = "secret", + Closed = "closed", +} +export type TeamsUpdateLegacyData = TeamFull; + +export interface TeamsUpdateLegacyParams { + teamId: number; +} + +export interface TeamsUpdateLegacyPayload { + /** The description of the team. */ + description?: string; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number | null; /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags reactions - * @name ReactionsDeleteForTeamDiscussionComment - * @summary Delete team discussion comment reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" */ - export namespace ReactionsDeleteForTeamDiscussionComment { - export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForTeamDiscussionCommentData; - } - + permission?: TeamsUpdateLegacyPermissionEnum; /** - * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentInOrg - * @summary List reactions for a team discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. */ - export namespace ReactionsListForTeamDiscussionCommentInOrg { - export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: ReactionsListForTeamDiscussionCommentInOrgParams1ContentEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionCommentInOrgData; - } + privacy?: TeamsUpdateLegacyPrivacyEnum; +} + +/** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ +export enum TeamsUpdateLegacyPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", +} + +/** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + */ +export enum TeamsUpdateLegacyPrivacyEnum { + Secret = "secret", + Closed = "closed", +} + +/** + * Thread + * Thread + */ +export interface Thread { + id: string; + last_read_at: string | null; + reason: string; + /** Minimal Repository */ + repository: MinimalRepository; + subject: { + latest_comment_url: string; + title: string; + type: string; + url: string; + }; + /** @example "https://api.github.com/notifications/threads/2/subscription" */ + subscription_url: string; + unread: boolean; + updated_at: string; + url: string; +} +/** + * Thread Subscription + * Thread Subscription + */ +export interface ThreadSubscription { /** - * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. - * @tags reactions - * @name ReactionsListForTeamDiscussionInOrg - * @summary List reactions for a team discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @format date-time + * @example "2012-10-06T21:34:12Z" */ - export namespace ReactionsListForTeamDiscussionInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ - content?: ReactionsListForTeamDiscussionInOrgParams1ContentEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionInOrgData; - } - + created_at: string | null; + ignored: boolean; + reason: string | null; /** - * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository - * @tags repos - * @name ReposCreateInOrg - * @summary Create an organization repository - * @request POST:/orgs/{org}/repos + * @format uri + * @example "https://api.github.com/repos/1" */ - export namespace ReposCreateInOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = ReposCreateInOrgData; - } - + repository_url?: string; + /** @example true */ + subscribed: boolean; /** - * @description Lists repositories for the specified organization. - * @tags repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @format uri + * @example "https://api.github.com/notifications/threads/1" */ - export namespace ReposListForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ - direction?: ReposListForOrgParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ - sort?: ReposListForOrgParams1SortEnum; - /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ - type?: ReposListForOrgParams1TypeEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReposListForOrgData; - } - + thread_url?: string; /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserInOrg - * @summary Add or update team membership for a user - * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @format uri + * @example "https://api.github.com/notifications/threads/1/subscription" */ - export namespace TeamsAddOrUpdateMembershipForUserInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateMembershipForUserInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateMembershipForUserInOrgData; - } + url: string; +} + +/** + * Topic + * A topic aggregates entities that are related to a subject. + */ +export interface Topic { + names: string[]; +} + +/** + * Topic Search Result Item + * Topic Search Result Item + */ +export interface TopicSearchResultItem { + aliases?: + | { + topic_relation?: { + id?: number; + name?: string; + relation_type?: string; + topic_id?: number; + }; + }[] + | null; + /** @format date-time */ + created_at: string; + created_by: string | null; + curated: boolean; + description: string | null; + display_name: string | null; + featured: boolean; + /** @format uri */ + logo_url?: string | null; + name: string; + related?: + | { + topic_relation?: { + id?: number; + name?: string; + relation_type?: string; + topic_id?: number; + }; + }[] + | null; + released: string | null; + repository_count?: number | null; + score: number; + short_description: string | null; + text_matches?: SearchResultTextMatches; + /** @format date-time */ + updated_at: string; +} + +/** Traffic */ +export interface Traffic { + count: number; + /** @format date-time */ + timestamp: string; + uniques: number; +} + +/** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ +export enum TypeEnum { + All = "all", + Public = "public", + Private = "private", + Forks = "forks", + Sources = "sources", + Member = "member", + Internal = "internal", +} + +/** + * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` + * + * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * @default "all" + */ +export enum TypeEnum1 { + All = "all", + Owner = "owner", + Public = "public", + Private = "private", + Member = "member", +} + +/** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ +export enum TypeEnum2 { + All = "all", + Owner = "owner", + Member = "member", +} +/** + * User Marketplace Purchase + * User Marketplace Purchase + */ +export interface UserMarketplacePurchase { + account: MarketplaceAccount; + /** @example "monthly" */ + billing_cycle: string; /** - * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsInOrg - * @summary Add or update team project permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @format date-time + * @example "2017-11-11T00:00:00Z" */ - export namespace TeamsAddOrUpdateProjectPermissionsInOrg { - export type RequestParams = { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateProjectPermissionsInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateProjectPermissionsInOrgData; - } - + free_trial_ends_on: string | null; /** - * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsInOrg - * @summary Add or update team repository permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @format date-time + * @example "2017-11-11T00:00:00Z" */ - export namespace TeamsAddOrUpdateRepoPermissionsInOrg { - export type RequestParams = { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateRepoPermissionsInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateRepoPermissionsInOrgData; - } - + next_billing_date: string | null; + /** @example true */ + on_free_trial: boolean; + /** Marketplace Listing Plan */ + plan: MarketplaceListingPlan; + unit_count: number | null; /** - * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. - * @tags teams - * @name TeamsCheckPermissionsForProjectInOrg - * @summary Check team permissions for a project - * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @format date-time + * @example "2017-11-02T01:12:12Z" */ - export namespace TeamsCheckPermissionsForProjectInOrg { - export type RequestParams = { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForProjectInOrgData; - } + updated_at: string | null; +} + +/** + * User Search Result Item + * User Search Result Item + */ +export interface UserSearchResultItem { + /** @format uri */ + avatar_url: string; + bio?: string | null; + blog?: string | null; + company?: string | null; + /** @format date-time */ + created_at?: string; + /** @format email */ + email?: string | null; + events_url: string; + followers?: number; + /** @format uri */ + followers_url: string; + following?: number; + following_url: string; + gists_url: string; + gravatar_id: string | null; + hireable?: boolean | null; + /** @format uri */ + html_url: string; + id: number; + location?: string | null; + login: string; + name?: string | null; + node_id: string; + /** @format uri */ + organizations_url: string; + public_gists?: number; + public_repos?: number; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + score: number; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + text_matches?: SearchResultTextMatches; + type: string; + /** @format date-time */ + updated_at?: string; + /** @format uri */ + url: string; +} + +export type UsersAddEmailForAuthenticatedData = Email[]; + +export type UsersAddEmailForAuthenticatedPayload = + | { + /** + * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. + * @example [] + */ + emails: string[]; + } + | string[] + | string; + +export type UsersBlockData = any; + +export interface UsersBlockParams { + username: string; +} + +export type UsersCheckBlockedData = any; + +export type UsersCheckBlockedError = BasicError; + +export interface UsersCheckBlockedParams { + username: string; +} + +export type UsersCheckFollowingForUserData = any; + +export interface UsersCheckFollowingForUserParams { + targetUser: string; + username: string; +} + +export type UsersCheckPersonIsFollowedByAuthenticatedData = any; + +export type UsersCheckPersonIsFollowedByAuthenticatedError = BasicError; + +export interface UsersCheckPersonIsFollowedByAuthenticatedParams { + username: string; +} + +export type UsersCreateGpgKeyForAuthenticatedData = GpgKey; + +export interface UsersCreateGpgKeyForAuthenticatedPayload { + /** A GPG key in ASCII-armored format. */ + armored_public_key: string; +} + +export type UsersCreatePublicSshKeyForAuthenticatedData = Key; +export interface UsersCreatePublicSshKeyForAuthenticatedPayload { /** - * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. - * @tags teams - * @name TeamsCheckPermissionsForRepoInOrg - * @summary Check team permissions for a repository - * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * The public SSH key to add to your GitHub account. + * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) */ - export namespace TeamsCheckPermissionsForRepoInOrg { - export type RequestParams = { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForRepoInOrgData; - } - + key: string; /** - * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". - * @tags teams - * @name TeamsCreate - * @summary Create a team - * @request POST:/orgs/{org}/teams + * A descriptive name for the new key. + * @example "Personal MacBook Air" */ - export namespace TeamsCreate { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsCreatePayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateData; - } + title?: string; +} + +export type UsersDeleteEmailForAuthenticatedData = any; + +/** Deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. */ +export type UsersDeleteEmailForAuthenticatedPayload = + | { + /** Email addresses associated with the GitHub user account. */ + emails: string[]; + } + | string[] + | string; + +export type UsersDeleteGpgKeyForAuthenticatedData = any; + +export interface UsersDeleteGpgKeyForAuthenticatedParams { + /** gpg_key_id parameter */ + gpgKeyId: number; +} + +export type UsersDeletePublicSshKeyForAuthenticatedData = any; + +export interface UsersDeletePublicSshKeyForAuthenticatedParams { + /** key_id parameter */ + keyId: number; +} + +export type UsersFollowData = any; + +export interface UsersFollowParams { + username: string; +} + +export type UsersGetAuthenticatedData = PrivateUser | PublicUser; + +export type UsersGetByUsernameData = PrivateUser | PublicUser; + +export interface UsersGetByUsernameParams { + username: string; +} + +export type UsersGetContextForUserData = Hovercard; + +export interface UsersGetContextForUserParams { + /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ + subject_id?: string; + /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ + subject_type?: SubjectTypeEnum; + username: string; +} + +/** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ +export enum UsersGetContextForUserParams1SubjectTypeEnum { + Organization = "organization", + Repository = "repository", + Issue = "issue", + PullRequest = "pull_request", +} + +export type UsersGetGpgKeyForAuthenticatedData = GpgKey; + +export interface UsersGetGpgKeyForAuthenticatedParams { + /** gpg_key_id parameter */ + gpgKeyId: number; +} + +export type UsersGetPublicSshKeyForAuthenticatedData = Key; + +export interface UsersGetPublicSshKeyForAuthenticatedParams { + /** key_id parameter */ + keyId: number; +} + +export type UsersListBlockedByAuthenticatedData = SimpleUser[]; + +export type UsersListData = SimpleUser[]; + +export type UsersListEmailsForAuthenticatedData = Email[]; +export interface UsersListEmailsForAuthenticatedParams { /** - * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. - * @tags teams - * @name TeamsCreateDiscussionCommentInOrg - * @summary Create a discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsCreateDiscussionCommentInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionCommentInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionCommentInOrgData; - } - + page?: number; /** - * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. - * @tags teams - * @name TeamsCreateDiscussionInOrg - * @summary Create a discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions + * Results per page (max 100) + * @default 30 */ - export namespace TeamsCreateDiscussionInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionInOrgData; - } + per_page?: number; +} + +export type UsersListFollowedByAuthenticatedData = SimpleUser[]; +export interface UsersListFollowedByAuthenticatedParams { /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg - * @summary Create or update IdP group connections - * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsCreateOrUpdateIdpGroupConnectionsInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = - TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload; - export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsInOrgData; - } + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} +export type UsersListFollowersForAuthenticatedUserData = SimpleUser[]; + +export interface UsersListFollowersForAuthenticatedUserParams { /** - * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. - * @tags teams - * @name TeamsDeleteDiscussionCommentInOrg - * @summary Delete a discussion comment - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsDeleteDiscussionCommentInOrg { - export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionCommentInOrgData; - } + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} + +export type UsersListFollowersForUserData = SimpleUser[]; +export interface UsersListFollowersForUserParams { /** - * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. - * @tags teams - * @name TeamsDeleteDiscussionInOrg - * @summary Delete a discussion - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsDeleteDiscussionInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionInOrgData; - } - + page?: number; /** - * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. - * @tags teams - * @name TeamsDeleteInOrg - * @summary Delete a team - * @request DELETE:/orgs/{org}/teams/{team_slug} + * Results per page (max 100) + * @default 30 */ - export namespace TeamsDeleteInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteInOrgData; - } + per_page?: number; + username: string; +} - /** - * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. - * @tags teams - * @name TeamsGetByName - * @summary Get a team by name - * @request GET:/orgs/{org}/teams/{team_slug} - */ - export namespace TeamsGetByName { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsGetByNameData; - } +export type UsersListFollowingForUserData = SimpleUser[]; +export interface UsersListFollowingForUserParams { /** - * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. - * @tags teams - * @name TeamsGetDiscussionCommentInOrg - * @summary Get a discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsGetDiscussionCommentInOrg { - export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionCommentInOrgData; - } - + page?: number; /** - * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. - * @tags teams - * @name TeamsGetDiscussionInOrg - * @summary Get a discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * Results per page (max 100) + * @default 30 */ - export namespace TeamsGetDiscussionInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionInOrgData; - } + per_page?: number; + username: string; +} + +export type UsersListGpgKeysForAuthenticatedData = GpgKey[]; +export interface UsersListGpgKeysForAuthenticatedParams { /** - * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). - * @tags teams - * @name TeamsGetMembershipForUserInOrg - * @summary Get team membership for a user - * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsGetMembershipForUserInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMembershipForUserInOrgData; - } - + page?: number; /** - * @description Lists all teams in an organization that are visible to the authenticated user. - * @tags teams - * @name TeamsList - * @summary List teams - * @request GET:/orgs/{org}/teams + * Results per page (max 100) + * @default 30 */ - export namespace TeamsList { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListData; - } + per_page?: number; +} +export type UsersListGpgKeysForUserData = GpgKey[]; + +export interface UsersListGpgKeysForUserParams { /** - * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. - * @tags teams - * @name TeamsListChildInOrg - * @summary List child teams - * @request GET:/orgs/{org}/teams/{team_slug}/teams + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsListChildInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListChildInOrgData; - } - + page?: number; /** - * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. - * @tags teams - * @name TeamsListDiscussionCommentsInOrg - * @summary List discussion comments - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * Results per page (max 100) + * @default 30 */ - export namespace TeamsListDiscussionCommentsInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: TeamsListDiscussionCommentsInOrgParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionCommentsInOrgData; - } + per_page?: number; + username: string; +} +export interface UsersListParams { /** - * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. - * @tags teams - * @name TeamsListDiscussionsInOrg - * @summary List discussions - * @request GET:/orgs/{org}/teams/{team_slug}/discussions + * Results per page (max 100) + * @default 30 */ - export namespace TeamsListDiscussionsInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: TeamsListDiscussionsInOrgParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionsInOrgData; - } + per_page?: number; + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; +} + +export type UsersListPublicEmailsForAuthenticatedData = Email[]; +export interface UsersListPublicEmailsForAuthenticatedParams { /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: - * @tags teams - * @name TeamsListIdpGroupsForOrg - * @summary List IdP groups for an organization - * @request GET:/orgs/{org}/team-sync/groups + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsListIdpGroupsForOrg { - export type RequestParams = { - org: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsForOrgData; - } - + page?: number; /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. - * @tags teams - * @name TeamsListIdpGroupsInOrg - * @summary List IdP groups for a team - * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * Results per page (max 100) + * @default 30 */ - export namespace TeamsListIdpGroupsInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsInOrgData; - } + per_page?: number; +} + +export type UsersListPublicKeysForUserData = KeySimple[]; +export interface UsersListPublicKeysForUserParams { /** - * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. - * @tags teams - * @name TeamsListMembersInOrg - * @summary List team members - * @request GET:/orgs/{org}/teams/{team_slug}/members + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsListMembersInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ - role?: TeamsListMembersInOrgParams1RoleEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListMembersInOrgData; - } - + page?: number; /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. - * @tags teams - * @name TeamsListPendingInvitationsInOrg - * @summary List pending team invitations - * @request GET:/orgs/{org}/teams/{team_slug}/invitations + * Results per page (max 100) + * @default 30 */ - export namespace TeamsListPendingInvitationsInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListPendingInvitationsInOrgData; - } + per_page?: number; + username: string; +} + +export type UsersListPublicSshKeysForAuthenticatedData = Key[]; +export interface UsersListPublicSshKeysForAuthenticatedParams { /** - * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. - * @tags teams - * @name TeamsListProjectsInOrg - * @summary List team projects - * @request GET:/orgs/{org}/teams/{team_slug}/projects + * Page number of the results to fetch. + * @default 1 */ - export namespace TeamsListProjectsInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListProjectsInOrgData; - } - + page?: number; /** - * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. - * @tags teams - * @name TeamsListReposInOrg - * @summary List team repositories - * @request GET:/orgs/{org}/teams/{team_slug}/repos + * Results per page (max 100) + * @default 30 */ - export namespace TeamsListReposInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListReposInOrgData; - } + per_page?: number; +} + +export type UsersSetPrimaryEmailVisibilityForAuthenticatedData = Email[]; +export interface UsersSetPrimaryEmailVisibilityForAuthenticatedPayload { /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. - * @tags teams - * @name TeamsRemoveMembershipForUserInOrg - * @summary Remove team membership for a user - * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} + * An email address associated with the GitHub user account to manage. + * @example "org@example.com" */ - export namespace TeamsRemoveMembershipForUserInOrg { - export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveMembershipForUserInOrgData; - } + email: string; + /** Denotes whether an email is publically visible. */ + visibility: UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum; +} +/** Denotes whether an email is publically visible. */ +export enum UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum { + Public = "public", + Private = "private", +} + +export type UsersUnblockData = any; + +export interface UsersUnblockParams { + username: string; +} + +export type UsersUnfollowData = any; + +export interface UsersUnfollowParams { + username: string; +} + +export type UsersUpdateAuthenticatedData = PrivateUser; + +export interface UsersUpdateAuthenticatedPayload { + /** The new short biography of the user. */ + bio?: string; /** - * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. - * @tags teams - * @name TeamsRemoveProjectInOrg - * @summary Remove a project from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * The new blog URL of the user. + * @example "blog.example.com" */ - export namespace TeamsRemoveProjectInOrg { - export type RequestParams = { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; + blog?: string; + /** + * The new company of the user. + * @example "Acme corporation" + */ + company?: string; + /** + * The publicly visible email address of the user. + * @example "omar@example.com" + */ + email?: string; + /** The new hiring availability of the user. */ + hireable?: boolean; + /** + * The new location of the user. + * @example "Berlin, Germany" + */ + location?: string; + /** + * The new name of the user. + * @example "Omar Jahandar" + */ + name?: string; + /** + * The new Twitter username of the user. + * @example "therealomarj" + */ + twitter_username?: string | null; +} + +/** + * Validation Error + * Validation Error + */ +export interface ValidationError { + documentation_url: string; + errors?: { + code: string; + field?: string; + index?: number; + message?: string; + resource?: string; + value?: string | null | number | null | string[] | null; + }[]; + message: string; +} + +/** + * Validation Error Simple + * Validation Error Simple + */ +export interface ValidationErrorSimple { + documentation_url: string; + errors?: string[]; + message: string; +} + +/** Validation Failed */ +export type ValidationFailed = ValidationError; + +/** Validation Failed */ +export type ValidationFailedSimple = ValidationErrorSimple; + +/** Verification */ +export interface Verification { + payload: string | null; + reason: string; + signature: string | null; + verified: boolean; +} + +/** + * View Traffic + * View Traffic + */ +export interface ViewTraffic { + /** @example 14850 */ + count: number; + /** @example 3782 */ + uniques: number; + views: Traffic[]; +} + +/** + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" + */ +export enum VisibilityEnum { + All = "all", + Public = "public", + Private = "private", +} + +/** + * Webhook Configuration + * Configuration object of the webhook + */ +export interface WebhookConfig { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; +} + +/** + * The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. + * @example ""json"" + */ +export type WebhookConfigContentType = string; + +/** + * Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** + * @example ""0"" + */ +export type WebhookConfigInsecureSsl = string; + +/** + * If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + * @example ""********"" + */ +export type WebhookConfigSecret = string; + +/** + * The URL to which the payloads will be delivered. + * @format uri + * @example "https://example.com/webhook" + */ +export type WebhookConfigUrl = string; + +/** + * Workflow + * A GitHub Actions workflow + */ +export interface Workflow { + /** @example "https://github.com/actions/setup-ruby/workflows/CI/badge.svg" */ + badge_url: string; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + created_at: string; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + deleted_at?: string; + /** @example "https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml" */ + html_url: string; + /** @example 5 */ + id: number; + /** @example "CI" */ + name: string; + /** @example "MDg6V29ya2Zsb3cxMg==" */ + node_id: string; + /** @example "ruby.yaml" */ + path: string; + /** @example "active" */ + state: WorkflowStateEnum; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + updated_at: string; + /** @example "https://api.github.com/repos/actions/setup-ruby/workflows/5" */ + url: string; +} + +/** + * Workflow Run + * An invocation of a workflow + */ +export interface WorkflowRun { + /** + * The URL to the artifacts for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" + */ + artifacts_url: string; + /** + * The URL to cancel the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/cancel" + */ + cancel_url: string; + /** + * The URL to the associated check suite. + * @example "https://api.github.com/repos/github/hello-world/check-suites/12" + */ + check_suite_url: string; + /** @example "neutral" */ + conclusion: string | null; + /** @format date-time */ + created_at: string; + /** @example "push" */ + event: string; + /** @example "master" */ + head_branch: string | null; + /** Simple Commit */ + head_commit: SimpleCommit; + /** Minimal Repository */ + head_repository: MinimalRepository; + /** @example 5 */ + head_repository_id?: number; + /** + * The SHA of the head commit that points to the version of the worflow being run. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + */ + head_sha: string; + /** @example "https://github.com/github/hello-world/suites/4" */ + html_url: string; + /** + * The ID of the workflow run. + * @example 5 + */ + id: number; + /** + * The URL to the jobs for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/jobs" + */ + jobs_url: string; + /** + * The URL to download the logs for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/logs" + */ + logs_url: string; + /** + * The name of the workflow run. + * @example "Build" + */ + name?: string; + /** @example "MDEwOkNoZWNrU3VpdGU1" */ + node_id: string; + pull_requests: PullRequestMinimal[] | null; + /** Minimal Repository */ + repository: MinimalRepository; + /** + * The URL to rerun the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun" + */ + rerun_url: string; + /** + * The auto incrementing run number for the workflow run. + * @example 106 + */ + run_number: number; + /** @example "completed" */ + status: string | null; + /** @format date-time */ + updated_at: string; + /** + * The URL to the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5" + */ + url: string; + /** + * The ID of the parent workflow. + * @example 5 + */ + workflow_id: number; + /** + * The URL to the workflow. + * @example "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" + */ + workflow_url: string; +} + +/** + * Workflow Run Usage + * Workflow Run Usage + */ +export interface WorkflowRunUsage { + billable: { + MACOS?: { + jobs: number; + total_ms: number; }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveProjectInOrgData; - } + UBUNTU?: { + jobs: number; + total_ms: number; + }; + WINDOWS?: { + jobs: number; + total_ms: number; + }; + }; + run_duration_ms: number; +} + +/** @example "active" */ +export enum WorkflowStateEnum { + Active = "active", + Deleted = "deleted", +} + +/** + * Workflow Usage + * Workflow Usage + */ +export interface WorkflowUsage { + billable: { + MACOS?: { + total_ms?: number; + }; + UBUNTU?: { + total_ms?: number; + }; + WINDOWS?: { + total_ms?: number; + }; + }; +} +export namespace App { /** - * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. - * @tags teams - * @name TeamsRemoveRepoInOrg - * @summary Remove a repository from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsCreateInstallationAccessToken + * @summary Create an installation access token for an app + * @request POST:/app/installations/{installation_id}/access_tokens */ - export namespace TeamsRemoveRepoInOrg { + export namespace AppsCreateInstallationAccessToken { export type RequestParams = { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsCreateInstallationAccessTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveRepoInOrgData; + export type ResponseBody = AppsCreateInstallationAccessTokenData; } /** - * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. - * @tags teams - * @name TeamsUpdateDiscussionCommentInOrg - * @summary Update a discussion comment - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsDeleteInstallation + * @summary Delete an installation for the authenticated app + * @request DELETE:/app/installations/{installation_id} */ - export namespace TeamsUpdateDiscussionCommentInOrg { + export namespace AppsDeleteInstallation { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionCommentInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionCommentInOrgData; + export type ResponseBody = AppsDeleteInstallationData; } /** - * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. - * @tags teams - * @name TeamsUpdateDiscussionInOrg - * @summary Update a discussion - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetAuthenticated + * @summary Get the authenticated app + * @request GET:/app */ - export namespace TeamsUpdateDiscussionInOrg { - export type RequestParams = { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; - }; + export namespace AppsGetAuthenticated { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionInOrgData; + export type ResponseBody = AppsGetAuthenticatedData; } /** - * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. - * @tags teams - * @name TeamsUpdateInOrg - * @summary Update a team - * @request PATCH:/orgs/{org}/teams/{team_slug} + * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetInstallation + * @summary Get an installation for the authenticated app + * @request GET:/app/installations/{installation_id} */ - export namespace TeamsUpdateInOrg { + export namespace AppsGetInstallation { export type RequestParams = { - org: string; - /** team_slug parameter */ - teamSlug: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateInOrgData; + export type ResponseBody = AppsGetInstallationData; } -} -export namespace Projects { /** - * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. - * @tags projects - * @name ProjectsAddCollaborator - * @summary Add project collaborator - * @request PUT:/projects/{project_id}/collaborators/{username} + * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetWebhookConfigForApp + * @summary Get a webhook configuration for an app + * @request GET:/app/hook/config */ - export namespace ProjectsAddCollaborator { - export type RequestParams = { - projectId: number; - username: string; - }; + export namespace AppsGetWebhookConfigForApp { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = ProjectsAddCollaboratorPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsAddCollaboratorData; + export type ResponseBody = AppsGetWebhookConfigForAppData; } /** - * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags projects - * @name ProjectsCreateCard - * @summary Create a project card - * @request POST:/projects/columns/{column_id}/cards + * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. + * @tags apps + * @name AppsListInstallations + * @summary List installations for the authenticated app + * @request GET:/app/installations */ - export namespace ProjectsCreateCard { - export type RequestParams = { - /** column_id parameter */ - columnId: number; + export namespace AppsListInstallations { + export type RequestParams = {}; + export type RequestQuery = { + outdated?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; - export type RequestQuery = {}; - export type RequestBody = ProjectsCreateCardPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateCardData; + export type ResponseBody = AppsListInstallationsData; } /** - * No description - * @tags projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsSuspendInstallation + * @summary Suspend an app installation + * @request PUT:/app/installations/{installation_id}/suspended */ - export namespace ProjectsCreateColumn { + export namespace AppsSuspendInstallation { export type RequestParams = { - projectId: number; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateColumnPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateColumnData; + export type ResponseBody = AppsSuspendInstallationData; } /** - * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. - * @tags projects - * @name ProjectsDelete - * @summary Delete a project - * @request DELETE:/projects/{project_id} + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsUnsuspendInstallation + * @summary Unsuspend an app installation + * @request DELETE:/app/installations/{installation_id}/suspended */ - export namespace ProjectsDelete { + export namespace AppsUnsuspendInstallation { export type RequestParams = { - projectId: number; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsDeleteData; + export type ResponseBody = AppsUnsuspendInstallationData; } /** - * No description - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} - */ - export namespace ProjectsDeleteCard { - export type RequestParams = { - /** card_id parameter */ - cardId: number; - }; + * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config + */ + export namespace AppsUpdateWebhookConfigForApp { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsUpdateWebhookConfigForAppPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsDeleteCardData; + export type ResponseBody = AppsUpdateWebhookConfigForAppData; } +} +export namespace AppManifests { /** - * No description - * @tags projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. + * @tags apps + * @name AppsCreateFromManifest + * @summary Create a GitHub App from a manifest + * @request POST:/app-manifests/{code}/conversions */ - export namespace ProjectsDeleteColumn { + export namespace AppsCreateFromManifest { export type RequestParams = { - /** column_id parameter */ - columnId: number; + code: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsDeleteColumnData; + export type ResponseBody = AppsCreateFromManifestData; } +} +export namespace Applications { /** - * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsGet - * @summary Get a project - * @request GET:/projects/{project_id} + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. + * @tags apps + * @name AppsCheckAuthorization + * @summary Check an authorization + * @request GET:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - export namespace ProjectsGet { + export namespace AppsCheckAuthorization { export type RequestParams = { - projectId: number; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetData; + export type ResponseBody = AppsCheckAuthorizationData; } /** - * No description - * @tags projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} + * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. + * @tags apps + * @name AppsCheckToken + * @summary Check a token + * @request POST:/applications/{client_id}/token */ - export namespace ProjectsGetCard { + export namespace AppsCheckToken { export type RequestParams = { - /** card_id parameter */ - cardId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsCheckTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetCardData; + export type ResponseBody = AppsCheckTokenData; } /** - * No description - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} + * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + * @tags apps + * @name AppsDeleteAuthorization + * @summary Delete an app authorization + * @request DELETE:/applications/{client_id}/grant */ - export namespace ProjectsGetColumn { + export namespace AppsDeleteAuthorization { export type RequestParams = { - /** column_id parameter */ - columnId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsDeleteAuthorizationPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetColumnData; + export type ResponseBody = AppsDeleteAuthorizationData; } /** - * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. - * @tags projects - * @name ProjectsGetPermissionForUser - * @summary Get project permission for a user - * @request GET:/projects/{project_id}/collaborators/{username}/permission + * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. + * @tags apps + * @name AppsDeleteToken + * @summary Delete an app token + * @request DELETE:/applications/{client_id}/token */ - export namespace ProjectsGetPermissionForUser { + export namespace AppsDeleteToken { export type RequestParams = { - projectId: number; - username: string; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsDeleteTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetPermissionForUserData; + export type ResponseBody = AppsDeleteTokenData; } /** - * No description - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. + * @tags apps + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - export namespace ProjectsListCards { + export namespace AppsResetAuthorization { export type RequestParams = { - /** column_id parameter */ - columnId: number; - }; - export type RequestQuery = { - /** - * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. - * @default "not_archived" - */ - archived_state?: ProjectsListCardsParams1ArchivedStateEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListCardsData; + export type ResponseBody = AppsResetAuthorizationData; } /** - * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. - * @tags projects - * @name ProjectsListCollaborators - * @summary List project collaborators - * @request GET:/projects/{project_id}/collaborators + * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. + * @tags apps + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - export namespace ProjectsListCollaborators { + export namespace AppsResetToken { export type RequestParams = { - projectId: number; - }; - export type RequestQuery = { - /** - * Filters the collaborators by their affiliation. Can be one of: - * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. - * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: ProjectsListCollaboratorsParams1AffiliationEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The client ID of your GitHub app. */ + clientId: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = AppsResetTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListCollaboratorsData; + export type ResponseBody = AppsResetTokenData; } /** - * No description - * @tags projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. + * @tags apps + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - export namespace ProjectsListColumns { + export namespace AppsRevokeAuthorizationForApplication { export type RequestParams = { - projectId: number; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListColumnsData; + export type ResponseBody = AppsRevokeAuthorizationForApplicationData; } /** - * No description - * @tags projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). + * @tags apps + * @name AppsRevokeGrantForApplication + * @summary Revoke a grant for an application + * @request DELETE:/applications/{client_id}/grants/{access_token} + * @deprecated */ - export namespace ProjectsMoveCard { + export namespace AppsRevokeGrantForApplication { export type RequestParams = { - /** card_id parameter */ - cardId: number; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsMoveCardPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsMoveCardData; + export type ResponseBody = AppsRevokeGrantForApplicationData; } /** - * No description - * @tags projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. + * @tags apps + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - export namespace ProjectsMoveColumn { + export namespace AppsScopeToken { export type RequestParams = { - /** column_id parameter */ - columnId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsMoveColumnPayload; + export type RequestBody = AppsScopeTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsMoveColumnData; + export type ResponseBody = AppsScopeTokenData; } /** - * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. - * @tags projects - * @name ProjectsRemoveCollaborator - * @summary Remove user as a collaborator - * @request DELETE:/projects/{project_id}/collaborators/{username} + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteGrant + * @summary Delete a grant + * @request DELETE:/applications/grants/{grant_id} + * @deprecated */ - export namespace ProjectsRemoveCollaborator { + export namespace OauthAuthorizationsDeleteGrant { export type RequestParams = { - projectId: number; - username: string; + /** grant_id parameter */ + grantId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsRemoveCollaboratorData; + export type ResponseBody = OauthAuthorizationsDeleteGrantData; } /** - * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsUpdate - * @summary Update a project - * @request PATCH:/projects/{project_id} + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * @tags oauth-authorizations + * @name OauthAuthorizationsGetGrant + * @summary Get a single grant + * @request GET:/applications/grants/{grant_id} + * @deprecated */ - export namespace ProjectsUpdate { + export namespace OauthAuthorizationsGetGrant { export type RequestParams = { - projectId: number; + /** grant_id parameter */ + grantId: number; }; export type RequestQuery = {}; - export type RequestBody = ProjectsUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateData; + export type ResponseBody = OauthAuthorizationsGetGrantData; } /** - * No description - * @tags projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. + * @tags oauth-authorizations + * @name OauthAuthorizationsListGrants + * @summary List your grants + * @request GET:/applications/grants + * @deprecated */ - export namespace ProjectsUpdateCard { - export type RequestParams = { - /** card_id parameter */ - cardId: number; + export namespace OauthAuthorizationsListGrants { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; - export type RequestBody = ProjectsUpdateCardPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateCardData; + export type ResponseBody = OauthAuthorizationsListGrantsData; } +} +export namespace Apps { /** - * No description - * @tags projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_id} + * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * @tags apps + * @name AppsGetBySlug + * @summary Get an app + * @request GET:/apps/{app_slug} */ - export namespace ProjectsUpdateColumn { + export namespace AppsGetBySlug { export type RequestParams = { - /** column_id parameter */ - columnId: number; + appSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsUpdateColumnPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateColumnData; + export type ResponseBody = AppsGetBySlugData; } } -export namespace RateLimit { +export namespace Authorizations { /** - * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. - * @tags rate-limit - * @name RateLimitGet - * @summary Get rate limit status for the authenticated user - * @request GET:/rate_limit + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). + * @tags oauth-authorizations + * @name OauthAuthorizationsCreateAuthorization + * @summary Create a new authorization + * @request POST:/authorizations + * @deprecated */ - export namespace RateLimitGet { + export namespace OauthAuthorizationsCreateAuthorization { export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OauthAuthorizationsCreateAuthorizationPayload; export type RequestHeaders = {}; - export type ResponseBody = RateLimitGetData; + export type ResponseBody = OauthAuthorizationsCreateAuthorizationData; } -} -export namespace Reactions { /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). - * @tags reactions - * @name ReactionsDeleteLegacy - * @summary Delete a reaction (Legacy) - * @request DELETE:/reactions/{reaction_id} + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteAuthorization + * @summary Delete an authorization + * @request DELETE:/authorizations/{authorization_id} * @deprecated */ - export namespace ReactionsDeleteLegacy { + export namespace OauthAuthorizationsDeleteAuthorization { export type RequestParams = { - reactionId: number; + /** authorization_id parameter */ + authorizationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteLegacyData; + export type ResponseBody = OauthAuthorizationsDeleteAuthorizationData; } -} -export namespace Repos { /** - * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsCancelWorkflowRun - * @summary Cancel a workflow run - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * @tags oauth-authorizations + * @name OauthAuthorizationsGetAuthorization + * @summary Get a single authorization + * @request GET:/authorizations/{authorization_id} + * @deprecated */ - export namespace ActionsCancelWorkflowRun { + export namespace OauthAuthorizationsGetAuthorization { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** authorization_id parameter */ + authorizationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsCancelWorkflowRunData; + export type ResponseBody = OauthAuthorizationsGetAuthorizationData; } /** - * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` - * @tags actions - * @name ActionsCreateOrUpdateRepoSecret - * @summary Create or update a repository secret - * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForApp + * @summary Get-or-create an authorization for a specific app + * @request PUT:/authorizations/clients/{client_id} + * @deprecated */ - export namespace ActionsCreateOrUpdateRepoSecret { + export namespace OauthAuthorizationsGetOrCreateAuthorizationForApp { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsCreateOrUpdateRepoSecretPayload; + export type RequestBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateOrUpdateRepoSecretData; + export type ResponseBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppData; } /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` - * @tags actions - * @name ActionsCreateRegistrationTokenForRepo - * @summary Create a registration token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint + * @summary Get-or-create an authorization for a specific app and fingerprint + * @request PUT:/authorizations/clients/{client_id}/{fingerprint} + * @deprecated */ - export namespace ActionsCreateRegistrationTokenForRepo { + export namespace OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint { export type RequestParams = { - owner: string; - repo: string; + /** The client ID of your GitHub app. */ + clientId: string; + fingerprint: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateRegistrationTokenForRepoData; + export type ResponseBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData; } /** - * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * @tags actions - * @name ActionsCreateRemoveTokenForRepo - * @summary Create a remove token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * @tags oauth-authorizations + * @name OauthAuthorizationsListAuthorizations + * @summary List your authorizations + * @request GET:/authorizations + * @deprecated */ - export namespace ActionsCreateRemoveTokenForRepo { - export type RequestParams = { - owner: string; - repo: string; + export namespace OauthAuthorizationsListAuthorizations { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateRemoveTokenForRepoData; + export type ResponseBody = OauthAuthorizationsListAuthorizationsData; } /** - * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." - * @tags actions - * @name ActionsCreateWorkflowDispatch - * @summary Create a workflow dispatch event - * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches - */ - export namespace ActionsCreateWorkflowDispatch { - export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. + * @tags oauth-authorizations + * @name OauthAuthorizationsUpdateAuthorization + * @summary Update an existing authorization + * @request PATCH:/authorizations/{authorization_id} + * @deprecated + */ + export namespace OauthAuthorizationsUpdateAuthorization { + export type RequestParams = { + /** authorization_id parameter */ + authorizationId: number; }; export type RequestQuery = {}; - export type RequestBody = ActionsCreateWorkflowDispatchPayload; + export type RequestBody = OauthAuthorizationsUpdateAuthorizationPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateWorkflowDispatchData; + export type ResponseBody = OauthAuthorizationsUpdateAuthorizationData; } +} +export namespace CodesOfConduct { /** - * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsDeleteArtifact - * @summary Delete an artifact - * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * No description + * @tags codes-of-conduct + * @name CodesOfConductGetAllCodesOfConduct + * @summary Get all codes of conduct + * @request GET:/codes_of_conduct */ - export namespace ActionsDeleteArtifact { - export type RequestParams = { - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; - }; + export namespace CodesOfConductGetAllCodesOfConduct { + export type RequestParams = {}; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteArtifactData; + export type ResponseBody = CodesOfConductGetAllCodesOfConductData; } /** - * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. - * @tags actions - * @name ActionsDeleteRepoSecret - * @summary Delete a repository secret - * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * No description + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - export namespace ActionsDeleteRepoSecret { + export namespace CodesOfConductGetConductCode { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + key: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteRepoSecretData; + export type ResponseBody = CodesOfConductGetConductCodeData; } +} +export namespace ContentReferences { /** - * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromRepo - * @summary Delete a self-hosted runner from a repository - * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * @tags apps + * @name AppsCreateContentAttachment + * @summary Create a content attachment + * @request POST:/content_references/{content_reference_id}/attachments */ - export namespace ActionsDeleteSelfHostedRunnerFromRepo { + export namespace AppsCreateContentAttachment { export type RequestParams = { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; + contentReferenceId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsCreateContentAttachmentPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteSelfHostedRunnerFromRepoData; + export type ResponseBody = AppsCreateContentAttachmentData; } +} +export namespace Emojis { /** - * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsDeleteWorkflowRun - * @summary Delete a workflow run - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + * @description Lists all the emojis available to use on GitHub. + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - export namespace ActionsDeleteWorkflowRun { - export type RequestParams = { - owner: string; - repo: string; - runId: number; - }; + export namespace EmojisGet { + export type RequestParams = {}; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteWorkflowRunData; + export type ResponseBody = EmojisGetData; } +} +export namespace Enterprises { /** - * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsDeleteWorkflowRunLogs - * @summary Delete workflow run logs - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. + * @tags audit-log + * @name AuditLogGetAuditLog + * @summary Get the audit log for an enterprise + * @request GET:/enterprises/{enterprise}/audit-log */ - export namespace ActionsDeleteWorkflowRunLogs { + export namespace AuditLogGetAuditLog { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + }; + export type RequestQuery = { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; + /** + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. + */ + include?: AuditLogGetAuditLogParams1IncludeEnum; + /** + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. + */ + order?: AuditLogGetAuditLogParams1OrderEnum; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteWorkflowRunLogsData; + export type ResponseBody = AuditLogGetAuditLogData; } /** - * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsDisableWorkflow - * @summary Disable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. + * @tags billing + * @name BillingGetGithubActionsBillingGhe + * @summary Get GitHub Actions billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/actions */ - export namespace ActionsDisableWorkflow { + export namespace BillingGetGithubActionsBillingGhe { export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDisableWorkflowData; + export type ResponseBody = BillingGetGithubActionsBillingGheData; } /** - * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsDownloadArtifact - * @summary Download an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. + * @tags billing + * @name BillingGetGithubPackagesBillingGhe + * @summary Get GitHub Packages billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/packages */ - export namespace ActionsDownloadArtifact { + export namespace BillingGetGithubPackagesBillingGhe { export type RequestParams = { - archiveFormat: string; - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = BillingGetGithubPackagesBillingGheData; } /** - * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsDownloadJobLogsForWorkflowRun - * @summary Download job logs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. + * @tags billing + * @name BillingGetSharedStorageBillingGhe + * @summary Get shared storage billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage */ - export namespace ActionsDownloadJobLogsForWorkflowRun { + export namespace BillingGetSharedStorageBillingGhe { export type RequestParams = { - /** job_id parameter */ - jobId: number; - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = BillingGetSharedStorageBillingGheData; } /** - * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsDownloadWorkflowRunLogs - * @summary Download workflow run logs - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Add organization access to a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - export namespace ActionsDownloadWorkflowRunLogs { + export namespace EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsEnableWorkflow - * @summary Enable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise + * @summary Add a self-hosted runner to a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - export namespace ActionsEnableWorkflow { + export namespace EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsEnableWorkflowData; + export type ResponseBody = + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData; } /** - * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. - * @tags actions - * @name ActionsGetAllowedActionsRepository - * @summary Get allowed actions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` + * @tags enterprise-admin + * @name EnterpriseAdminCreateRegistrationTokenForEnterprise + * @summary Create a registration token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/registration-token */ - export namespace ActionsGetAllowedActionsRepository { + export namespace EnterpriseAdminCreateRegistrationTokenForEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetAllowedActionsRepositoryData; + export type ResponseBody = + EnterpriseAdminCreateRegistrationTokenForEnterpriseData; } /** - * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetArtifact - * @summary Get an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @tags enterprise-admin + * @name EnterpriseAdminCreateRemoveTokenForEnterprise + * @summary Create a remove token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/remove-token */ - export namespace ActionsGetArtifact { + export namespace EnterpriseAdminCreateRemoveTokenForEnterprise { export type RequestParams = { - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetArtifactData; + export type ResponseBody = + EnterpriseAdminCreateRemoveTokenForEnterpriseData; } /** - * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. - * @tags actions - * @name ActionsGetGithubActionsPermissionsRepository - * @summary Get GitHub Actions permissions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions + * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise + * @summary Create a self-hosted runner group for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runner-groups */ - export namespace ActionsGetGithubActionsPermissionsRepository { + export namespace EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetGithubActionsPermissionsRepositoryData; + export type ResponseBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData; } /** - * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetJobForWorkflowRun - * @summary Get a job for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} + * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise + * @summary Delete a self-hosted runner from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} */ - export namespace ActionsGetJobForWorkflowRun { + export namespace EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise { export type RequestParams = { - /** job_id parameter */ - jobId: number; - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetJobForWorkflowRunData; + export type ResponseBody = + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData; } /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. - * @tags actions - * @name ActionsGetRepoPublicKey - * @summary Get a repository public key - * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key + * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise + * @summary Delete a self-hosted runner group from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - export namespace ActionsGetRepoPublicKey { + export namespace EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetRepoPublicKeyData; + export type ResponseBody = + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData; } /** - * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. - * @tags actions - * @name ActionsGetRepoSecret - * @summary Get a repository secret - * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise + * @summary Disable a selected organization for GitHub Actions in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - export namespace ActionsGetRepoSecret { + export namespace EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetRepoSecretData; + export type ResponseBody = + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData; } /** - * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. - * @tags actions - * @name ActionsGetSelfHostedRunnerForRepo - * @summary Get a self-hosted runner for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise + * @summary Enable a selected organization for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - export namespace ActionsGetSelfHostedRunnerForRepo { + export namespace EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetSelfHostedRunnerForRepoData; + export type ResponseBody = + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData; } /** - * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetWorkflow - * @summary Get a workflow - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminGetAllowedActionsEnterprise + * @summary Get allowed actions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions */ - export namespace ActionsGetWorkflow { + export namespace EnterpriseAdminGetAllowedActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowData; + export type ResponseBody = EnterpriseAdminGetAllowedActionsEnterpriseData; } /** - * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetWorkflowRun - * @summary Get a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} + * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise + * @summary Get GitHub Actions permissions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions */ - export namespace ActionsGetWorkflowRun { + export namespace EnterpriseAdminGetGithubActionsPermissionsEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowRunData; + export type ResponseBody = + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData; } /** - * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetWorkflowRunUsage - * @summary Get workflow run usage - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing + * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise + * @summary Get a self-hosted runner for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} */ - export namespace ActionsGetWorkflowRunUsage { + export namespace EnterpriseAdminGetSelfHostedRunnerForEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowRunUsageData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerForEnterpriseData; } /** - * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsGetWorkflowUsage - * @summary Get workflow usage - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise + * @summary Get a self-hosted runner group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - export namespace ActionsGetWorkflowUsage { + export namespace EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowUsageData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData; } /** - * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsListArtifactsForRepo - * @summary List artifacts for a repository - * @request GET:/repos/{owner}/{repo}/actions/artifacts + * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary List organization access to a self-hosted runner group in an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - export namespace ActionsListArtifactsForRepo { + export namespace EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = { /** @@ -40674,57 +37403,40 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListArtifactsForRepoData; + export type ResponseBody = + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). - * @tags actions - * @name ActionsListJobsForWorkflowRun - * @summary List jobs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListRunnerApplicationsForEnterprise + * @summary List runner applications for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/downloads */ - export namespace ActionsListJobsForWorkflowRun { + export namespace EnterpriseAdminListRunnerApplicationsForEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; - }; - export type RequestQuery = { - /** - * Filters jobs by their \`completed_at\` timestamp. Can be one of: - * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. - * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. - * @default "latest" - */ - filter?: ActionsListJobsForWorkflowRunParams1FilterEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListJobsForWorkflowRunData; + export type ResponseBody = + EnterpriseAdminListRunnerApplicationsForEnterpriseData; } /** - * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. - * @tags actions - * @name ActionsListRepoSecrets - * @summary List repository secrets - * @request GET:/repos/{owner}/{repo}/actions/secrets + * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary List selected organizations enabled for GitHub Actions in an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/organizations */ - export namespace ActionsListRepoSecrets { + export namespace EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -40740,20 +37452,21 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRepoSecretsData; + export type ResponseBody = + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** - * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsListRepoWorkflows - * @summary List repository workflows - * @request GET:/repos/{owner}/{repo}/actions/workflows + * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise + * @summary List self-hosted runner groups for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups */ - export namespace ActionsListRepoWorkflows { + export namespace EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -40769,38 +37482,21 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRepoWorkflowsData; - } - - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. - * @tags actions - * @name ActionsListRunnerApplicationsForRepo - * @summary List runner applications for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/downloads - */ - export namespace ActionsListRunnerApplicationsForRepo { - export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActionsListRunnerApplicationsForRepoData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData; } /** - * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. - * @tags actions - * @name ActionsListSelfHostedRunnersForRepo - * @summary List self-hosted runners for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners + * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersForEnterprise + * @summary List self-hosted runners for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners */ - export namespace ActionsListSelfHostedRunnersForRepo { + export namespace EnterpriseAdminListSelfHostedRunnersForEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -40816,21 +37512,23 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnersForRepoData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersForEnterpriseData; } /** - * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsListWorkflowRunArtifacts - * @summary List workflow run artifacts - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise + * @summary List self-hosted runners in a group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - export namespace ActionsListWorkflowRunArtifacts { + export namespace EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = { /** @@ -40846,452 +37544,400 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListWorkflowRunArtifactsData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData; } /** - * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. - * @tags actions - * @name ActionsListWorkflowRuns - * @summary List workflow runs - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Remove organization access to a self-hosted runner group in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - export namespace ActionsListWorkflowRuns { + export namespace EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - owner: string; - repo: string; - /** The ID of the workflow. You can also pass the workflow file name as a string. */ - workflowId: number | string; - }; - export type RequestQuery = { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: ActionsListWorkflowRunsParams1StatusEnum; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + orgId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListWorkflowRunsData; + export type ResponseBody = + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * @tags actions - * @name ActionsListWorkflowRunsForRepo - * @summary List workflow runs for a repository - * @request GET:/repos/{owner}/{repo}/actions/runs + * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise + * @summary Remove a self-hosted runner from a group for an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - export namespace ActionsListWorkflowRunsForRepo { + export namespace EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: ActionsListWorkflowRunsForRepoParams1StatusEnum; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListWorkflowRunsForRepoData; + export type ResponseBody = + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData; } /** - * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * @tags actions - * @name ActionsReRunWorkflow - * @summary Re-run a workflow - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun + * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminSetAllowedActionsEnterprise + * @summary Set allowed actions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions */ - export namespace ActionsReRunWorkflow { + export namespace EnterpriseAdminSetAllowedActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; - runId: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = SelectedActions; export type RequestHeaders = {}; - export type ResponseBody = ActionsReRunWorkflowData; + export type ResponseBody = EnterpriseAdminSetAllowedActionsEnterpriseData; } /** - * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. - * @tags actions - * @name ActionsSetAllowedActionsRepository - * @summary Set allowed actions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise + * @summary Set GitHub Actions permissions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions */ - export namespace ActionsSetAllowedActionsRepository { + export namespace EnterpriseAdminSetGithubActionsPermissionsEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = SelectedActions; + export type RequestBody = + EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetAllowedActionsRepositoryData; + export type ResponseBody = + EnterpriseAdminSetGithubActionsPermissionsEnterpriseData; } /** - * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. - * @tags actions - * @name ActionsSetGithubActionsPermissionsRepository - * @summary Set GitHub Actions permissions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions + * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Set organization access for a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - export namespace ActionsSetGithubActionsPermissionsRepository { + export namespace EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; export type RequestBody = - ActionsSetGithubActionsPermissionsRepositoryPayload; + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetGithubActionsPermissionsRepositoryData; + export type ResponseBody = + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). - * @tags activity - * @name ActivityDeleteRepoSubscription - * @summary Delete a repository subscription - * @request DELETE:/repos/{owner}/{repo}/subscription + * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary Set selected organizations enabled for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations */ - export namespace ActivityDeleteRepoSubscription { + export namespace EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityDeleteRepoSubscriptionData; + export type ResponseBody = + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** - * No description - * @tags activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise + * @summary Set self-hosted runners in a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - export namespace ActivityGetRepoSubscription { + export namespace EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityGetRepoSubscriptionData; + export type ResponseBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData; } /** - * No description - * @tags activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * @tags enterprise-admin + * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise + * @summary Update a self-hosted runner group for an enterprise + * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - export namespace ActivityListRepoEvents { + export namespace EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityListRepoEventsData; + export type ResponseBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData; } +} +export namespace Events { /** - * @description List all notifications for the current user. + * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. * @tags activity - * @name ActivityListRepoNotificationsForAuthenticatedUser - * @summary List repository notifications for the authenticated user - * @request GET:/repos/{owner}/{repo}/notifications + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - export namespace ActivityListRepoNotificationsForAuthenticatedUser { - export type RequestParams = { - owner: string; - repo: string; - }; + export namespace ActivityListPublicEvents { + export type RequestParams = {}; export type RequestQuery = { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - ActivityListRepoNotificationsForAuthenticatedUserData; + export type ResponseBody = ActivityListPublicEventsData; } +} +export namespace Feeds { /** - * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. * @tags activity - * @name ActivityListStargazersForRepo - * @summary List stargazers - * @request GET:/repos/{owner}/{repo}/stargazers + * @name ActivityGetFeeds + * @summary Get feeds + * @request GET:/feeds */ - export namespace ActivityListStargazersForRepo { - export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; + export namespace ActivityGetFeeds { + export type RequestParams = {}; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListStargazersForRepoData; + export type ResponseBody = ActivityGetFeedsData; } +} +export namespace Gists { /** - * @description Lists the people watching the specified repository. - * @tags activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * No description + * @tags gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - export namespace ActivityListWatchersForRepo { + export namespace GistsCheckIsStarred { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** gist_id parameter */ + gistId: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListWatchersForRepoData; + export type ResponseBody = GistsCheckIsStarredData; } /** - * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. - * @tags activity - * @name ActivityMarkRepoNotificationsAsRead - * @summary Mark repository notifications as read - * @request PUT:/repos/{owner}/{repo}/notifications + * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. + * @tags gists + * @name GistsCreate + * @summary Create a gist + * @request POST:/gists */ - export namespace ActivityMarkRepoNotificationsAsRead { - export type RequestParams = { - owner: string; - repo: string; - }; + export namespace GistsCreate { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = ActivityMarkRepoNotificationsAsReadPayload; + export type RequestBody = GistsCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkRepoNotificationsAsReadData; + export type ResponseBody = GistsCreateData; } /** - * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. - * @tags activity - * @name ActivitySetRepoSubscription - * @summary Set a repository subscription - * @request PUT:/repos/{owner}/{repo}/subscription + * No description + * @tags gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments */ - export namespace ActivitySetRepoSubscription { + export namespace GistsCreateComment { export type RequestParams = { - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = ActivitySetRepoSubscriptionPayload; + export type RequestBody = GistsCreateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivitySetRepoSubscriptionData; + export type ResponseBody = GistsCreateCommentData; } /** - * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetRepoInstallation - * @summary Get a repository installation for the authenticated app - * @request GET:/repos/{owner}/{repo}/installation + * No description + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} */ - export namespace AppsGetRepoInstallation { + export namespace GistsDelete { export type RequestParams = { - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsGetRepoInstallationData; + export type ResponseBody = GistsDeleteData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. - * @tags checks - * @name ChecksCreate - * @summary Create a check run - * @request POST:/repos/{owner}/{repo}/check-runs + * No description + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} */ - export namespace ChecksCreate { + export namespace GistsDeleteComment { export type RequestParams = { - owner: string; - repo: string; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = ChecksCreatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksCreateData; + export type ResponseBody = GistsDeleteCommentData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. - * @tags checks - * @name ChecksCreateSuite - * @summary Create a check suite - * @request POST:/repos/{owner}/{repo}/check-suites + * @description **Note**: This was previously \`/gists/:gist_id/fork\`. + * @tags gists + * @name GistsFork + * @summary Fork a gist + * @request POST:/gists/{gist_id}/forks */ - export namespace ChecksCreateSuite { + export namespace GistsFork { export type RequestParams = { - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = ChecksCreateSuitePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksCreateSuiteData; + export type ResponseBody = GistsForkData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. - * @tags checks - * @name ChecksGet - * @summary Get a check run - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + * No description + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - export namespace ChecksGet { + export namespace GistsGet { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksGetData; + export type ResponseBody = GistsGetData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. - * @tags checks - * @name ChecksGetSuite - * @summary Get a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} + * No description + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} */ - export namespace ChecksGetSuite { + export namespace GistsGetComment { export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksGetSuiteData; + export type ResponseBody = GistsGetCommentData; } /** - * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. - * @tags checks - * @name ChecksListAnnotations - * @summary List check run annotations - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + * No description + * @tags gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - export namespace ChecksListAnnotations { + export namespace GistsGetRevision { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; + sha: string; }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GistsGetRevisionData; + } + + /** + * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: + * @tags gists + * @name GistsList + * @summary List gists for the authenticated user + * @request GET:/gists + */ + export namespace GistsList { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -41303,34 +37949,27 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListAnnotationsData; + export type ResponseBody = GistsListData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. - * @tags checks - * @name ChecksListForRef - * @summary List check runs for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs + * No description + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - export namespace ChecksListForRef { + export namespace GistsListComments { export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = { - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: ChecksListForRefParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -41341,36 +37980,25 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: ChecksListForRefParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListForRefData; + export type ResponseBody = GistsListCommentsData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. - * @tags checks - * @name ChecksListForSuite - * @summary List check runs in a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + * No description + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - export namespace ChecksListForSuite { + export namespace GistsListCommits { export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = { - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: ChecksListForSuiteParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -41381,36 +38009,25 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: ChecksListForSuiteParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListForSuiteData; + export type ResponseBody = GistsListCommitsData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. - * @tags checks - * @name ChecksListSuitesForRef - * @summary List check suites for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites + * No description + * @tags gists + * @name GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - export namespace ChecksListSuitesForRef { + export namespace GistsListForks { export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = { - /** - * Filters check suites by GitHub App \`id\`. - * @example 1 - */ - app_id?: number; - /** Returns check runs with the specified \`name\`. */ - check_name?: string; /** * Page number of the results to fetch. * @default 1 @@ -41424,412 +38041,469 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListSuitesForRefData; + export type ResponseBody = GistsListForksData; } /** - * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. - * @tags checks - * @name ChecksRerequestSuite - * @summary Rerequest a check suite - * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. + * @tags gists + * @name GistsListPublic + * @summary List public gists + * @request GET:/gists/public */ - export namespace ChecksRerequestSuite { - export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; + export namespace GistsListPublic { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksRerequestSuiteData; + export type ResponseBody = GistsListPublicData; } /** - * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. - * @tags checks - * @name ChecksSetSuitesPreferences - * @summary Update repository preferences for check suites - * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences + * @description List the authenticated user's starred gists: + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred */ - export namespace ChecksSetSuitesPreferences { - export type RequestParams = { - owner: string; - repo: string; + export namespace GistsListStarred { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; - export type RequestQuery = {}; - export type RequestBody = ChecksSetSuitesPreferencesPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksSetSuitesPreferencesData; + export type ResponseBody = GistsListStarredData; } /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. - * @tags checks - * @name ChecksUpdate - * @summary Update a check run - * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags gists + * @name GistsStar + * @summary Star a gist + * @request PUT:/gists/{gist_id}/star */ - export namespace ChecksUpdate { + export namespace GistsStar { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = ChecksUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksUpdateData; + export type ResponseBody = GistsStarData; } /** - * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. - * @tags code-scanning - * @name CodeScanningGetAlert - * @summary Get a code scanning alert - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * No description + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - export namespace CodeScanningGetAlert { + export namespace GistsUnstar { export type RequestParams = { - alertNumber: number; - owner: string; - repo: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningGetAlertData; + export type ResponseBody = GistsUnstarData; } /** - * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. - * @tags code-scanning - * @name CodeScanningListAlertsForRepo - * @summary List code scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts + * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. + * @tags gists + * @name GistsUpdate + * @summary Update a gist + * @request PATCH:/gists/{gist_id} */ - export namespace CodeScanningListAlertsForRepo { + export namespace GistsUpdate { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ - state?: CodeScanningAlertState; + /** gist_id parameter */ + gistId: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = GistsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningListAlertsForRepoData; + export type ResponseBody = GistsUpdateData; } /** - * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. - * @tags code-scanning - * @name CodeScanningListRecentAnalyses - * @summary List recent code scanning analyses for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/analyses + * No description + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} */ - export namespace CodeScanningListRecentAnalyses { + export namespace GistsUpdateComment { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAnalysisRef; - /** Set a single code scanning tool name to filter alerts by tool. */ - tool_name?: CodeScanningAnalysisToolName; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = GistsUpdateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningListRecentAnalysesData; + export type ResponseBody = GistsUpdateCommentData; } +} +export namespace Gitignore { /** - * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. - * @tags code-scanning - * @name CodeScanningUpdateAlert - * @summary Update a code scanning alert - * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). + * @tags gitignore + * @name GitignoreGetAllTemplates + * @summary Get all gitignore templates + * @request GET:/gitignore/templates */ - export namespace CodeScanningUpdateAlert { - export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; - owner: string; - repo: string; - }; + export namespace GitignoreGetAllTemplates { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = CodeScanningUpdateAlertPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningUpdateAlertData; + export type ResponseBody = GitignoreGetAllTemplatesData; } /** - * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. - * @tags code-scanning - * @name CodeScanningUploadSarif - * @summary Upload a SARIF file - * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs + * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. + * @tags gitignore + * @name GitignoreGetTemplate + * @summary Get a gitignore template + * @request GET:/gitignore/templates/{name} */ - export namespace CodeScanningUploadSarif { + export namespace GitignoreGetTemplate { export type RequestParams = { - owner: string; - repo: string; + name: string; }; export type RequestQuery = {}; - export type RequestBody = CodeScanningUploadSarifPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningUploadSarifData; + export type ResponseBody = GitignoreGetTemplateData; } +} +export namespace Installation { /** - * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. - * @tags codes-of-conduct - * @name CodesOfConductGetForRepo - * @summary Get the code of conduct for a repository - * @request GET:/repos/{owner}/{repo}/community/code_of_conduct + * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * @tags apps + * @name AppsListReposAccessibleToInstallation + * @summary List repositories accessible to the app installation + * @request GET:/installation/repositories */ - export namespace CodesOfConductGetForRepo { - export type RequestParams = { - owner: string; - repo: string; + export namespace AppsListReposAccessibleToInstallation { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetForRepoData; + export type ResponseBody = AppsListReposAccessibleToInstallationData; } /** - * No description - * @tags git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * @tags apps + * @name AppsRevokeInstallationAccessToken + * @summary Revoke an installation access token + * @request DELETE:/installation/token */ - export namespace GitCreateBlob { - export type RequestParams = { - owner: string; - repo: string; - }; + export namespace AppsRevokeInstallationAccessToken { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = GitCreateBlobPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateBlobData; + export type ResponseBody = AppsRevokeInstallationAccessTokenData; } +} +export namespace Issues { /** - * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags git - * @name GitCreateCommit - * @summary Create a commit - * @request POST:/repos/{owner}/{repo}/git/commits - */ - export namespace GitCreateCommit { - export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = {}; - export type RequestBody = GitCreateCommitPayload; - export type RequestHeaders = {}; - export type ResponseBody = GitCreateCommitData; - } - - /** - * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. - * @tags git - * @name GitCreateRef - * @summary Create a reference - * @request POST:/repos/{owner}/{repo}/git/refs + * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags issues + * @name IssuesList + * @summary List issues assigned to the authenticated user + * @request GET:/issues */ - export namespace GitCreateRef { - export type RequestParams = { - owner: string; - repo: string; + export namespace IssuesList { + export type RequestParams = {}; + export type RequestQuery = { + collab?: boolean; + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: IssuesListParams1DirectionEnum; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: IssuesListParams1FilterEnum; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + orgs?: boolean; + owned?: boolean; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + pulls?: boolean; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: IssuesListParams1SortEnum; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: IssuesListParams1StateEnum; }; - export type RequestQuery = {}; - export type RequestBody = GitCreateRefPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateRefData; + export type ResponseBody = IssuesListData; } +} +export namespace Licenses { /** - * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags git - * @name GitCreateTag - * @summary Create a tag object - * @request POST:/repos/{owner}/{repo}/git/tags + * No description + * @tags licenses + * @name LicensesGet + * @summary Get a license + * @request GET:/licenses/{license} */ - export namespace GitCreateTag { + export namespace LicensesGet { export type RequestParams = { - owner: string; - repo: string; + license: string; }; export type RequestQuery = {}; - export type RequestBody = GitCreateTagPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateTagData; + export type ResponseBody = LicensesGetData; } /** - * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." - * @tags git - * @name GitCreateTree - * @summary Create a tree - * @request POST:/repos/{owner}/{repo}/git/trees + * No description + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - export namespace GitCreateTree { - export type RequestParams = { - owner: string; - repo: string; + export namespace LicensesGetAllCommonlyUsed { + export type RequestParams = {}; + export type RequestQuery = { + featured?: boolean; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; - export type RequestBody = GitCreateTreePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateTreeData; + export type ResponseBody = LicensesGetAllCommonlyUsedData; } +} +export namespace Markdown { /** * No description - * @tags git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + * @tags markdown + * @name MarkdownRender + * @summary Render a Markdown document + * @request POST:/markdown */ - export namespace GitDeleteRef { - export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; - }; + export namespace MarkdownRender { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MarkdownRenderPayload; export type RequestHeaders = {}; - export type ResponseBody = GitDeleteRefData; + export type ResponseBody = MarkdownRenderData; } /** - * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. - * @tags git - * @name GitGetBlob - * @summary Get a blob - * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} + * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. + * @tags markdown + * @name MarkdownRenderRaw + * @summary Render a Markdown document in raw mode + * @request POST:/markdown/raw */ - export namespace GitGetBlob { - export type RequestParams = { - fileSha: string; - owner: string; - repo: string; - }; + export namespace MarkdownRenderRaw { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MarkdownRenderRawPayload; export type RequestHeaders = {}; - export type ResponseBody = GitGetBlobData; + export type ResponseBody = MarkdownRenderRawData; } +} +export namespace MarketplaceListing { /** - * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags git - * @name GitGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsGetSubscriptionPlanForAccount + * @summary Get a subscription plan for an account + * @request GET:/marketplace_listing/accounts/{account_id} */ - export namespace GitGetCommit { + export namespace AppsGetSubscriptionPlanForAccount { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; - owner: string; - repo: string; + /** account_id parameter */ + accountId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetCommitData; + export type ResponseBody = AppsGetSubscriptionPlanForAccountData; } /** - * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". - * @tags git - * @name GitGetRef - * @summary Get a reference - * @request GET:/repos/{owner}/{repo}/git/ref/{ref} + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsGetSubscriptionPlanForAccountStubbed + * @summary Get a subscription plan for an account (stubbed) + * @request GET:/marketplace_listing/stubbed/accounts/{account_id} */ - export namespace GitGetRef { + export namespace AppsGetSubscriptionPlanForAccountStubbed { export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + /** account_id parameter */ + accountId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetRefData; + export type ResponseBody = AppsGetSubscriptionPlanForAccountStubbedData; } /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags git - * @name GitGetTag - * @summary Get a tag - * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} + * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsListAccountsForPlan + * @summary List accounts for a plan + * @request GET:/marketplace_listing/plans/{plan_id}/accounts */ - export namespace GitGetTag { + export namespace AppsListAccountsForPlan { export type RequestParams = { - owner: string; - repo: string; - tagSha: string; + /** plan_id parameter */ + planId: number; + }; + export type RequestQuery = { + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: AppsListAccountsForPlanParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: AppsListAccountsForPlanParams1SortEnum; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetTagData; + export type ResponseBody = AppsListAccountsForPlanData; } /** - * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. - * @tags git - * @name GitGetTree - * @summary Get a tree - * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} + * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsListAccountsForPlanStubbed + * @summary List accounts for a plan (stubbed) + * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts */ - export namespace GitGetTree { + export namespace AppsListAccountsForPlanStubbed { export type RequestParams = { - owner: string; - repo: string; - treeSha: string; + /** plan_id parameter */ + planId: number; }; export type RequestQuery = { - /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ - recursive?: string; + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: AppsListAccountsForPlanStubbedParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: AppsListAccountsForPlanStubbedParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetTreeData; + export type ResponseBody = AppsListAccountsForPlanStubbedData; } /** - * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. - * @tags git - * @name GitListMatchingRefs - * @summary List matching references - * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsListPlans + * @summary List plans + * @request GET:/marketplace_listing/plans */ - export namespace GitListMatchingRefs { - export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; - }; + export namespace AppsListPlans { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -41844,592 +38518,627 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitListMatchingRefsData; + export type ResponseBody = AppsListPlansData; } /** - * No description - * @tags git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * @tags apps + * @name AppsListPlansStubbed + * @summary List plans (stubbed) + * @request GET:/marketplace_listing/stubbed/plans */ - export namespace GitUpdateRef { - export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + export namespace AppsListPlansStubbed { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; - export type RequestBody = GitUpdateRefPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitUpdateRefData; + export type ResponseBody = AppsListPlansStubbedData; } +} +export namespace Meta { /** - * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. - * @tags interactions - * @name InteractionsGetRestrictionsForRepo - * @summary Get interaction restrictions for a repository - * @request GET:/repos/{owner}/{repo}/interaction-limits + * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. + * @tags meta + * @name MetaGet + * @summary Get GitHub meta information + * @request GET:/meta */ - export namespace InteractionsGetRestrictionsForRepo { - export type RequestParams = { - owner: string; - repo: string; - }; + export namespace MetaGet { + export type RequestParams = {}; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsGetRestrictionsForRepoData; + export type ResponseBody = MetaGetData; } +} +export namespace Networks { /** - * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. - * @tags interactions - * @name InteractionsRemoveRestrictionsForRepo - * @summary Remove interaction restrictions for a repository - * @request DELETE:/repos/{owner}/{repo}/interaction-limits + * No description + * @tags activity + * @name ActivityListPublicEventsForRepoNetwork + * @summary List public events for a network of repositories + * @request GET:/networks/{owner}/{repo}/events */ - export namespace InteractionsRemoveRestrictionsForRepo { + export namespace ActivityListPublicEventsForRepoNetwork { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsRemoveRestrictionsForRepoData; + export type ResponseBody = ActivityListPublicEventsForRepoNetworkData; } +} +export namespace Notifications { /** - * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. - * @tags interactions - * @name InteractionsSetRestrictionsForRepo - * @summary Set interaction restrictions for a repository - * @request PUT:/repos/{owner}/{repo}/interaction-limits + * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. + * @tags activity + * @name ActivityDeleteThreadSubscription + * @summary Delete a thread subscription + * @request DELETE:/notifications/threads/{thread_id}/subscription */ - export namespace InteractionsSetRestrictionsForRepo { + export namespace ActivityDeleteThreadSubscription { export type RequestParams = { - owner: string; - repo: string; + /** thread_id parameter */ + threadId: number; }; export type RequestQuery = {}; - export type RequestBody = InteractionLimit; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsSetRestrictionsForRepoData; + export type ResponseBody = ActivityDeleteThreadSubscriptionData; } /** - * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. - * @tags issues - * @name IssuesAddAssignees - * @summary Add assignees to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * No description + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - export namespace IssuesAddAssignees { + export namespace ActivityGetThread { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + /** thread_id parameter */ + threadId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesAddAssigneesPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesAddAssigneesData; + export type ResponseBody = ActivityGetThreadData; } /** - * No description - * @tags issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. + * @tags activity + * @name ActivityGetThreadSubscriptionForAuthenticatedUser + * @summary Get a thread subscription for the authenticated user + * @request GET:/notifications/threads/{thread_id}/subscription */ - export namespace IssuesAddLabels { + export namespace ActivityGetThreadSubscriptionForAuthenticatedUser { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + /** thread_id parameter */ + threadId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesAddLabelsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesAddLabelsData; + export type ResponseBody = + ActivityGetThreadSubscriptionForAuthenticatedUserData; } /** - * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. - * @tags issues - * @name IssuesCheckUserCanBeAssigned - * @summary Check if a user can be assigned - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @description List all notifications for the current user, sorted by most recently updated. + * @tags activity + * @name ActivityListNotificationsForAuthenticatedUser + * @summary List notifications for the authenticated user + * @request GET:/notifications */ - export namespace IssuesCheckUserCanBeAssigned { - export type RequestParams = { - assignee: string; - owner: string; - repo: string; + export namespace ActivityListNotificationsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * If \`true\`, show notifications marked as read. + * @default false + */ + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCheckUserCanBeAssignedData; + export type ResponseBody = + ActivityListNotificationsForAuthenticatedUserData; } /** - * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. - * @tags issues - * @name IssuesCreate - * @summary Create an issue - * @request POST:/repos/{owner}/{repo}/issues - */ - export namespace IssuesCreate { - export type RequestParams = { - owner: string; - repo: string; - }; + * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. + * @tags activity + * @name ActivityMarkNotificationsAsRead + * @summary Mark notifications as read + * @request PUT:/notifications + */ + export namespace ActivityMarkNotificationsAsRead { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = IssuesCreatePayload; + export type RequestBody = ActivityMarkNotificationsAsReadPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateData; + export type ResponseBody = ActivityMarkNotificationsAsReadData; } /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. - * @tags issues - * @name IssuesCreateComment - * @summary Create an issue comment - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments + * No description + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} */ - export namespace IssuesCreateComment { + export namespace ActivityMarkThreadAsRead { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + /** thread_id parameter */ + threadId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreateCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateCommentData; + export type ResponseBody = ActivityMarkThreadAsReadData; } /** - * No description - * @tags issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. + * @tags activity + * @name ActivitySetThreadSubscription + * @summary Set a thread subscription + * @request PUT:/notifications/threads/{thread_id}/subscription */ - export namespace IssuesCreateLabel { + export namespace ActivitySetThreadSubscription { export type RequestParams = { - owner: string; - repo: string; + /** thread_id parameter */ + threadId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreateLabelPayload; + export type RequestBody = ActivitySetThreadSubscriptionPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateLabelData; + export type ResponseBody = ActivitySetThreadSubscriptionData; } +} +export namespace Octocat { /** - * No description - * @tags issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @description Get the octocat as ASCII art + * @tags meta + * @name MetaGetOctocat + * @summary Get Octocat + * @request GET:/octocat */ - export namespace IssuesCreateMilestone { + export namespace MetaGetOctocat { + export type RequestParams = {}; + export type RequestQuery = { + /** The words to show in Octocat's speech bubble */ + s?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MetaGetOctocatData; + } +} + +export namespace Organizations { + /** + * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. + * @tags orgs + * @name OrgsList + * @summary List organizations + * @request GET:/organizations + */ + export namespace OrgsList { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** An organization ID. Only return organizations with an ID greater than this ID. */ + since?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListData; + } +} + +export namespace Orgs { + /** + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Add repository access to a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + */ + export namespace ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + repositoryId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreateMilestonePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateMilestoneData; + export type ResponseBody = + ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * No description - * @tags issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsAddSelectedRepoToOrgSecret + * @summary Add selected repository to an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - export namespace IssuesDeleteComment { + export namespace ActionsAddSelectedRepoToOrgSecret { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + repositoryId: number; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesDeleteCommentData; + export type ResponseBody = ActionsAddSelectedRepoToOrgSecretData; } /** - * No description - * @tags issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsAddSelfHostedRunnerToGroupForOrg + * @summary Add a self-hosted runner to a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - export namespace IssuesDeleteLabel { + export namespace ActionsAddSelfHostedRunnerToGroupForOrg { export type RequestParams = { - name: string; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesDeleteLabelData; + export type ResponseBody = ActionsAddSelfHostedRunnerToGroupForOrgData; } /** - * No description - * @tags issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` + * @tags actions + * @name ActionsCreateOrUpdateOrgSecret + * @summary Create or update an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name} */ - export namespace IssuesDeleteMilestone { + export namespace ActionsCreateOrUpdateOrgSecret { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; + org: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActionsCreateOrUpdateOrgSecretPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesDeleteMilestoneData; + export type ResponseBody = ActionsCreateOrUpdateOrgSecretData; } /** - * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags issues - * @name IssuesGet - * @summary Get an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` + * @tags actions + * @name ActionsCreateRegistrationTokenForOrg + * @summary Create a registration token for an organization + * @request POST:/orgs/{org}/actions/runners/registration-token */ - export namespace IssuesGet { + export namespace ActionsCreateRegistrationTokenForOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetData; + export type ResponseBody = ActionsCreateRegistrationTokenForOrgData; } /** - * No description - * @tags issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @tags actions + * @name ActionsCreateRemoveTokenForOrg + * @summary Create a remove token for an organization + * @request POST:/orgs/{org}/actions/runners/remove-token */ - export namespace IssuesGetComment { + export namespace ActionsCreateRemoveTokenForOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetCommentData; + export type ResponseBody = ActionsCreateRemoveTokenForOrgData; } /** - * No description - * @tags issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsCreateSelfHostedRunnerGroupForOrg + * @summary Create a self-hosted runner group for an organization + * @request POST:/orgs/{org}/actions/runner-groups */ - export namespace IssuesGetEvent { + export namespace ActionsCreateSelfHostedRunnerGroupForOrg { export type RequestParams = { - eventId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActionsCreateSelfHostedRunnerGroupForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetEventData; + export type ResponseBody = ActionsCreateSelfHostedRunnerGroupForOrgData; } /** - * No description - * @tags issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsDeleteOrgSecret + * @summary Delete an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} */ - export namespace IssuesGetLabel { + export namespace ActionsDeleteOrgSecret { export type RequestParams = { - name: string; - owner: string; - repo: string; + org: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetLabelData; + export type ResponseBody = ActionsDeleteOrgSecretData; } /** - * No description - * @tags issues - * @name IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromOrg + * @summary Delete a self-hosted runner from an organization + * @request DELETE:/orgs/{org}/actions/runners/{runner_id} */ - export namespace IssuesGetMilestone { + export namespace ActionsDeleteSelfHostedRunnerFromOrg { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetMilestoneData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerFromOrgData; } /** - * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. - * @tags issues - * @name IssuesListAssignees - * @summary List assignees - * @request GET:/repos/{owner}/{repo}/assignees + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsDeleteSelfHostedRunnerGroupFromOrg + * @summary Delete a self-hosted runner group from an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - export namespace IssuesListAssignees { + export namespace ActionsDeleteSelfHostedRunnerGroupFromOrg { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListAssigneesData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerGroupFromOrgData; } /** - * @description Issue Comments are ordered by ascending ID. - * @tags issues - * @name IssuesListComments - * @summary List issue comments - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsDisableSelectedRepositoryGithubActionsOrganization + * @summary Disable a selected repository for GitHub Actions in an organization + * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - export namespace IssuesListComments { + export namespace ActionsDisableSelectedRepositoryGithubActionsOrganization { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + org: string; + repositoryId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListCommentsData; + export type ResponseBody = + ActionsDisableSelectedRepositoryGithubActionsOrganizationData; } /** - * @description By default, Issue Comments are ordered by ascending ID. - * @tags issues - * @name IssuesListCommentsForRepo - * @summary List issue comments for a repository - * @request GET:/repos/{owner}/{repo}/issues/comments + * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsEnableSelectedRepositoryGithubActionsOrganization + * @summary Enable a selected repository for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - export namespace IssuesListCommentsForRepo { + export namespace ActionsEnableSelectedRepositoryGithubActionsOrganization { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: IssuesListCommentsForRepoParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: IssuesListCommentsForRepoParams1SortEnum; + org: string; + repositoryId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListCommentsForRepoData; + export type ResponseBody = + ActionsEnableSelectedRepositoryGithubActionsOrganizationData; } /** - * No description - * @tags issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsGetAllowedActionsOrganization + * @summary Get allowed actions for an organization + * @request GET:/orgs/{org}/actions/permissions/selected-actions */ - export namespace IssuesListEvents { + export namespace ActionsGetAllowedActionsOrganization { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + org: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsData; + export type ResponseBody = ActionsGetAllowedActionsOrganizationData; } /** - * No description - * @tags issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsGetGithubActionsPermissionsOrganization + * @summary Get GitHub Actions permissions for an organization + * @request GET:/orgs/{org}/actions/permissions */ - export namespace IssuesListEventsForRepo { + export namespace ActionsGetGithubActionsPermissionsOrganization { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + org: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsForRepoData; + export type ResponseBody = + ActionsGetGithubActionsPermissionsOrganizationData; } /** - * No description - * @tags issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsGetOrgPublicKey + * @summary Get an organization public key + * @request GET:/orgs/{org}/actions/secrets/public-key */ - export namespace IssuesListEventsForTimeline { + export namespace ActionsGetOrgPublicKey { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + org: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsForTimelineData; + export type ResponseBody = ActionsGetOrgPublicKeyData; } /** - * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags issues - * @name IssuesListForRepo - * @summary List repository issues - * @request GET:/repos/{owner}/{repo}/issues + * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsGetOrgSecret + * @summary Get an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name} */ - export namespace IssuesListForRepo { + export namespace ActionsGetOrgSecret { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** secret_name parameter */ + secretName: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsGetOrgSecretData; + } + + /** + * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsGetSelfHostedRunnerForOrg + * @summary Get a self-hosted runner for an organization + * @request GET:/orgs/{org}/actions/runners/{runner_id} + */ + export namespace ActionsGetSelfHostedRunnerForOrg { + export type RequestParams = { + org: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsGetSelfHostedRunnerForOrgData; + } + + /** + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsGetSelfHostedRunnerGroupForOrg + * @summary Get a self-hosted runner group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} + */ + export namespace ActionsGetSelfHostedRunnerGroupForOrg { + export type RequestParams = { + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsGetSelfHostedRunnerGroupForOrgData; + } + + /** + * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsListOrgSecrets + * @summary List organization secrets + * @request GET:/orgs/{org}/actions/secrets + */ + export namespace ActionsListOrgSecrets { + export type RequestParams = { + org: string; }; export type RequestQuery = { - /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ - assignee?: string; - /** The user that created the issue. */ - creator?: string; - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: IssuesListForRepoParams1DirectionEnum; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** A user that's mentioned in the issue. */ - mentioned?: string; - /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ - milestone?: string; /** * Page number of the results to fetch. * @default 1 @@ -42440,37 +39149,78 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: IssuesListForRepoParams1SortEnum; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListForRepoParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListForRepoData; + export type ResponseBody = ActionsListOrgSecretsData; } /** - * No description - * @tags issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg + * @summary List repository access to a self-hosted runner group in an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - export namespace IssuesListLabelsForMilestone { + export namespace ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData; + } + + /** + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsListRunnerApplicationsForOrg + * @summary List runner applications for an organization + * @request GET:/orgs/{org}/actions/runners/downloads + */ + export namespace ActionsListRunnerApplicationsForOrg { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsListRunnerApplicationsForOrgData; + } + + /** + * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsListSelectedReposForOrgSecret + * @summary List selected repositories for an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories + */ + export namespace ActionsListSelectedReposForOrgSecret { + export type RequestParams = { + org: string; + /** secret_name parameter */ + secretName: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsListSelectedReposForOrgSecretData; + } + + /** + * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization + * @summary List selected repositories enabled for GitHub Actions in an organization + * @request GET:/orgs/{org}/actions/permissions/repositories + */ + export namespace ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { + export type RequestParams = { + org: string; }; export type RequestQuery = { /** @@ -42486,20 +39236,20 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListLabelsForMilestoneData; + export type ResponseBody = + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** - * No description - * @tags issues - * @name IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsListSelfHostedRunnerGroupsForOrg + * @summary List self-hosted runner groups for an organization + * @request GET:/orgs/{org}/actions/runner-groups */ - export namespace IssuesListLabelsForRepo { + export namespace ActionsListSelfHostedRunnerGroupsForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = { /** @@ -42515,22 +39265,19 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListLabelsForRepoData; + export type ResponseBody = ActionsListSelfHostedRunnerGroupsForOrgData; } /** - * No description - * @tags issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsListSelfHostedRunnersForOrg + * @summary List self-hosted runners for an organization + * @request GET:/orgs/{org}/actions/runners */ - export namespace IssuesListLabelsOnIssue { + export namespace ActionsListSelfHostedRunnersForOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = { /** @@ -42546,27 +39293,23 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListLabelsOnIssueData; + export type ResponseBody = ActionsListSelfHostedRunnersForOrgData; } /** - * No description - * @tags issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsListSelfHostedRunnersInGroupForOrg + * @summary List self-hosted runners in a group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners */ - export namespace IssuesListMilestones { + export namespace ActionsListSelfHostedRunnersInGroupForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = { - /** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" - */ - direction?: IssuesListMilestonesParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -42577,417 +39320,478 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" - */ - sort?: IssuesListMilestonesParams1SortEnum; - /** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListMilestonesParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListMilestonesData; + export type ResponseBody = ActionsListSelfHostedRunnersInGroupForOrgData; } /** - * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags issues - * @name IssuesLock - * @summary Lock an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Remove repository access to a self-hosted runner group in an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} */ - export namespace IssuesLock { + export namespace ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + repositoryId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesLockPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesLockData; + export type ResponseBody = + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * No description - * @tags issues - * @name IssuesRemoveAllLabels - * @summary Remove all labels from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsRemoveSelectedRepoFromOrgSecret + * @summary Remove selected repository from an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - export namespace IssuesRemoveAllLabels { + export namespace ActionsRemoveSelectedRepoFromOrgSecret { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + repositoryId: number; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveAllLabelsData; + export type ResponseBody = ActionsRemoveSelectedRepoFromOrgSecretData; } /** - * @description Removes one or more assignees from an issue. - * @tags issues - * @name IssuesRemoveAssignees - * @summary Remove assignees from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg + * @summary Remove a self-hosted runner from a group for an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - export namespace IssuesRemoveAssignees { + export namespace ActionsRemoveSelfHostedRunnerFromGroupForOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesRemoveAssigneesPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveAssigneesData; + export type ResponseBody = ActionsRemoveSelfHostedRunnerFromGroupForOrgData; } /** - * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. - * @tags issues - * @name IssuesRemoveLabel - * @summary Remove a label from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsSetAllowedActionsOrganization + * @summary Set allowed actions for an organization + * @request PUT:/orgs/{org}/actions/permissions/selected-actions */ - export namespace IssuesRemoveLabel { + export namespace ActionsSetAllowedActionsOrganization { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - name: string; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = SelectedActions; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveLabelData; + export type ResponseBody = ActionsSetAllowedActionsOrganizationData; } /** - * @description Removes any previous labels and sets the new labels for an issue. - * @tags issues - * @name IssuesSetLabels - * @summary Set labels for an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsSetGithubActionsPermissionsOrganization + * @summary Set GitHub Actions permissions for an organization + * @request PUT:/orgs/{org}/actions/permissions */ - export namespace IssuesSetLabels { + export namespace ActionsSetGithubActionsPermissionsOrganization { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesSetLabelsPayload; + export type RequestBody = + ActionsSetGithubActionsPermissionsOrganizationPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesSetLabelsData; + export type ResponseBody = + ActionsSetGithubActionsPermissionsOrganizationData; } /** - * @description Users with push access can unlock an issue's conversation. - * @tags issues - * @name IssuesUnlock - * @summary Unlock an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Set repository access for a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - export namespace IssuesUnlock { + export namespace ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesUnlockData; + export type ResponseBody = + ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * @description Issue owners and users with push access can edit an issue. - * @tags issues - * @name IssuesUpdate - * @summary Update an issue - * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} + * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @tags actions + * @name ActionsSetSelectedReposForOrgSecret + * @summary Set selected repositories for an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - export namespace IssuesUpdate { + export namespace ActionsSetSelectedReposForOrgSecret { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesUpdatePayload; + export type RequestBody = ActionsSetSelectedReposForOrgSecretPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateData; + export type ResponseBody = ActionsSetSelectedReposForOrgSecretData; } /** - * No description - * @tags issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @tags actions + * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization + * @summary Set selected repositories enabled for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories */ - export namespace IssuesUpdateComment { + export namespace ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesUpdateCommentPayload; + export type RequestBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateCommentData; + export type ResponseBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** - * No description - * @tags issues - * @name IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsSetSelfHostedRunnersInGroupForOrg + * @summary Set self-hosted runners in a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners */ - export namespace IssuesUpdateLabel { + export namespace ActionsSetSelfHostedRunnersInGroupForOrg { export type RequestParams = { - name: string; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesUpdateLabelPayload; + export type RequestBody = ActionsSetSelfHostedRunnersInGroupForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateLabelData; + export type ResponseBody = ActionsSetSelfHostedRunnersInGroupForOrgData; } /** - * No description - * @tags issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @tags actions + * @name ActionsUpdateSelfHostedRunnerGroupForOrg + * @summary Update a self-hosted runner group for an organization + * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - export namespace IssuesUpdateMilestone { + export namespace ActionsUpdateSelfHostedRunnerGroupForOrg { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; - owner: string; - repo: string; + org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesUpdateMilestonePayload; + export type RequestBody = ActionsUpdateSelfHostedRunnerGroupForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateMilestoneData; + export type ResponseBody = ActionsUpdateSelfHostedRunnerGroupForOrgData; } /** - * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. - * @tags licenses - * @name LicensesGetForRepo - * @summary Get the license for a repository - * @request GET:/repos/{owner}/{repo}/license + * No description + * @tags activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - export namespace LicensesGetForRepo { + export namespace ActivityListPublicOrgEvents { export type RequestParams = { - owner: string; - repo: string; + org: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = LicensesGetForRepoData; + export type ResponseBody = ActivityListPublicOrgEventsData; } /** - * @description Stop an import for a repository. - * @tags migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetOrgInstallation + * @summary Get an organization installation for the authenticated app + * @request GET:/orgs/{org}/installation */ - export namespace MigrationsCancelImport { + export namespace AppsGetOrgInstallation { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsCancelImportData; + export type ResponseBody = AppsGetOrgInstallationData; } /** - * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. - * @tags migrations - * @name MigrationsGetCommitAuthors - * @summary Get commit authors - * @request GET:/repos/{owner}/{repo}/import/authors + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. + * @tags billing + * @name BillingGetGithubActionsBillingOrg + * @summary Get GitHub Actions billing for an organization + * @request GET:/orgs/{org}/settings/billing/actions */ - export namespace MigrationsGetCommitAuthors { + export namespace BillingGetGithubActionsBillingOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; - export type RequestQuery = { - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = BillingGetGithubActionsBillingOrgData; + } + + /** + * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. + * @tags billing + * @name BillingGetGithubPackagesBillingOrg + * @summary Get GitHub Packages billing for an organization + * @request GET:/orgs/{org}/settings/billing/packages + */ + export namespace BillingGetGithubPackagesBillingOrg { + export type RequestParams = { + org: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetCommitAuthorsData; + export type ResponseBody = BillingGetGithubPackagesBillingOrgData; } /** - * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. - * @tags migrations - * @name MigrationsGetImportStatus - * @summary Get an import status - * @request GET:/repos/{owner}/{repo}/import + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. + * @tags billing + * @name BillingGetSharedStorageBillingOrg + * @summary Get shared storage billing for an organization + * @request GET:/orgs/{org}/settings/billing/shared-storage */ - export namespace MigrationsGetImportStatus { + export namespace BillingGetSharedStorageBillingOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetImportStatusData; + export type ResponseBody = BillingGetSharedStorageBillingOrgData; } /** - * @description List files larger than 100MB found during the import - * @tags migrations - * @name MigrationsGetLargeFiles - * @summary Get large files - * @request GET:/repos/{owner}/{repo}/import/large_files + * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. + * @tags interactions + * @name InteractionsGetRestrictionsForOrg + * @summary Get interaction restrictions for an organization + * @request GET:/orgs/{org}/interaction-limits */ - export namespace MigrationsGetLargeFiles { + export namespace InteractionsGetRestrictionsForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetLargeFilesData; + export type ResponseBody = InteractionsGetRestrictionsForOrgData; } /** - * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. - * @tags migrations - * @name MigrationsMapCommitAuthor - * @summary Map a commit author - * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} + * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. + * @tags interactions + * @name InteractionsRemoveRestrictionsForOrg + * @summary Remove interaction restrictions for an organization + * @request DELETE:/orgs/{org}/interaction-limits */ - export namespace MigrationsMapCommitAuthor { + export namespace InteractionsRemoveRestrictionsForOrg { export type RequestParams = { - authorId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = MigrationsMapCommitAuthorPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsMapCommitAuthorData; + export type ResponseBody = InteractionsRemoveRestrictionsForOrgData; } /** - * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). - * @tags migrations - * @name MigrationsSetLfsPreference - * @summary Update Git LFS preference - * @request PATCH:/repos/{owner}/{repo}/import/lfs + * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. + * @tags interactions + * @name InteractionsSetRestrictionsForOrg + * @summary Set interaction restrictions for an organization + * @request PUT:/orgs/{org}/interaction-limits */ - export namespace MigrationsSetLfsPreference { + export namespace InteractionsSetRestrictionsForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = MigrationsSetLfsPreferencePayload; + export type RequestBody = InteractionLimit; export type RequestHeaders = {}; - export type ResponseBody = MigrationsSetLfsPreferenceData; + export type ResponseBody = InteractionsSetRestrictionsForOrgData; } /** - * @description Start a source import to a GitHub repository using GitHub Importer. + * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags issues + * @name IssuesListForOrg + * @summary List organization issues assigned to the authenticated user + * @request GET:/orgs/{org}/issues + */ + export namespace IssuesListForOrg { + export type RequestParams = { + org: string; + }; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: IssuesListForOrgParams1DirectionEnum; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: IssuesListForOrgParams1FilterEnum; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: IssuesListForOrgParams1SortEnum; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: IssuesListForOrgParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = IssuesListForOrgData; + } + + /** + * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. * @tags migrations - * @name MigrationsStartImport - * @summary Start an import - * @request PUT:/repos/{owner}/{repo}/import + * @name MigrationsDeleteArchiveForOrg + * @summary Delete an organization migration archive + * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive */ - export namespace MigrationsStartImport { + export namespace MigrationsDeleteArchiveForOrg { export type RequestParams = { - owner: string; - repo: string; + /** migration_id parameter */ + migrationId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = MigrationsStartImportPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsStartImportData; + export type ResponseBody = MigrationsDeleteArchiveForOrgData; } /** - * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. + * @description Fetches the URL to a migration archive. * @tags migrations - * @name MigrationsUpdateImport - * @summary Update an import - * @request PATCH:/repos/{owner}/{repo}/import + * @name MigrationsDownloadArchiveForOrg + * @summary Download an organization migration archive + * @request GET:/orgs/{org}/migrations/{migration_id}/archive */ - export namespace MigrationsUpdateImport { + export namespace MigrationsDownloadArchiveForOrg { export type RequestParams = { - owner: string; - repo: string; + /** migration_id parameter */ + migrationId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = MigrationsUpdateImportPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsUpdateImportData; + export type ResponseBody = any; } /** - * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsCreateForRepo - * @summary Create a repository project - * @request POST:/repos/{owner}/{repo}/projects + * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. + * @tags migrations + * @name MigrationsGetStatusForOrg + * @summary Get an organization migration status + * @request GET:/orgs/{org}/migrations/{migration_id} */ - export namespace ProjectsCreateForRepo { + export namespace MigrationsGetStatusForOrg { export type RequestParams = { - owner: string; - repo: string; + /** migration_id parameter */ + migrationId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForRepoPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForRepoData; + export type ResponseBody = MigrationsGetStatusForOrgData; } /** - * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * @tags projects - * @name ProjectsListForRepo - * @summary List repository projects - * @request GET:/repos/{owner}/{repo}/projects + * @description Lists the most recent migrations. + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - export namespace ProjectsListForRepo { + export namespace MigrationsListForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = { /** @@ -43000,294 +39804,367 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: ProjectsListForRepoParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListForRepoData; + export type ResponseBody = MigrationsListForOrgData; } /** - * No description - * @tags pulls - * @name PullsCheckIfMerged - * @summary Check if a pull request has been merged - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @description List all the repositories for this organization migration. + * @tags migrations + * @name MigrationsListReposForOrg + * @summary List repositories in an organization migration + * @request GET:/orgs/{org}/migrations/{migration_id}/repositories */ - export namespace PullsCheckIfMerged { + export namespace MigrationsListReposForOrg { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + /** migration_id parameter */ + migrationId: number; + org: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsCheckIfMergedData; + export type ResponseBody = MigrationsListReposForOrgData; } /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags pulls - * @name PullsCreate - * @summary Create a pull request - * @request POST:/repos/{owner}/{repo}/pulls + * @description Initiates the generation of a migration archive. + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - export namespace PullsCreate { + export namespace MigrationsStartForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreatePayload; + export type RequestBody = MigrationsStartForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateData; + export type ResponseBody = MigrationsStartForOrgData; } /** - * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags pulls - * @name PullsCreateReplyForReviewComment - * @summary Create a reply for a review comment - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. + * @tags migrations + * @name MigrationsUnlockRepoForOrg + * @summary Unlock an organization repository + * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock */ - export namespace PullsCreateReplyForReviewComment { + export namespace MigrationsUnlockRepoForOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - pullNumber: number; - repo: string; + /** migration_id parameter */ + migrationId: number; + org: string; + /** repo_name parameter */ + repoName: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReplyForReviewCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReplyForReviewCommentData; + export type ResponseBody = MigrationsUnlockRepoForOrgData; } /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. - * @tags pulls - * @name PullsCreateReview - * @summary Create a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * No description + * @tags orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} */ - export namespace PullsCreateReview { + export namespace OrgsBlockUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReviewData; + export type ResponseBody = OrgsBlockUserData; } /** - * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags pulls - * @name PullsCreateReviewComment - * @summary Create a review comment for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + * @tags orgs + * @name OrgsCancelInvitation + * @summary Cancel an organization invitation + * @request DELETE:/orgs/{org}/invitations/{invitation_id} */ - export namespace PullsCreateReviewComment { + export namespace OrgsCancelInvitation { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + /** invitation_id parameter */ + invitationId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReviewCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReviewCommentData; + export type ResponseBody = OrgsCancelInvitationData; } /** * No description - * @tags pulls - * @name PullsDeletePendingReview - * @summary Delete a pending review for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - export namespace PullsDeletePendingReview { + export namespace OrgsCheckBlockedUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDeletePendingReviewData; + export type ResponseBody = OrgsCheckBlockedUserData; } /** - * @description Deletes a review comment. - * @tags pulls - * @name PullsDeleteReviewComment - * @summary Delete a review comment for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @description Check if a user is, publicly or privately, a member of the organization. + * @tags orgs + * @name OrgsCheckMembershipForUser + * @summary Check organization membership for a user + * @request GET:/orgs/{org}/members/{username} */ - export namespace PullsDeleteReviewComment { + export namespace OrgsCheckMembershipForUser { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDeleteReviewCommentData; + export type ResponseBody = OrgsCheckMembershipForUserData; } /** - * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. - * @tags pulls - * @name PullsDismissReview - * @summary Dismiss a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals + * No description + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - export namespace PullsDismissReview { + export namespace OrgsCheckPublicMembershipForUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsDismissReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDismissReviewData; + export type ResponseBody = OrgsCheckPublicMembershipForUserData; } /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. - * @tags pulls - * @name PullsGet - * @summary Get a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". + * @tags orgs + * @name OrgsConvertMemberToOutsideCollaborator + * @summary Convert an organization member to outside collaborator + * @request PUT:/orgs/{org}/outside_collaborators/{username} */ - export namespace PullsGet { + export namespace OrgsConvertMemberToOutsideCollaborator { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsGetData; + export type ResponseBody = OrgsConvertMemberToOutsideCollaboratorData; } /** - * No description - * @tags pulls - * @name PullsGetReview - * @summary Get a review for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags orgs + * @name OrgsCreateInvitation + * @summary Create an organization invitation + * @request POST:/orgs/{org}/invitations */ - export namespace PullsGetReview { + export namespace OrgsCreateInvitation { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OrgsCreateInvitationPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsGetReviewData; + export type ResponseBody = OrgsCreateInvitationData; } /** - * @description Provides details for a review comment. - * @tags pulls - * @name PullsGetReviewComment - * @summary Get a review comment for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @description Here's how you can create a hook that posts payloads in JSON format: + * @tags orgs + * @name OrgsCreateWebhook + * @summary Create an organization webhook + * @request POST:/orgs/{org}/hooks */ - export namespace PullsGetReviewComment { + export namespace OrgsCreateWebhook { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OrgsCreateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsGetReviewCommentData; + export type ResponseBody = OrgsCreateWebhookData; } /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags pulls - * @name PullsList - * @summary List pull requests - * @request GET:/repos/{owner}/{repo}/pulls + * No description + * @tags orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - export namespace PullsList { + export namespace OrgsDeleteWebhook { export type RequestParams = { - owner: string; - repo: string; + hookId: number; + org: string; }; - export type RequestQuery = { - /** Filter pulls by base branch name. Example: \`gh-pages\`. */ - base?: string; - /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ - direction?: PullsListParams1DirectionEnum; - /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ - head?: string; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsDeleteWebhookData; + } + + /** + * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." + * @tags orgs + * @name OrgsGet + * @summary Get an organization + * @request GET:/orgs/{org} + */ + export namespace OrgsGet { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetData; + } + + /** + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. + * @tags orgs + * @name OrgsGetAuditLog + * @summary Get the audit log for an organization + * @request GET:/orgs/{org}/audit-log + */ + export namespace OrgsGetAuditLog { + export type RequestParams = { + org: string; + }; + export type RequestQuery = { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; /** - * Page number of the results to fetch. - * @default 1 + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. */ - page?: number; + include?: OrgsGetAuditLogParams1IncludeEnum; + /** + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. + */ + order?: OrgsGetAuditLogParams1OrderEnum; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). - * @default "created" - */ - sort?: PullsListParams1SortEnum; - /** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ - state?: PullsListParams1StateEnum; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListData; + export type ResponseBody = OrgsGetAuditLogData; } /** - * @description List comments for a specific pull request review. - * @tags pulls - * @name PullsListCommentsForReview - * @summary List comments for a pull request review - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. + * @tags orgs + * @name OrgsGetMembershipForUser + * @summary Get organization membership for a user + * @request GET:/orgs/{org}/memberships/{username} */ - export namespace PullsListCommentsForReview { + export namespace OrgsGetMembershipForUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetMembershipForUserData; + } + + /** + * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." + * @tags orgs + * @name OrgsGetWebhook + * @summary Get an organization webhook + * @request GET:/orgs/{org}/hooks/{hook_id} + */ + export namespace OrgsGetWebhook { + export type RequestParams = { + hookId: number; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetWebhookData; + } + + /** + * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. + * @tags orgs + * @name OrgsGetWebhookConfigForOrg + * @summary Get a webhook configuration for an organization + * @request GET:/orgs/{org}/hooks/{hook_id}/config + */ + export namespace OrgsGetWebhookConfigForOrg { + export type RequestParams = { + hookId: number; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetWebhookConfigForOrgData; + } + + /** + * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. + * @tags orgs + * @name OrgsListAppInstallations + * @summary List app installations for an organization + * @request GET:/orgs/{org}/installations + */ + export namespace OrgsListAppInstallations { + export type RequestParams = { + org: string; }; export type RequestQuery = { /** @@ -43303,21 +40180,36 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListCommentsForReviewData; + export type ResponseBody = OrgsListAppInstallationsData; } /** - * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. - * @tags pulls - * @name PullsListCommits - * @summary List commits on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits + * @description List the users blocked by an organization. + * @tags orgs + * @name OrgsListBlockedUsers + * @summary List users blocked by an organization + * @request GET:/orgs/{org}/blocks */ - export namespace PullsListCommits { + export namespace OrgsListBlockedUsers { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListBlockedUsersData; + } + + /** + * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. + * @tags orgs + * @name OrgsListFailedInvitations + * @summary List failed organization invitations + * @request GET:/orgs/{org}/failed_invitations + */ + export namespace OrgsListFailedInvitations { + export type RequestParams = { + org: string; }; export type RequestQuery = { /** @@ -43333,21 +40225,21 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListCommitsData; + export type ResponseBody = OrgsListFailedInvitationsData; } /** - * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. - * @tags pulls - * @name PullsListFiles - * @summary List pull requests files - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files + * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + * @tags orgs + * @name OrgsListInvitationTeams + * @summary List organization invitation teams + * @request GET:/orgs/{org}/invitations/{invitation_id}/teams */ - export namespace PullsListFiles { + export namespace OrgsListInvitationTeams { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + /** invitation_id parameter */ + invitationId: number; + org: string; }; export type RequestQuery = { /** @@ -43363,23 +40255,28 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListFilesData; + export type ResponseBody = OrgsListInvitationTeamsData; } /** - * No description - * @tags pulls - * @name PullsListRequestedReviewers - * @summary List requested reviewers for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. + * @tags orgs + * @name OrgsListMembers + * @summary List organization members + * @request GET:/orgs/{org}/members */ - export namespace PullsListRequestedReviewers { + export namespace OrgsListMembers { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; }; export type RequestQuery = { + /** + * Filter members returned in the list. Can be one of: + * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \\* \`all\` - All members the authenticated user can see. + * @default "all" + */ + filter?: OrgsListMembersParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -43390,28 +40287,39 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** + * Filter members returned by their role. Can be one of: + * \\* \`all\` - All members of the organization, regardless of role. + * \\* \`admin\` - Organization owners. + * \\* \`member\` - Non-owner organization members. + * @default "all" + */ + role?: OrgsListMembersParams1RoleEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListRequestedReviewersData; + export type ResponseBody = OrgsListMembersData; } /** - * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. - * @tags pulls - * @name PullsListReviewComments - * @summary List review comments on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @description List all users who are outside collaborators of an organization. + * @tags orgs + * @name OrgsListOutsideCollaborators + * @summary List outside collaborators for an organization + * @request GET:/orgs/{org}/outside_collaborators */ - export namespace PullsListReviewComments { + export namespace OrgsListOutsideCollaborators { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; }; export type RequestQuery = { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: PullsListReviewCommentsParams1DirectionEnum; + /** + * Filter the list of outside collaborators. Can be one of: + * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \\* \`all\`: All outside collaborators. + * @default "all" + */ + filter?: OrgsListOutsideCollaboratorsParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -43422,34 +40330,24 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: PullsListReviewCommentsParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewCommentsData; + export type ResponseBody = OrgsListOutsideCollaboratorsData; } /** - * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. - * @tags pulls - * @name PullsListReviewCommentsForRepo - * @summary List review comments in a repository - * @request GET:/repos/{owner}/{repo}/pulls/comments + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * @tags orgs + * @name OrgsListPendingInvitations + * @summary List pending organization invitations + * @request GET:/orgs/{org}/invitations */ - export namespace PullsListReviewCommentsForRepo { + export namespace OrgsListPendingInvitations { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: PullsListReviewCommentsForRepoParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -43460,31 +40358,22 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: PullsListReviewCommentsForRepoParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewCommentsForRepoData; + export type ResponseBody = OrgsListPendingInvitationsData; } /** - * @description The list of reviews returns in chronological order. - * @tags pulls - * @name PullsListReviews - * @summary List reviews for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @description Members of an organization can choose to have their membership publicized or not. + * @tags orgs + * @name OrgsListPublicMembers + * @summary List public organization members + * @request GET:/orgs/{org}/public_members */ - export namespace PullsListReviews { + export namespace OrgsListPublicMembers { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; }; export type RequestQuery = { /** @@ -43500,380 +40389,423 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewsData; + export type ResponseBody = OrgsListPublicMembersData; } /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. - * @tags pulls - * @name PullsMerge - * @summary Merge a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + * @tags orgs + * @name OrgsListSamlSsoAuthorizations + * @summary List SAML SSO authorizations for an organization + * @request GET:/orgs/{org}/credential-authorizations */ - export namespace PullsMerge { + export namespace OrgsListSamlSsoAuthorizations { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = PullsMergePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsMergeData; + export type ResponseBody = OrgsListSamlSsoAuthorizationsData; } /** * No description - * @tags pulls - * @name PullsRemoveRequestedReviewers - * @summary Remove requested reviewers from a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - export namespace PullsRemoveRequestedReviewers { + export namespace OrgsListWebhooks { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; }; - export type RequestQuery = {}; - export type RequestBody = PullsRemoveRequestedReviewersPayload; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsRemoveRequestedReviewersData; + export type ResponseBody = OrgsListWebhooksData; } /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. - * @tags pulls - * @name PullsRequestReviewers - * @summary Request reviewers for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @tags orgs + * @name OrgsPingWebhook + * @summary Ping an organization webhook + * @request POST:/orgs/{org}/hooks/{hook_id}/pings */ - export namespace PullsRequestReviewers { + export namespace OrgsPingWebhook { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + hookId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = PullsRequestReviewersPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsRequestReviewersData; + export type ResponseBody = OrgsPingWebhookData; } /** - * No description - * @tags pulls - * @name PullsSubmitReview - * @summary Submit a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + * @description 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. + * @tags orgs + * @name OrgsRemoveMember + * @summary Remove an organization member + * @request DELETE:/orgs/{org}/members/{username} */ - export namespace PullsSubmitReview { + export namespace OrgsRemoveMember { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsSubmitReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsSubmitReviewData; + export type ResponseBody = OrgsRemoveMemberData; } /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. - * @tags pulls - * @name PullsUpdate - * @summary Update a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} + * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + * @tags orgs + * @name OrgsRemoveMembershipForUser + * @summary Remove organization membership for a user + * @request DELETE:/orgs/{org}/memberships/{username} */ - export namespace PullsUpdate { + export namespace OrgsRemoveMembershipForUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateData; + export type ResponseBody = OrgsRemoveMembershipForUserData; } /** - * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. - * @tags pulls - * @name PullsUpdateBranch - * @summary Update a pull request branch - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch + * @description Removing a user from this list will remove them from all the organization's repositories. + * @tags orgs + * @name OrgsRemoveOutsideCollaborator + * @summary Remove outside collaborator from an organization + * @request DELETE:/orgs/{org}/outside_collaborators/{username} */ - export namespace PullsUpdateBranch { + export namespace OrgsRemoveOutsideCollaborator { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateBranchPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateBranchData; + export type ResponseBody = OrgsRemoveOutsideCollaboratorData; } /** - * @description Update the review summary comment with new text. - * @tags pulls - * @name PullsUpdateReview - * @summary Update a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * No description + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} */ - export namespace PullsUpdateReview { + export namespace OrgsRemovePublicMembershipForAuthenticatedUser { export type RequestParams = { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateReviewData; + export type ResponseBody = + OrgsRemovePublicMembershipForAuthenticatedUserData; } /** - * @description Enables you to edit a review comment. - * @tags pulls - * @name PullsUpdateReviewComment - * @summary Update a review comment for a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. + * @tags orgs + * @name OrgsRemoveSamlSsoAuthorization + * @summary Remove a SAML SSO authorization for an organization + * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} */ - export namespace PullsUpdateReviewComment { + export namespace OrgsRemoveSamlSsoAuthorization { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + credentialId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateReviewCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateReviewCommentData; + export type ResponseBody = OrgsRemoveSamlSsoAuthorizationData; } /** - * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. - * @tags reactions - * @name ReactionsCreateForCommitComment - * @summary Create reaction for a commit comment - * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + * @tags orgs + * @name OrgsSetMembershipForUser + * @summary Set organization membership for a user + * @request PUT:/orgs/{org}/memberships/{username} */ - export namespace ReactionsCreateForCommitComment { + export namespace OrgsSetMembershipForUser { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForCommitCommentPayload; + export type RequestBody = OrgsSetMembershipForUserPayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForCommitCommentData; + export type ResponseBody = OrgsSetMembershipForUserData; } /** - * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. - * @tags reactions - * @name ReactionsCreateForIssue - * @summary Create reaction for an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags orgs + * @name OrgsSetPublicMembershipForAuthenticatedUser + * @summary Set public organization membership for the authenticated user + * @request PUT:/orgs/{org}/public_members/{username} */ - export namespace ReactionsCreateForIssue { + export namespace OrgsSetPublicMembershipForAuthenticatedUser { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForIssuePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForIssueData; + export type ResponseBody = OrgsSetPublicMembershipForAuthenticatedUserData; } /** - * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. - * @tags reactions - * @name ReactionsCreateForIssueComment - * @summary Create reaction for an issue comment - * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * No description + * @tags orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - export namespace ReactionsCreateForIssueComment { + export namespace OrgsUnblockUser { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForIssueCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForIssueCommentData; + export type ResponseBody = OrgsUnblockUserData; } /** - * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. - * @tags reactions - * @name ReactionsCreateForPullRequestReviewComment - * @summary Create reaction for a pull request review comment - * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. + * @tags orgs + * @name OrgsUpdate + * @summary Update an organization + * @request PATCH:/orgs/{org} */ - export namespace ReactionsCreateForPullRequestReviewComment { + export namespace OrgsUpdate { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForPullRequestReviewCommentPayload; + export type RequestBody = OrgsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForPullRequestReviewCommentData; + export type ResponseBody = OrgsUpdateData; } /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). - * @tags reactions - * @name ReactionsDeleteForCommitComment - * @summary Delete a commit comment reaction - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." + * @tags orgs + * @name OrgsUpdateWebhook + * @summary Update an organization webhook + * @request PATCH:/orgs/{org}/hooks/{hook_id} */ - export namespace ReactionsDeleteForCommitComment { + export namespace OrgsUpdateWebhook { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; + hookId: number; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = OrgsUpdateWebhookPayload; + export type RequestHeaders = {}; + export type ResponseBody = OrgsUpdateWebhookData; + } + + /** + * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. + * @tags orgs + * @name OrgsUpdateWebhookConfigForOrg + * @summary Update a webhook configuration for an organization + * @request PATCH:/orgs/{org}/hooks/{hook_id}/config + */ + export namespace OrgsUpdateWebhookConfigForOrg { + export type RequestParams = { + hookId: number; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = OrgsUpdateWebhookConfigForOrgPayload; + export type RequestHeaders = {}; + export type ResponseBody = OrgsUpdateWebhookConfigForOrgData; + } + + /** + * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsCreateForOrg + * @summary Create an organization project + * @request POST:/orgs/{org}/projects + */ + export namespace ProjectsCreateForOrg { + export type RequestParams = { + org: string; }; export type RequestQuery = {}; + export type RequestBody = ProjectsCreateForOrgPayload; + export type RequestHeaders = {}; + export type ResponseBody = ProjectsCreateForOrgData; + } + + /** + * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsListForOrg + * @summary List organization projects + * @request GET:/orgs/{org}/projects + */ + export namespace ProjectsListForOrg { + export type RequestParams = { + org: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: ProjectsListForOrgParams1StateEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForCommitCommentData; + export type ResponseBody = ProjectsListForOrgData; } /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * @tags reactions - * @name ReactionsDeleteForIssue - * @summary Delete an issue reaction - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + * @name ReactionsCreateForTeamDiscussionCommentInOrg + * @summary Create reaction for a team discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - export namespace ReactionsDeleteForIssue { + export namespace ReactionsCreateForTeamDiscussionCommentInOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - reactionId: number; - repo: string; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + ReactionsCreateForTeamDiscussionCommentInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForIssueData; + export type ResponseBody = ReactionsCreateForTeamDiscussionCommentInOrgData; } /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * @tags reactions - * @name ReactionsDeleteForIssueComment - * @summary Delete an issue comment reaction - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + * @name ReactionsCreateForTeamDiscussionInOrg + * @summary Create reaction for a team discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - export namespace ReactionsDeleteForIssueComment { + export namespace ReactionsCreateForTeamDiscussionInOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReactionsCreateForTeamDiscussionInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForIssueCommentData; + export type ResponseBody = ReactionsCreateForTeamDiscussionInOrgData; } /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * @tags reactions - * @name ReactionsDeleteForPullRequestComment - * @summary Delete a pull request comment reaction - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + * @name ReactionsDeleteForTeamDiscussion + * @summary Delete team discussion reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} */ - export namespace ReactionsDeleteForPullRequestComment { + export namespace ReactionsDeleteForTeamDiscussion { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; + discussionNumber: number; + org: string; reactionId: number; - repo: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForPullRequestCommentData; + export type ResponseBody = ReactionsDeleteForTeamDiscussionData; } /** - * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * @tags reactions - * @name ReactionsListForCommitComment - * @summary List reactions for a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @name ReactionsDeleteForTeamDiscussionComment + * @summary Delete team discussion comment reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} */ - export namespace ReactionsListForCommitComment { + export namespace ReactionsDeleteForTeamDiscussionComment { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; - }; - export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ - content?: ReactionsListForCommitCommentParams1ContentEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + commentNumber: number; + discussionNumber: number; + org: string; + reactionId: number; + /** team_slug parameter */ + teamSlug: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForCommitCommentData; + export type ResponseBody = ReactionsDeleteForTeamDiscussionCommentData; } /** - * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * @tags reactions - * @name ReactionsListForIssue - * @summary List reactions for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @name ReactionsListForTeamDiscussionCommentInOrg + * @summary List reactions for a team discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - export namespace ReactionsListForIssue { + export namespace ReactionsListForTeamDiscussionCommentInOrg { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - owner: string; - repo: string; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ - content?: ReactionsListForIssueParams1ContentEnum; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: ReactionsListForTeamDiscussionCommentInOrgParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -43887,26 +40819,26 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForIssueData; + export type ResponseBody = ReactionsListForTeamDiscussionCommentInOrgData; } /** - * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * @tags reactions - * @name ReactionsListForIssueComment - * @summary List reactions for an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @name ReactionsListForTeamDiscussionInOrg + * @summary List reactions for a team discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - export namespace ReactionsListForIssueComment { + export namespace ReactionsListForTeamDiscussionInOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ - content?: ReactionsListForIssueCommentParams1ContentEnum; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: ReactionsListForTeamDiscussionInOrgParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -43920,26 +40852,40 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForIssueCommentData; + export type ResponseBody = ReactionsListForTeamDiscussionInOrgData; } /** - * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). - * @tags reactions - * @name ReactionsListForPullRequestReviewComment - * @summary List reactions for a pull request review comment - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @tags repos + * @name ReposCreateInOrg + * @summary Create an organization repository + * @request POST:/orgs/{org}/repos */ - export namespace ReactionsListForPullRequestReviewComment { + export namespace ReposCreateInOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposCreateInOrgPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposCreateInOrgData; + } + + /** + * @description Lists repositories for the specified organization. + * @tags repos + * @name ReposListForOrg + * @summary List organization repositories + * @request GET:/orgs/{org}/repos + */ + export namespace ReposListForOrg { + export type RequestParams = { + org: string; }; export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ - content?: ReactionsListForPullRequestReviewCommentParams1ContentEnum; + /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ + direction?: ReposListForOrgParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -43950,1081 +40896,1232 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "created" + */ + sort?: ReposListForOrgParams1SortEnum; + /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ + type?: ReposListForOrgParams1TypeEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForPullRequestReviewCommentData; - } - - /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposAddAppAccessRestrictions - * @summary Add app access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps - */ - export namespace ReposAddAppAccessRestrictions { - export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; - }; - export type RequestQuery = {}; - export type RequestBody = ReposAddAppAccessRestrictionsPayload; - export type RequestHeaders = {}; - export type ResponseBody = ReposAddAppAccessRestrictionsData; + export type ResponseBody = ReposListForOrgData; } /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. - * @tags repos - * @name ReposAddCollaborator - * @summary Add a repository collaborator - * @request PUT:/repos/{owner}/{repo}/collaborators/{username} + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserInOrg + * @summary Add or update team membership for a user + * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - export namespace ReposAddCollaborator { + export namespace TeamsAddOrUpdateMembershipForUserInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; username: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddCollaboratorPayload; + export type RequestBody = TeamsAddOrUpdateMembershipForUserInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAddCollaboratorData; + export type ResponseBody = TeamsAddOrUpdateMembershipForUserInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposAddStatusCheckContexts - * @summary Add status check contexts - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsInOrg + * @summary Add or update team project permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - export namespace ReposAddStatusCheckContexts { + export namespace TeamsAddOrUpdateProjectPermissionsInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddStatusCheckContextsPayload; + export type RequestBody = TeamsAddOrUpdateProjectPermissionsInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAddStatusCheckContextsData; + export type ResponseBody = TeamsAddOrUpdateProjectPermissionsInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposAddTeamAccessRestrictions - * @summary Add team access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsInOrg + * @summary Add or update team repository permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - export namespace ReposAddTeamAccessRestrictions { + export namespace TeamsAddOrUpdateRepoPermissionsInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; + org: string; owner: string; repo: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddTeamAccessRestrictionsPayload; + export type RequestBody = TeamsAddOrUpdateRepoPermissionsInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAddTeamAccessRestrictionsData; + export type ResponseBody = TeamsAddOrUpdateRepoPermissionsInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposAddUserAccessRestrictions - * @summary Add user access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @tags teams + * @name TeamsCheckPermissionsForProjectInOrg + * @summary Check team permissions for a project + * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - export namespace ReposAddUserAccessRestrictions { + export namespace TeamsCheckPermissionsForProjectInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddUserAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposAddUserAccessRestrictionsData; + export type ResponseBody = TeamsCheckPermissionsForProjectInOrgData; } /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. - * @tags repos - * @name ReposCheckCollaborator - * @summary Check if a user is a repository collaborator - * @request GET:/repos/{owner}/{repo}/collaborators/{username} + * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * @tags teams + * @name TeamsCheckPermissionsForRepoInOrg + * @summary Check team permissions for a repository + * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - export namespace ReposCheckCollaborator { + export namespace TeamsCheckPermissionsForRepoInOrg { export type RequestParams = { + org: string; owner: string; repo: string; - username: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCheckCollaboratorData; + export type ResponseBody = TeamsCheckPermissionsForRepoInOrgData; } /** - * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". - * @tags repos - * @name ReposCheckVulnerabilityAlerts - * @summary Check if vulnerability alerts are enabled for a repository - * @request GET:/repos/{owner}/{repo}/vulnerability-alerts + * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + * @tags teams + * @name TeamsCreate + * @summary Create a team + * @request POST:/orgs/{org}/teams */ - export namespace ReposCheckVulnerabilityAlerts { + export namespace TeamsCreate { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCheckVulnerabilityAlertsData; + export type ResponseBody = TeamsCreateData; } /** - * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags repos - * @name ReposCompareCommits - * @summary Compare two commits - * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} + * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * @tags teams + * @name TeamsCreateDiscussionCommentInOrg + * @summary Create a discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - export namespace ReposCompareCommits { + export namespace TeamsCreateDiscussionCommentInOrg { export type RequestParams = { - base: string; - head: string; - owner: string; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsCreateDiscussionCommentInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCompareCommitsData; + export type ResponseBody = TeamsCreateDiscussionCommentInOrgData; } /** - * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags repos - * @name ReposCreateCommitComment - * @summary Create a commit comment - * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. + * @tags teams + * @name TeamsCreateDiscussionInOrg + * @summary Create a discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions */ - export namespace ReposCreateCommitComment { + export namespace TeamsCreateDiscussionInOrg { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateCommitCommentPayload; + export type RequestBody = TeamsCreateDiscussionInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitCommentData; + export type ResponseBody = TeamsCreateDiscussionInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. - * @tags repos - * @name ReposCreateCommitSignatureProtection - * @summary Create commit signature protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg + * @summary Create or update IdP group connections + * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - export namespace ReposCreateCommitSignatureProtection { + export namespace TeamsCreateOrUpdateIdpGroupConnectionsInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitSignatureProtectionData; + export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsInOrgData; } /** - * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. - * @tags repos - * @name ReposCreateCommitStatus - * @summary Create a commit status - * @request POST:/repos/{owner}/{repo}/statuses/{sha} + * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @tags teams + * @name TeamsDeleteDiscussionCommentInOrg + * @summary Delete a discussion comment + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - export namespace ReposCreateCommitStatus { + export namespace TeamsDeleteDiscussionCommentInOrg { export type RequestParams = { - owner: string; - repo: string; - sha: string; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateCommitStatusPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitStatusData; + export type ResponseBody = TeamsDeleteDiscussionCommentInOrgData; } /** - * @description You can create a read-only deploy key. - * @tags repos - * @name ReposCreateDeployKey - * @summary Create a deploy key - * @request POST:/repos/{owner}/{repo}/keys + * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @tags teams + * @name TeamsDeleteDiscussionInOrg + * @summary Delete a discussion + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - export namespace ReposCreateDeployKey { + export namespace TeamsDeleteDiscussionInOrg { export type RequestParams = { - owner: string; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDeployKeyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDeployKeyData; + export type ResponseBody = TeamsDeleteDiscussionInOrgData; } /** - * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. - * @tags repos - * @name ReposCreateDeployment - * @summary Create a deployment - * @request POST:/repos/{owner}/{repo}/deployments + * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. + * @tags teams + * @name TeamsDeleteInOrg + * @summary Delete a team + * @request DELETE:/orgs/{org}/teams/{team_slug} */ - export namespace ReposCreateDeployment { + export namespace TeamsDeleteInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDeploymentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDeploymentData; + export type ResponseBody = TeamsDeleteInOrgData; } /** - * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. - * @tags repos - * @name ReposCreateDeploymentStatus - * @summary Create a deployment status - * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. + * @tags teams + * @name TeamsGetByName + * @summary Get a team by name + * @request GET:/orgs/{org}/teams/{team_slug} */ - export namespace ReposCreateDeploymentStatus { + export namespace TeamsGetByName { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDeploymentStatusPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDeploymentStatusData; + export type ResponseBody = TeamsGetByNameData; } /** - * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. - * @tags repos - * @name ReposCreateDispatchEvent - * @summary Create a repository dispatch event - * @request POST:/repos/{owner}/{repo}/dispatches + * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @tags teams + * @name TeamsGetDiscussionCommentInOrg + * @summary Get a discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - export namespace ReposCreateDispatchEvent { + export namespace TeamsGetDiscussionCommentInOrg { export type RequestParams = { - owner: string; - repo: string; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDispatchEventPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDispatchEventData; + export type ResponseBody = TeamsGetDiscussionCommentInOrgData; } /** - * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). - * @tags repos - * @name ReposCreateFork - * @summary Create a fork - * @request POST:/repos/{owner}/{repo}/forks + * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @tags teams + * @name TeamsGetDiscussionInOrg + * @summary Get a discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - export namespace ReposCreateFork { + export namespace TeamsGetDiscussionInOrg { export type RequestParams = { - owner: string; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateForkPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateForkData; + export type ResponseBody = TeamsGetDiscussionInOrgData; } /** - * @description Creates a new file or replaces an existing file in a repository. - * @tags repos - * @name ReposCreateOrUpdateFileContents - * @summary Create or update file contents - * @request PUT:/repos/{owner}/{repo}/contents/{path} + * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @tags teams + * @name TeamsGetMembershipForUserInOrg + * @summary Get team membership for a user + * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - export namespace ReposCreateOrUpdateFileContents { + export namespace TeamsGetMembershipForUserInOrg { export type RequestParams = { - owner: string; - /** path+ parameter */ - path: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateOrUpdateFileContentsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateOrUpdateFileContentsData; + export type ResponseBody = TeamsGetMembershipForUserInOrgData; } /** - * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." - * @tags repos - * @name ReposCreatePagesSite - * @summary Create a GitHub Pages site - * @request POST:/repos/{owner}/{repo}/pages + * @description Lists all teams in an organization that are visible to the authenticated user. + * @tags teams + * @name TeamsList + * @summary List teams + * @request GET:/orgs/{org}/teams */ - export namespace ReposCreatePagesSite { + export namespace TeamsList { export type RequestParams = { - owner: string; - repo: string; + org: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreatePagesSitePayload; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreatePagesSiteData; + export type ResponseBody = TeamsListData; } /** - * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags repos - * @name ReposCreateRelease - * @summary Create a release - * @request POST:/repos/{owner}/{repo}/releases + * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. + * @tags teams + * @name TeamsListChildInOrg + * @summary List child teams + * @request GET:/orgs/{org}/teams/{team_slug}/teams */ - export namespace ReposCreateRelease { + export namespace TeamsListChildInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateReleasePayload; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateReleaseData; + export type ResponseBody = TeamsListChildInOrgData; } /** - * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository - * @tags repos - * @name ReposCreateUsingTemplate - * @summary Create a repository using a template - * @request POST:/repos/{template_owner}/{template_repo}/generate + * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * @tags teams + * @name TeamsListDiscussionCommentsInOrg + * @summary List discussion comments + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - export namespace ReposCreateUsingTemplate { + export namespace TeamsListDiscussionCommentsInOrg { export type RequestParams = { - templateOwner: string; - templateRepo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateUsingTemplatePayload; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: TeamsListDiscussionCommentsInOrgParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateUsingTemplateData; + export type ResponseBody = TeamsListDiscussionCommentsInOrgData; } /** - * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. - * @tags repos - * @name ReposCreateWebhook - * @summary Create a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks + * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. + * @tags teams + * @name TeamsListDiscussionsInOrg + * @summary List discussions + * @request GET:/orgs/{org}/teams/{team_slug}/discussions */ - export namespace ReposCreateWebhook { + export namespace TeamsListDiscussionsInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateWebhookPayload; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: TeamsListDiscussionsInOrgParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateWebhookData; + export type ResponseBody = TeamsListDiscussionsInOrgData; } /** - * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. - * @tags repos - * @name ReposDelete - * @summary Delete a repository - * @request DELETE:/repos/{owner}/{repo} + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: + * @tags teams + * @name TeamsListIdpGroupsForOrg + * @summary List IdP groups for an organization + * @request GET:/orgs/{org}/team-sync/groups */ - export namespace ReposDelete { + export namespace TeamsListIdpGroupsForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteData; + export type ResponseBody = TeamsListIdpGroupsForOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. - * @tags repos - * @name ReposDeleteAccessRestrictions - * @summary Delete access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @tags teams + * @name TeamsListIdpGroupsInOrg + * @summary List IdP groups for a team + * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - export namespace ReposDeleteAccessRestrictions { + export namespace TeamsListIdpGroupsInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteAccessRestrictionsData; + export type ResponseBody = TeamsListIdpGroupsInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. - * @tags repos - * @name ReposDeleteAdminBranchProtection - * @summary Delete admin branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. + * @tags teams + * @name TeamsListMembersInOrg + * @summary List team members + * @request GET:/orgs/{org}/teams/{team_slug}/members */ - export namespace ReposDeleteAdminBranchProtection { + export namespace TeamsListMembersInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ + role?: TeamsListMembersInOrgParams1RoleEnum; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteAdminBranchProtectionData; + export type ResponseBody = TeamsListMembersInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposDeleteBranchProtection - * @summary Delete branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. + * @tags teams + * @name TeamsListPendingInvitationsInOrg + * @summary List pending team invitations + * @request GET:/orgs/{org}/teams/{team_slug}/invitations */ - export namespace ReposDeleteBranchProtection { + export namespace TeamsListPendingInvitationsInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteBranchProtectionData; + export type ResponseBody = TeamsListPendingInvitationsInOrgData; } /** - * No description - * @tags repos - * @name ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. + * @tags teams + * @name TeamsListProjectsInOrg + * @summary List team projects + * @request GET:/orgs/{org}/teams/{team_slug}/projects */ - export namespace ReposDeleteCommitComment { + export namespace TeamsListProjectsInOrg { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteCommitCommentData; + export type ResponseBody = TeamsListProjectsInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. - * @tags repos - * @name ReposDeleteCommitSignatureProtection - * @summary Delete commit signature protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. + * @tags teams + * @name TeamsListReposInOrg + * @summary List team repositories + * @request GET:/orgs/{org}/teams/{team_slug}/repos */ - export namespace ReposDeleteCommitSignatureProtection { + export namespace TeamsListReposInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteCommitSignatureProtectionData; + export type ResponseBody = TeamsListReposInOrgData; } /** - * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. - * @tags repos - * @name ReposDeleteDeployKey - * @summary Delete a deploy key - * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. + * @tags teams + * @name TeamsRemoveMembershipForUserInOrg + * @summary Remove team membership for a user + * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - export namespace ReposDeleteDeployKey { + export namespace TeamsRemoveMembershipForUserInOrg { export type RequestParams = { - /** key_id parameter */ - keyId: number; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteDeployKeyData; + export type ResponseBody = TeamsRemoveMembershipForUserInOrgData; } /** - * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." - * @tags repos - * @name ReposDeleteDeployment - * @summary Delete a deployment - * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @tags teams + * @name TeamsRemoveProjectInOrg + * @summary Remove a project from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - export namespace ReposDeleteDeployment { + export namespace TeamsRemoveProjectInOrg { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteDeploymentData; + export type ResponseBody = TeamsRemoveProjectInOrgData; } /** - * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. - * @tags repos - * @name ReposDeleteFile - * @summary Delete a file - * @request DELETE:/repos/{owner}/{repo}/contents/{path} + * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * @tags teams + * @name TeamsRemoveRepoInOrg + * @summary Remove a repository from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - export namespace ReposDeleteFile { + export namespace TeamsRemoveRepoInOrg { export type RequestParams = { + org: string; owner: string; - /** path+ parameter */ - path: string; repo: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ReposDeleteFilePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteFileData; + export type ResponseBody = TeamsRemoveRepoInOrgData; } /** - * No description - * @tags repos - * @name ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @tags teams + * @name TeamsUpdateDiscussionCommentInOrg + * @summary Update a discussion comment + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - export namespace ReposDeleteInvitation { + export namespace TeamsUpdateDiscussionCommentInOrg { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; - owner: string; - repo: string; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsUpdateDiscussionCommentInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteInvitationData; + export type ResponseBody = TeamsUpdateDiscussionCommentInOrgData; } /** - * No description - * @tags repos - * @name ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @tags teams + * @name TeamsUpdateDiscussionInOrg + * @summary Update a discussion + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - export namespace ReposDeletePagesSite { + export namespace TeamsUpdateDiscussionInOrg { export type RequestParams = { - owner: string; - repo: string; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsUpdateDiscussionInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeletePagesSiteData; + export type ResponseBody = TeamsUpdateDiscussionInOrgData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposDeletePullRequestReviewProtection - * @summary Delete pull request review protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. + * @tags teams + * @name TeamsUpdateInOrg + * @summary Update a team + * @request PATCH:/orgs/{org}/teams/{team_slug} */ - export namespace ReposDeletePullRequestReviewProtection { + export namespace TeamsUpdateInOrg { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsUpdateInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeletePullRequestReviewProtectionData; + export type ResponseBody = TeamsUpdateInOrgData; } +} +export namespace Projects { /** - * @description Users with push access to the repository can delete a release. - * @tags repos - * @name ReposDeleteRelease - * @summary Delete a release - * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} + * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. + * @tags projects + * @name ProjectsAddCollaborator + * @summary Add project collaborator + * @request PUT:/projects/{project_id}/collaborators/{username} */ - export namespace ReposDeleteRelease { + export namespace ProjectsAddCollaborator { export type RequestParams = { - owner: string; - /** release_id parameter */ - releaseId: number; - repo: string; + projectId: number; + username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsAddCollaboratorPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteReleaseData; + export type ResponseBody = ProjectsAddCollaboratorData; } /** - * No description - * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags projects + * @name ProjectsCreateCard + * @summary Create a project card + * @request POST:/projects/columns/{column_id}/cards */ - export namespace ReposDeleteReleaseAsset { + export namespace ProjectsCreateCard { export type RequestParams = { - /** asset_id parameter */ - assetId: number; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsCreateCardPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteReleaseAssetData; + export type ResponseBody = ProjectsCreateCardData; } /** * No description - * @tags repos - * @name ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - export namespace ReposDeleteWebhook { + export namespace ProjectsCreateColumn { export type RequestParams = { - hookId: number; - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsCreateColumnPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteWebhookData; + export type ResponseBody = ProjectsCreateColumnData; } /** - * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". - * @tags repos - * @name ReposDisableAutomatedSecurityFixes - * @summary Disable automated security fixes - * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. + * @tags projects + * @name ProjectsDelete + * @summary Delete a project + * @request DELETE:/projects/{project_id} */ - export namespace ReposDisableAutomatedSecurityFixes { + export namespace ProjectsDelete { export type RequestParams = { - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDisableAutomatedSecurityFixesData; + export type ResponseBody = ProjectsDeleteData; } /** - * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". - * @tags repos - * @name ReposDisableVulnerabilityAlerts - * @summary Disable vulnerability alerts - * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts + * No description + * @tags projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - export namespace ReposDisableVulnerabilityAlerts { + export namespace ProjectsDeleteCard { export type RequestParams = { - owner: string; - repo: string; + /** card_id parameter */ + cardId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDisableVulnerabilityAlertsData; + export type ResponseBody = ProjectsDeleteCardData; } /** - * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. - * @tags repos - * @name ReposDownloadTarballArchive - * @summary Download a repository archive (tar) - * @request GET:/repos/{owner}/{repo}/tarball/{ref} + * No description + * @tags projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - export namespace ReposDownloadTarballArchive { + export namespace ProjectsDeleteColumn { export type RequestParams = { - owner: string; - ref: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = ProjectsDeleteColumnData; } /** - * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. - * @tags repos - * @name ReposDownloadZipballArchive - * @summary Download a repository archive (zip) - * @request GET:/repos/{owner}/{repo}/zipball/{ref} + * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsGet + * @summary Get a project + * @request GET:/projects/{project_id} */ - export namespace ReposDownloadZipballArchive { + export namespace ProjectsGet { export type RequestParams = { - owner: string; - ref: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = ProjectsGetData; } /** - * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". - * @tags repos - * @name ReposEnableAutomatedSecurityFixes - * @summary Enable automated security fixes - * @request PUT:/repos/{owner}/{repo}/automated-security-fixes + * No description + * @tags projects + * @name ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - export namespace ReposEnableAutomatedSecurityFixes { + export namespace ProjectsGetCard { export type RequestParams = { - owner: string; - repo: string; + /** card_id parameter */ + cardId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposEnableAutomatedSecurityFixesData; + export type ResponseBody = ProjectsGetCardData; } /** - * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". - * @tags repos - * @name ReposEnableVulnerabilityAlerts - * @summary Enable vulnerability alerts - * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts + * No description + * @tags projects + * @name ProjectsGetColumn + * @summary Get a project column + * @request GET:/projects/columns/{column_id} */ - export namespace ReposEnableVulnerabilityAlerts { + export namespace ProjectsGetColumn { export type RequestParams = { - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposEnableVulnerabilityAlertsData; + export type ResponseBody = ProjectsGetColumnData; } /** - * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. - * @tags repos - * @name ReposGet - * @summary Get a repository - * @request GET:/repos/{owner}/{repo} + * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. + * @tags projects + * @name ProjectsGetPermissionForUser + * @summary Get project permission for a user + * @request GET:/projects/{project_id}/collaborators/{username}/permission */ - export namespace ReposGet { + export namespace ProjectsGetPermissionForUser { export type RequestParams = { - owner: string; - repo: string; + projectId: number; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetData; + export type ResponseBody = ProjectsGetPermissionForUserData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. - * @tags repos - * @name ReposGetAccessRestrictions - * @summary Get access restrictions - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * No description + * @tags projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - export namespace ReposGetAccessRestrictions { + export namespace ProjectsListCards { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; + }; + export type RequestQuery = { + /** + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" + */ + archived_state?: ProjectsListCardsParams1ArchivedStateEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAccessRestrictionsData; + export type ResponseBody = ProjectsListCardsData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposGetAdminBranchProtection - * @summary Get admin branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. + * @tags projects + * @name ProjectsListCollaborators + * @summary List project collaborators + * @request GET:/projects/{project_id}/collaborators */ - export namespace ReposGetAdminBranchProtection { + export namespace ProjectsListCollaborators { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + projectId: number; + }; + export type RequestQuery = { + /** + * Filters the collaborators by their affiliation. Can be one of: + * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. + * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ + affiliation?: ProjectsListCollaboratorsParams1AffiliationEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAdminBranchProtectionData; + export type ResponseBody = ProjectsListCollaboratorsData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposGetAllStatusCheckContexts - * @summary Get all status check contexts - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * No description + * @tags projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - export namespace ReposGetAllStatusCheckContexts { + export namespace ProjectsListColumns { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + projectId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAllStatusCheckContextsData; + export type ResponseBody = ProjectsListColumnsData; } /** * No description - * @tags repos - * @name ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @tags projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - export namespace ReposGetAllTopics { + export namespace ProjectsMoveCard { export type RequestParams = { - owner: string; - repo: string; + /** card_id parameter */ + cardId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsMoveCardPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAllTopicsData; + export type ResponseBody = ProjectsMoveCardData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. - * @tags repos - * @name ReposGetAppsWithAccessToProtectedBranch - * @summary Get apps with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * No description + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - export namespace ReposGetAppsWithAccessToProtectedBranch { + export namespace ProjectsMoveColumn { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsMoveColumnPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAppsWithAccessToProtectedBranchData; + export type ResponseBody = ProjectsMoveColumnData; } /** - * No description - * @tags repos - * @name ReposGetBranch - * @summary Get a branch - * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. + * @tags projects + * @name ProjectsRemoveCollaborator + * @summary Remove user as a collaborator + * @request DELETE:/projects/{project_id}/collaborators/{username} */ - export namespace ReposGetBranch { + export namespace ProjectsRemoveCollaborator { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + projectId: number; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetBranchData; + export type ResponseBody = ProjectsRemoveCollaboratorData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposGetBranchProtection - * @summary Get branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection + * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsUpdate + * @summary Update a project + * @request PATCH:/projects/{project_id} */ - export namespace ReposGetBranchProtection { + export namespace ProjectsUpdate { export type RequestParams = { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetBranchProtectionData; + export type ResponseBody = ProjectsUpdateData; } /** - * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. - * @tags repos - * @name ReposGetClones - * @summary Get repository clones - * @request GET:/repos/{owner}/{repo}/traffic/clones + * No description + * @tags projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - export namespace ReposGetClones { + export namespace ProjectsUpdateCard { export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = { - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: ReposGetClonesParams1PerEnum; + /** card_id parameter */ + cardId: number; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ProjectsUpdateCardPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetClonesData; + export type ResponseBody = ProjectsUpdateCardData; } /** - * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. - * @tags repos - * @name ReposGetCodeFrequencyStats - * @summary Get the weekly commit activity - * @request GET:/repos/{owner}/{repo}/stats/code_frequency + * No description + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - export namespace ReposGetCodeFrequencyStats { + export namespace ProjectsUpdateColumn { export type RequestParams = { - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; + export type RequestBody = ProjectsUpdateColumnPayload; + export type RequestHeaders = {}; + export type ResponseBody = ProjectsUpdateColumnData; + } +} + +export namespace RateLimit { + /** + * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. + * @tags rate-limit + * @name RateLimitGet + * @summary Get rate limit status for the authenticated user + * @request GET:/rate_limit + */ + export namespace RateLimitGet { + export type RequestParams = {}; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCodeFrequencyStatsData; + export type ResponseBody = RateLimitGetData; } +} +export namespace Reactions { /** - * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. - * @tags repos - * @name ReposGetCollaboratorPermissionLevel - * @summary Get repository permissions for a user - * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + * @tags reactions + * @name ReactionsDeleteLegacy + * @summary Delete a reaction (Legacy) + * @request DELETE:/reactions/{reaction_id} + * @deprecated */ - export namespace ReposGetCollaboratorPermissionLevel { + export namespace ReactionsDeleteLegacy { export type RequestParams = { - owner: string; - repo: string; - username: string; + reactionId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCollaboratorPermissionLevelData; + export type ResponseBody = ReactionsDeleteLegacyData; } +} +export namespace Repos { /** - * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` - * @tags repos - * @name ReposGetCombinedStatusForRef - * @summary Get the combined status for a specific reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsCancelWorkflowRun + * @summary Cancel a workflow run + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel */ - export namespace ReposGetCombinedStatusForRef { + export namespace ActionsCancelWorkflowRun { export type RequestParams = { owner: string; - /** ref+ parameter */ - ref: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCombinedStatusForRefData; + export type ResponseBody = ActionsCancelWorkflowRunData; } /** - * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags repos - * @name ReposGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/commits/{ref} + * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` + * @tags actions + * @name ActionsCreateOrUpdateRepoSecret + * @summary Create or update a repository secret + * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - export namespace ReposGetCommit { + export namespace ActionsCreateOrUpdateRepoSecret { export type RequestParams = { owner: string; - /** ref+ parameter */ - ref: string; repo: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActionsCreateOrUpdateRepoSecretPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitData; + export type ResponseBody = ActionsCreateOrUpdateRepoSecretData; } /** - * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. - * @tags repos - * @name ReposGetCommitActivityStats - * @summary Get the last year of commit activity - * @request GET:/repos/{owner}/{repo}/stats/commit_activity + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` + * @tags actions + * @name ActionsCreateRegistrationTokenForRepo + * @summary Create a registration token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token */ - export namespace ReposGetCommitActivityStats { + export namespace ActionsCreateRegistrationTokenForRepo { export type RequestParams = { owner: string; repo: string; @@ -45032,250 +42129,253 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitActivityStatsData; + export type ResponseBody = ActionsCreateRegistrationTokenForRepoData; } /** - * No description - * @tags repos - * @name ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @tags actions + * @name ActionsCreateRemoveTokenForRepo + * @summary Create a remove token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token */ - export namespace ReposGetCommitComment { + export namespace ActionsCreateRemoveTokenForRepo { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitCommentData; + export type ResponseBody = ActionsCreateRemoveTokenForRepoData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. - * @tags repos - * @name ReposGetCommitSignatureProtection - * @summary Get commit signature protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + * @tags actions + * @name ActionsCreateWorkflowDispatch + * @summary Create a workflow dispatch event + * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches */ - export namespace ReposGetCommitSignatureProtection { + export namespace ActionsCreateWorkflowDispatch { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActionsCreateWorkflowDispatchPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitSignatureProtectionData; + export type ResponseBody = ActionsCreateWorkflowDispatchData; } /** - * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. - * @tags repos - * @name ReposGetCommunityProfileMetrics - * @summary Get community profile metrics - * @request GET:/repos/{owner}/{repo}/community/profile + * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsDeleteArtifact + * @summary Delete an artifact + * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - export namespace ReposGetCommunityProfileMetrics { + export namespace ActionsDeleteArtifact { export type RequestParams = { + /** artifact_id parameter */ + artifactId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommunityProfileMetricsData; + export type ResponseBody = ActionsDeleteArtifactData; } /** - * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. - * @tags repos - * @name ReposGetContent - * @summary Get repository content - * @request GET:/repos/{owner}/{repo}/contents/{path} + * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @tags actions + * @name ActionsDeleteRepoSecret + * @summary Delete a repository secret + * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - export namespace ReposGetContent { + export namespace ActionsDeleteRepoSecret { export type RequestParams = { owner: string; - /** path+ parameter */ - path: string; repo: string; + /** secret_name parameter */ + secretName: string; }; - export type RequestQuery = { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetContentData; + export type ResponseBody = ActionsDeleteRepoSecretData; } /** - * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits - * @tags repos - * @name ReposGetContributorsStats - * @summary Get all contributor commit activity - * @request GET:/repos/{owner}/{repo}/stats/contributors + * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromRepo + * @summary Delete a self-hosted runner from a repository + * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - export namespace ReposGetContributorsStats { + export namespace ActionsDeleteSelfHostedRunnerFromRepo { export type RequestParams = { owner: string; repo: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetContributorsStatsData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerFromRepoData; } /** - * No description - * @tags repos - * @name ReposGetDeployKey - * @summary Get a deploy key - * @request GET:/repos/{owner}/{repo}/keys/{key_id} + * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsDeleteWorkflowRun + * @summary Delete a workflow run + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} */ - export namespace ReposGetDeployKey { + export namespace ActionsDeleteWorkflowRun { export type RequestParams = { - /** key_id parameter */ - keyId: number; owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetDeployKeyData; + export type ResponseBody = ActionsDeleteWorkflowRunData; } /** - * No description - * @tags repos - * @name ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsDeleteWorkflowRunLogs + * @summary Delete workflow run logs + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - export namespace ReposGetDeployment { + export namespace ActionsDeleteWorkflowRunLogs { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetDeploymentData; + export type ResponseBody = ActionsDeleteWorkflowRunLogsData; } /** - * @description Users with pull access can view a deployment status for a deployment: - * @tags repos - * @name ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsDisableWorkflow + * @summary Disable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable */ - export namespace ReposGetDeploymentStatus { + export namespace ActionsDisableWorkflow { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; owner: string; repo: string; - statusId: number; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetDeploymentStatusData; + export type ResponseBody = ActionsDisableWorkflowData; } /** - * No description - * @tags repos - * @name ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsDownloadArtifact + * @summary Download an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} */ - export namespace ReposGetLatestPagesBuild { + export namespace ActionsDownloadArtifact { export type RequestParams = { + archiveFormat: string; + /** artifact_id parameter */ + artifactId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetLatestPagesBuildData; + export type ResponseBody = any; } /** - * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. - * @tags repos - * @name ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest + * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsDownloadJobLogsForWorkflowRun + * @summary Download job logs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs */ - export namespace ReposGetLatestRelease { + export namespace ActionsDownloadJobLogsForWorkflowRun { export type RequestParams = { + /** job_id parameter */ + jobId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetLatestReleaseData; + export type ResponseBody = any; } /** - * No description - * @tags repos - * @name ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages + * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsDownloadWorkflowRunLogs + * @summary Download workflow run logs + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - export namespace ReposGetPages { + export namespace ActionsDownloadWorkflowRunLogs { export type RequestParams = { owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPagesData; + export type ResponseBody = any; } /** - * No description - * @tags repos - * @name ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} + * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsEnableWorkflow + * @summary Enable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable */ - export namespace ReposGetPagesBuild { + export namespace ActionsEnableWorkflow { export type RequestParams = { - buildId: number; owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPagesBuildData; + export type ResponseBody = ActionsEnableWorkflowData; } /** - * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. - * @tags repos - * @name ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @tags actions + * @name ActionsGetAllowedActionsRepository + * @summary Get allowed actions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - export namespace ReposGetParticipationStats { + export namespace ActionsGetAllowedActionsRepository { export type RequestParams = { owner: string; repo: string; @@ -45283,37 +42383,37 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetParticipationStatsData; + export type ResponseBody = ActionsGetAllowedActionsRepositoryData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposGetPullRequestReviewProtection - * @summary Get pull request review protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetArtifact + * @summary Get an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - export namespace ReposGetPullRequestReviewProtection { + export namespace ActionsGetArtifact { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** artifact_id parameter */ + artifactId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPullRequestReviewProtectionData; + export type ResponseBody = ActionsGetArtifactData; } /** - * @description 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. - * @tags repos - * @name ReposGetPunchCardStats - * @summary Get the hourly commit count for each day - * @request GET:/repos/{owner}/{repo}/stats/punch_card + * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @tags actions + * @name ActionsGetGithubActionsPermissionsRepository + * @summary Get GitHub Actions permissions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions */ - export namespace ReposGetPunchCardStats { + export namespace ActionsGetGithubActionsPermissionsRepository { export type RequestParams = { owner: string; repo: string; @@ -45321,256 +42421,268 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPunchCardStatsData; + export type ResponseBody = ActionsGetGithubActionsPermissionsRepositoryData; } /** - * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. - * @tags repos - * @name ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetJobForWorkflowRun + * @summary Get a job for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} */ - export namespace ReposGetReadme { + export namespace ActionsGetJobForWorkflowRun { export type RequestParams = { + /** job_id parameter */ + jobId: number; owner: string; repo: string; }; - export type RequestQuery = { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReadmeData; + export type ResponseBody = ActionsGetJobForWorkflowRunData; } /** - * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). - * @tags repos - * @name ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @tags actions + * @name ActionsGetRepoPublicKey + * @summary Get a repository public key + * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key */ - export namespace ReposGetRelease { + export namespace ActionsGetRepoPublicKey { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseData; + export type ResponseBody = ActionsGetRepoPublicKeyData; } /** - * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. - * @tags repos - * @name ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @tags actions + * @name ActionsGetRepoSecret + * @summary Get a repository secret + * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - export namespace ReposGetReleaseAsset { + export namespace ActionsGetRepoSecret { export type RequestParams = { - /** asset_id parameter */ - assetId: number; owner: string; repo: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseAssetData; + export type ResponseBody = ActionsGetRepoSecretData; } /** - * @description Get a published release with the specified tag. - * @tags repos - * @name ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @tags actions + * @name ActionsGetSelfHostedRunnerForRepo + * @summary Get a self-hosted runner for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - export namespace ReposGetReleaseByTag { + export namespace ActionsGetSelfHostedRunnerForRepo { export type RequestParams = { owner: string; repo: string; - /** tag+ parameter */ - tag: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseByTagData; + export type ResponseBody = ActionsGetSelfHostedRunnerForRepoData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetWorkflow + * @summary Get a workflow + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} */ - export namespace ReposGetStatusChecksProtection { + export namespace ActionsGetWorkflow { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetStatusChecksProtectionData; + export type ResponseBody = ActionsGetWorkflowData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. - * @tags repos - * @name ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetWorkflowRun + * @summary Get a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} */ - export namespace ReposGetTeamsWithAccessToProtectedBranch { + export namespace ActionsGetWorkflowRun { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTeamsWithAccessToProtectedBranchData; + export type ResponseBody = ActionsGetWorkflowRunData; } /** - * @description Get the top 10 popular contents over the last 14 days. - * @tags repos - * @name ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetWorkflowRunUsage + * @summary Get workflow run usage + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing */ - export namespace ReposGetTopPaths { + export namespace ActionsGetWorkflowRunUsage { export type RequestParams = { owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTopPathsData; + export type ResponseBody = ActionsGetWorkflowRunUsageData; } /** - * @description Get the top 10 referrers over the last 14 days. - * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsGetWorkflowUsage + * @summary Get workflow usage + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing */ - export namespace ReposGetTopReferrers { + export namespace ActionsGetWorkflowUsage { export type RequestParams = { owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTopReferrersData; + export type ResponseBody = ActionsGetWorkflowUsageData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. - * @tags repos - * @name ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsListArtifactsForRepo + * @summary List artifacts for a repository + * @request GET:/repos/{owner}/{repo}/actions/artifacts */ - export namespace ReposGetUsersWithAccessToProtectedBranch { + export namespace ActionsListArtifactsForRepo { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; - export type RequestQuery = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetUsersWithAccessToProtectedBranchData; + export type ResponseBody = ActionsListArtifactsForRepoData; } /** - * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. - * @tags repos - * @name ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * @tags actions + * @name ActionsListJobsForWorkflowRun + * @summary List jobs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs */ - export namespace ReposGetViews { + export namespace ActionsListJobsForWorkflowRun { export type RequestParams = { owner: string; repo: string; + runId: number; }; export type RequestQuery = { /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * Filters jobs by their \`completed_at\` timestamp. Can be one of: + * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. + * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. + * @default "latest" */ - per?: ReposGetViewsParams1PerEnum; + filter?: ActionsListJobsForWorkflowRunParams1FilterEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetViewsData; + export type ResponseBody = ActionsListJobsForWorkflowRunData; } /** - * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." - * @tags repos - * @name ReposGetWebhook - * @summary Get a repository webhook - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @tags actions + * @name ActionsListRepoSecrets + * @summary List repository secrets + * @request GET:/repos/{owner}/{repo}/actions/secrets */ - export namespace ReposGetWebhook { + export namespace ActionsListRepoSecrets { export type RequestParams = { - hookId: number; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReposGetWebhookData; - } - - /** - * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. - * @tags repos - * @name ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config - */ - export namespace ReposGetWebhookConfigForRepo { - export type RequestParams = { - hookId: number; - owner: string; - repo: string; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetWebhookConfigForRepoData; + export type ResponseBody = ActionsListRepoSecretsData; } /** - * No description - * @tags repos - * @name ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches + * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsListRepoWorkflows + * @summary List repository workflows + * @request GET:/repos/{owner}/{repo}/actions/workflows */ - export namespace ReposListBranches { + export namespace ActionsListRepoWorkflows { export type RequestParams = { owner: string; repo: string; @@ -45586,55 +42698,43 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ - protected?: boolean; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListBranchesData; + export type ResponseBody = ActionsListRepoWorkflowsData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. - * @tags repos - * @name ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @tags actions + * @name ActionsListRunnerApplicationsForRepo + * @summary List runner applications for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/downloads */ - export namespace ReposListBranchesForHeadCommit { + export namespace ActionsListRunnerApplicationsForRepo { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListBranchesForHeadCommitData; + export type ResponseBody = ActionsListRunnerApplicationsForRepoData; } /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. - * @tags repos - * @name ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @tags actions + * @name ActionsListSelfHostedRunnersForRepo + * @summary List self-hosted runners for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners */ - export namespace ReposListCollaborators { + export namespace ActionsListSelfHostedRunnersForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = { - /** - * Filter collaborators returned by their affiliation. Can be one of: - * \\* \`outside\`: All outside collaborators of an organization-owned repository. - * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: ReposListCollaboratorsParams1AffiliationEnum; /** * Page number of the results to fetch. * @default 1 @@ -45648,22 +42748,21 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCollaboratorsData; + export type ResponseBody = ActionsListSelfHostedRunnersForRepoData; } /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. - * @tags repos - * @name ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsListWorkflowRunArtifacts + * @summary List workflow run artifacts + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts */ - export namespace ReposListCommentsForCommit { + export namespace ActionsListWorkflowRunArtifacts { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; owner: string; repo: string; + runId: number; }; export type RequestQuery = { /** @@ -45679,22 +42778,30 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCommentsForCommitData; + export type ResponseBody = ActionsListWorkflowRunArtifactsData; } /** - * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. - * @tags repos - * @name ReposListCommitCommentsForRepo - * @summary List commit comments for a repository - * @request GET:/repos/{owner}/{repo}/comments + * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. + * @tags actions + * @name ActionsListWorkflowRuns + * @summary List workflow runs + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs */ - export namespace ReposListCommitCommentsForRepo { + export namespace ActionsListWorkflowRuns { export type RequestParams = { owner: string; repo: string; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflowId: number | string; }; export type RequestQuery = { + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; /** * Page number of the results to fetch. * @default 1 @@ -45705,121 +42812,151 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: ActionsListWorkflowRunsParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCommitCommentsForRepoData; + export type ResponseBody = ActionsListWorkflowRunsData; } /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | - * @tags repos - * @name ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @tags actions + * @name ActionsListWorkflowRunsForRepo + * @summary List workflow runs for a repository + * @request GET:/repos/{owner}/{repo}/actions/runs */ - export namespace ReposListCommits { + export namespace ActionsListWorkflowRunsForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = { - /** GitHub login or email address by which to filter by commit author. */ - author?: string; + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; - /** Only commits containing this file path will be returned. */ - path?: string; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ - sha?: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - until?: string; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: ActionsListWorkflowRunsForRepoParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCommitsData; + export type ResponseBody = ActionsListWorkflowRunsForRepoData; } /** - * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. - * @tags repos - * @name ReposListCommitStatusesForRef - * @summary List commit statuses for a reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @tags actions + * @name ActionsReRunWorkflow + * @summary Re-run a workflow + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun */ - export namespace ReposListCommitStatusesForRef { + export namespace ActionsReRunWorkflow { export type RequestParams = { owner: string; - /** ref+ parameter */ - ref: string; repo: string; + runId: number; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCommitStatusesForRefData; + export type ResponseBody = ActionsReRunWorkflowData; } /** - * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. - * @tags repos - * @name ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @tags actions + * @name ActionsSetAllowedActionsRepository + * @summary Set allowed actions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - export namespace ReposListContributors { + export namespace ActionsSetAllowedActionsRepository { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = { - /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ - anon?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export type RequestQuery = {}; + export type RequestBody = SelectedActions; + export type RequestHeaders = {}; + export type ResponseBody = ActionsSetAllowedActionsRepositoryData; + } + + /** + * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @tags actions + * @name ActionsSetGithubActionsPermissionsRepository + * @summary Set GitHub Actions permissions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions + */ + export namespace ActionsSetGithubActionsPermissionsRepository { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = + ActionsSetGithubActionsPermissionsRepositoryPayload; + export type RequestHeaders = {}; + export type ResponseBody = ActionsSetGithubActionsPermissionsRepositoryData; + } + + /** + * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). + * @tags activity + * @name ActivityDeleteRepoSubscription + * @summary Delete a repository subscription + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + export namespace ActivityDeleteRepoSubscription { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListContributorsData; + export type ResponseBody = ActivityDeleteRepoSubscriptionData; } /** * No description - * @tags repos - * @name ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @tags activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription */ - export namespace ReposListDeployKeys { + export namespace ActivityGetRepoSubscription { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityGetRepoSubscriptionData; + } + + /** + * No description + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events + */ + export namespace ActivityListRepoEvents { export type RequestParams = { owner: string; repo: string; @@ -45838,69 +42975,62 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeployKeysData; + export type ResponseBody = ActivityListRepoEventsData; } /** - * @description Simple filtering of deployments is available via query parameters: - * @tags repos - * @name ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @description List all notifications for the current user. + * @tags activity + * @name ActivityListRepoNotificationsForAuthenticatedUser + * @summary List repository notifications for the authenticated user + * @request GET:/repos/{owner}/{repo}/notifications */ - export namespace ReposListDeployments { + export namespace ActivityListRepoNotificationsForAuthenticatedUser { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = { /** - * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). - * @default "none" + * If \`true\`, show notifications marked as read. + * @default false */ - environment?: string; + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** - * The name of the ref. This can be a branch, tag, or SHA. - * @default "none" - */ - ref?: string; - /** - * The SHA recorded at creation time. - * @default "none" - */ - sha?: string; - /** - * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "none" - */ - task?: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeploymentsData; + export type ResponseBody = + ActivityListRepoNotificationsForAuthenticatedUserData; } /** - * @description Users with pull access can view deployment statuses for a deployment: - * @tags repos - * @name ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @tags activity + * @name ActivityListStargazersForRepo + * @summary List stargazers + * @request GET:/repos/{owner}/{repo}/stargazers */ - export namespace ReposListDeploymentStatuses { + export namespace ActivityListStargazersForRepo { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; owner: string; repo: string; }; @@ -45918,17 +43048,17 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeploymentStatusesData; + export type ResponseBody = ActivityListStargazersForRepoData; } /** - * No description - * @tags repos - * @name ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @description Lists the people watching the specified repository. + * @tags activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - export namespace ReposListForks { + export namespace ActivityListWatchersForRepo { export type RequestParams = { owner: string; repo: string; @@ -45944,54 +43074,56 @@ export namespace Repos { * @default 30 */ per_page?: number; - /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ - sort?: ReposListForksParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListForksData; + export type ResponseBody = ActivityListWatchersForRepoData; } /** - * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. - * @tags repos - * @name ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. + * @tags activity + * @name ActivityMarkRepoNotificationsAsRead + * @summary Mark repository notifications as read + * @request PUT:/repos/{owner}/{repo}/notifications */ - export namespace ReposListInvitations { + export namespace ActivityMarkRepoNotificationsAsRead { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export type RequestQuery = {}; + export type RequestBody = ActivityMarkRepoNotificationsAsReadPayload; + export type RequestHeaders = {}; + export type ResponseBody = ActivityMarkRepoNotificationsAsReadData; + } + + /** + * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. + * @tags activity + * @name ActivitySetRepoSubscription + * @summary Set a repository subscription + * @request PUT:/repos/{owner}/{repo}/subscription + */ + export namespace ActivitySetRepoSubscription { + export type RequestParams = { + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ActivitySetRepoSubscriptionPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposListInvitationsData; + export type ResponseBody = ActivitySetRepoSubscriptionData; } /** - * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. - * @tags repos - * @name ReposListLanguages - * @summary List repository languages - * @request GET:/repos/{owner}/{repo}/languages + * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetRepoInstallation + * @summary Get a repository installation for the authenticated app + * @request GET:/repos/{owner}/{repo}/installation */ - export namespace ReposListLanguages { + export namespace AppsGetRepoInstallation { export type RequestParams = { owner: string; repo: string; @@ -45999,109 +43131,96 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListLanguagesData; + export type ResponseBody = AppsGetRepoInstallationData; } /** - * No description - * @tags repos - * @name ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. + * @tags checks + * @name ChecksCreate + * @summary Create a check run + * @request POST:/repos/{owner}/{repo}/check-runs */ - export namespace ReposListPagesBuilds { + export namespace ChecksCreate { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ChecksCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposListPagesBuildsData; + export type ResponseBody = ChecksCreateData; } /** - * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. - * @tags repos - * @name ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. + * @tags checks + * @name ChecksCreateSuite + * @summary Create a check suite + * @request POST:/repos/{owner}/{repo}/check-suites */ - export namespace ReposListPullRequestsAssociatedWithCommit { + export namespace ChecksCreateSuite { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; owner: string; repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export type RequestQuery = {}; + export type RequestBody = ChecksCreateSuitePayload; + export type RequestHeaders = {}; + export type ResponseBody = ChecksCreateSuiteData; + } + + /** + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @tags checks + * @name ChecksGet + * @summary Get a check run + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + */ + export namespace ChecksGet { + export type RequestParams = { + /** check_run_id parameter */ + checkRunId: number; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListPullRequestsAssociatedWithCommitData; + export type ResponseBody = ChecksGetData; } /** - * No description - * @tags repos - * @name ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * @tags checks + * @name ChecksGetSuite + * @summary Get a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} */ - export namespace ReposListReleaseAssets { + export namespace ChecksGetSuite { export type RequestParams = { + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListReleaseAssetsData; + export type ResponseBody = ChecksGetSuiteData; } /** - * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. - * @tags repos - * @name ReposListReleases - * @summary List releases - * @request GET:/repos/{owner}/{repo}/releases + * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. + * @tags checks + * @name ChecksListAnnotations + * @summary List check run annotations + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations */ - export namespace ReposListReleases { + export namespace ChecksListAnnotations { export type RequestParams = { + /** check_run_id parameter */ + checkRunId: number; owner: string; repo: string; }; @@ -46119,22 +43238,31 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListReleasesData; + export type ResponseBody = ChecksListAnnotationsData; } /** - * No description - * @tags repos - * @name ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @tags checks + * @name ChecksListForRef + * @summary List check runs for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs */ - export namespace ReposListTags { + export namespace ChecksListForRef { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = { + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: ChecksListForRefParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -46145,25 +43273,36 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: ChecksListForRefParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListTagsData; + export type ResponseBody = ChecksListForRefData; } /** - * No description - * @tags repos - * @name ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @tags checks + * @name ChecksListForSuite + * @summary List check runs in a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs */ - export namespace ReposListTeams { + export namespace ChecksListForSuite { export type RequestParams = { + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; repo: string; }; export type RequestQuery = { + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: ChecksListForSuiteParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -46174,25 +43313,36 @@ export namespace Repos { * @default 30 */ per_page?: number; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: ChecksListForSuiteParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListTeamsData; + export type ResponseBody = ChecksListForSuiteData; } /** - * No description - * @tags repos - * @name ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * @tags checks + * @name ChecksListSuitesForRef + * @summary List check suites for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites */ - export namespace ReposListWebhooks { + export namespace ChecksListSuitesForRef { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = { + /** + * Filters check suites by GitHub App \`id\`. + * @example 1 + */ + app_id?: number; + /** Returns check runs with the specified \`name\`. */ + check_name?: string; /** * Page number of the results to fetch. * @default 1 @@ -46206,1088 +43356,1012 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListWebhooksData; + export type ResponseBody = ChecksListSuitesForRefData; } /** - * No description - * @tags repos - * @name ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. + * @tags checks + * @name ChecksRerequestSuite + * @summary Rerequest a check suite + * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest */ - export namespace ReposMerge { + export namespace ChecksRerequestSuite { export type RequestParams = { + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposMergePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposMergeData; + export type ResponseBody = ChecksRerequestSuiteData; } /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. - * @tags repos - * @name ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. + * @tags checks + * @name ChecksSetSuitesPreferences + * @summary Update repository preferences for check suites + * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences */ - export namespace ReposPingWebhook { + export namespace ChecksSetSuitesPreferences { export type RequestParams = { - hookId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ChecksSetSuitesPreferencesPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposPingWebhookData; + export type ResponseBody = ChecksSetSuitesPreferencesData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. + * @tags checks + * @name ChecksUpdate + * @summary Update a check run + * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - export namespace ReposRemoveAppAccessRestrictions { + export namespace ChecksUpdate { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** check_run_id parameter */ + checkRunId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveAppAccessRestrictionsPayload; + export type RequestBody = ChecksUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveAppAccessRestrictionsData; + export type ResponseBody = ChecksUpdateData; } /** - * No description - * @tags repos - * @name ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. + * @tags code-scanning + * @name CodeScanningGetAlert + * @summary Get a code scanning alert + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - export namespace ReposRemoveCollaborator { + export namespace CodeScanningGetAlert { export type RequestParams = { + alertNumber: number; owner: string; repo: string; - username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveCollaboratorData; + export type ResponseBody = CodeScanningGetAlertData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @tags code-scanning + * @name CodeScanningListAlertsForRepo + * @summary List code scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts */ - export namespace ReposRemoveStatusCheckContexts { + export namespace CodeScanningListAlertsForRepo { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposRemoveStatusCheckContextsPayload; + export type RequestQuery = { + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ + state?: CodeScanningAlertState; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveStatusCheckContextsData; + export type ResponseBody = CodeScanningListAlertsForRepoData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposRemoveStatusCheckProtection - * @summary Remove status check protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @tags code-scanning + * @name CodeScanningListRecentAnalyses + * @summary List recent code scanning analyses for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/analyses */ - export namespace ReposRemoveStatusCheckProtection { + export namespace CodeScanningListRecentAnalyses { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; - export type RequestQuery = {}; + export type RequestQuery = { + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAnalysisRef; + /** Set a single code scanning tool name to filter alerts by tool. */ + tool_name?: CodeScanningAnalysisToolName; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveStatusCheckProtectionData; + export type ResponseBody = CodeScanningListRecentAnalysesData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposRemoveTeamAccessRestrictions - * @summary Remove team access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @tags code-scanning + * @name CodeScanningUpdateAlert + * @summary Update a code scanning alert + * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - export namespace ReposRemoveTeamAccessRestrictions { + export namespace CodeScanningUpdateAlert { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveTeamAccessRestrictionsPayload; + export type RequestBody = CodeScanningUpdateAlertPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveTeamAccessRestrictionsData; + export type ResponseBody = CodeScanningUpdateAlertData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @tags code-scanning + * @name CodeScanningUploadSarif + * @summary Upload a SARIF file + * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs */ - export namespace ReposRemoveUserAccessRestrictions { + export namespace CodeScanningUploadSarif { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveUserAccessRestrictionsPayload; + export type RequestBody = CodeScanningUploadSarifPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveUserAccessRestrictionsData; + export type ResponseBody = CodeScanningUploadSarifData; } /** - * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. - * @tags repos - * @name ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. + * @tags codes-of-conduct + * @name CodesOfConductGetForRepo + * @summary Get the code of conduct for a repository + * @request GET:/repos/{owner}/{repo}/community/code_of_conduct */ - export namespace ReposRenameBranch { + export namespace CodesOfConductGetForRepo { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRenameBranchPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRenameBranchData; + export type ResponseBody = CodesOfConductGetForRepoData; } /** * No description - * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @tags git + * @name GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - export namespace ReposReplaceAllTopics { + export namespace GitCreateBlob { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposReplaceAllTopicsPayload; + export type RequestBody = GitCreateBlobPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposReplaceAllTopicsData; + export type ResponseBody = GitCreateBlobData; } /** - * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. - * @tags repos - * @name ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds + * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags git + * @name GitCreateCommit + * @summary Create a commit + * @request POST:/repos/{owner}/{repo}/git/commits */ - export namespace ReposRequestPagesBuild { + export namespace GitCreateCommit { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GitCreateCommitPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposRequestPagesBuildData; + export type ResponseBody = GitCreateCommitData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. - * @tags repos - * @name ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. + * @tags git + * @name GitCreateRef + * @summary Create a reference + * @request POST:/repos/{owner}/{repo}/git/refs */ - export namespace ReposSetAdminBranchProtection { + export namespace GitCreateRef { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GitCreateRefPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposSetAdminBranchProtectionData; + export type ResponseBody = GitCreateRefData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags git + * @name GitCreateTag + * @summary Create a tag object + * @request POST:/repos/{owner}/{repo}/git/tags */ - export namespace ReposSetAppAccessRestrictions { + export namespace GitCreateTag { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetAppAccessRestrictionsPayload; + export type RequestBody = GitCreateTagPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposSetAppAccessRestrictionsData; + export type ResponseBody = GitCreateTagData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * @tags repos - * @name ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." + * @tags git + * @name GitCreateTree + * @summary Create a tree + * @request POST:/repos/{owner}/{repo}/git/trees */ - export namespace ReposSetStatusCheckContexts { + export namespace GitCreateTree { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetStatusCheckContextsPayload; + export type RequestBody = GitCreateTreePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposSetStatusCheckContextsData; + export type ResponseBody = GitCreateTreeData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * No description + * @tags git + * @name GitDeleteRef + * @summary Delete a reference + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - export namespace ReposSetTeamAccessRestrictions { + export namespace GitDeleteRef { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetTeamAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetTeamAccessRestrictionsData; + export type ResponseBody = GitDeleteRefData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | - * @tags repos - * @name ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. + * @tags git + * @name GitGetBlob + * @summary Get a blob + * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} */ - export namespace ReposSetUserAccessRestrictions { + export namespace GitGetBlob { export type RequestParams = { - /** The name of the branch. */ - branch: string; + fileSha: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetUserAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetUserAccessRestrictionsData; + export type ResponseBody = GitGetBlobData; } /** - * @description 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/:hook_id/test\` - * @tags repos - * @name ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags git + * @name GitGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} */ - export namespace ReposTestPushWebhook { + export namespace GitGetCommit { export type RequestParams = { - hookId: number; + /** commit_sha parameter */ + commitSha: string; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposTestPushWebhookData; + export type ResponseBody = GitGetCommitData; } /** - * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). - * @tags repos - * @name ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * @tags git + * @name GitGetRef + * @summary Get a reference + * @request GET:/repos/{owner}/{repo}/git/ref/{ref} */ - export namespace ReposTransfer { + export namespace GitGetRef { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposTransferPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposTransferData; + export type ResponseBody = GitGetRefData; } /** - * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. - * @tags repos - * @name ReposUpdate - * @summary Update a repository - * @request PATCH:/repos/{owner}/{repo} + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags git + * @name GitGetTag + * @summary Get a tag + * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} */ - export namespace ReposUpdate { + export namespace GitGetTag { export type RequestParams = { owner: string; repo: string; + tagSha: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateData; + export type ResponseBody = GitGetTagData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. - * @tags repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. + * @tags git + * @name GitGetTree + * @summary Get a tree + * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} */ - export namespace ReposUpdateBranchProtection { + export namespace GitGetTree { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; + treeSha: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposUpdateBranchProtectionPayload; + export type RequestQuery = { + /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ + recursive?: string; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateBranchProtectionData; + export type ResponseBody = GitGetTreeData; } /** - * No description - * @tags repos - * @name ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. + * @tags git + * @name GitListMatchingRefs + * @summary List matching references + * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} */ - export namespace ReposUpdateCommitComment { + export namespace GitListMatchingRefs { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposUpdateCommitCommentPayload; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateCommitCommentData; + export type ResponseBody = GitListMatchingRefsData; } /** - * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). - * @tags repos - * @name ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * No description + * @tags git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - export namespace ReposUpdateInformationAboutPagesSite { + export namespace GitUpdateRef { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateInformationAboutPagesSitePayload; + export type RequestBody = GitUpdateRefPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateInformationAboutPagesSiteData; + export type ResponseBody = GitUpdateRefData; } /** - * No description - * @tags repos - * @name ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. + * @tags interactions + * @name InteractionsGetRestrictionsForRepo + * @summary Get interaction restrictions for a repository + * @request GET:/repos/{owner}/{repo}/interaction-limits */ - export namespace ReposUpdateInvitation { + export namespace InteractionsGetRestrictionsForRepo { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateInvitationPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateInvitationData; + export type ResponseBody = InteractionsGetRestrictionsForRepoData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. - * @tags repos - * @name ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @tags interactions + * @name InteractionsRemoveRestrictionsForRepo + * @summary Remove interaction restrictions for a repository + * @request DELETE:/repos/{owner}/{repo}/interaction-limits */ - export namespace ReposUpdatePullRequestReviewProtection { + export namespace InteractionsRemoveRestrictionsForRepo { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdatePullRequestReviewProtectionPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdatePullRequestReviewProtectionData; + export type ResponseBody = InteractionsRemoveRestrictionsForRepoData; } /** - * @description Users with push access to the repository can edit a release. - * @tags repos - * @name ReposUpdateRelease - * @summary Update a release - * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @tags interactions + * @name InteractionsSetRestrictionsForRepo + * @summary Set interaction restrictions for a repository + * @request PUT:/repos/{owner}/{repo}/interaction-limits */ - export namespace ReposUpdateRelease { + export namespace InteractionsSetRestrictionsForRepo { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateReleasePayload; + export type RequestBody = InteractionLimit; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateReleaseData; + export type ResponseBody = InteractionsSetRestrictionsForRepoData; } /** - * @description Users with push access to the repository can edit a release asset. - * @tags repos - * @name ReposUpdateReleaseAsset - * @summary Update a release asset - * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + * @tags issues + * @name IssuesAddAssignees + * @summary Add assignees to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - export namespace ReposUpdateReleaseAsset { + export namespace IssuesAddAssignees { export type RequestParams = { - /** asset_id parameter */ - assetId: number; + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateReleaseAssetPayload; + export type RequestBody = IssuesAddAssigneesPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateReleaseAssetData; + export type ResponseBody = IssuesAddAssigneesData; } /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. - * @tags repos - * @name ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * No description + * @tags issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace ReposUpdateStatusCheckProtection { + export namespace IssuesAddLabels { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateStatusCheckProtectionPayload; + export type RequestBody = IssuesAddLabelsPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateStatusCheckProtectionData; + export type ResponseBody = IssuesAddLabelsData; } /** - * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." - * @tags repos - * @name ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. + * @tags issues + * @name IssuesCheckUserCanBeAssigned + * @summary Check if a user can be assigned + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - export namespace ReposUpdateWebhook { + export namespace IssuesCheckUserCanBeAssigned { export type RequestParams = { - hookId: number; + assignee: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateWebhookPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateWebhookData; + export type ResponseBody = IssuesCheckUserCanBeAssignedData; } /** - * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. - * @tags repos - * @name ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @tags issues + * @name IssuesCreate + * @summary Create an issue + * @request POST:/repos/{owner}/{repo}/issues */ - export namespace ReposUpdateWebhookConfigForRepo { + export namespace IssuesCreate { export type RequestParams = { - hookId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateWebhookConfigForRepoPayload; + export type RequestBody = IssuesCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateWebhookConfigForRepoData; + export type ResponseBody = IssuesCreateData; } /** - * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. - * @tags repos - * @name ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @tags issues + * @name IssuesCreateComment + * @summary Create an issue comment + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - export namespace ReposUploadReleaseAsset { + export namespace IssuesCreateComment { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; - export type RequestQuery = { - label?: string; - name?: string; - }; - export type RequestBody = ReposUploadReleaseAssetPayload; + export type RequestQuery = {}; + export type RequestBody = IssuesCreateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposUploadReleaseAssetData; + export type ResponseBody = IssuesCreateCommentData; } /** - * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. - * @tags secret-scanning - * @name SecretScanningGetAlert - * @summary Get a secret scanning alert - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * No description + * @tags issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - export namespace SecretScanningGetAlert { + export namespace IssuesCreateLabel { export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesCreateLabelPayload; export type RequestHeaders = {}; - export type ResponseBody = SecretScanningGetAlertData; + export type ResponseBody = IssuesCreateLabelData; } /** - * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. - * @tags secret-scanning - * @name SecretScanningListAlertsForRepo - * @summary List secret scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + * No description + * @tags issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - export namespace SecretScanningListAlertsForRepo { + export namespace IssuesCreateMilestone { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ - state?: SecretScanningListAlertsForRepoParams1StateEnum; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesCreateMilestonePayload; export type RequestHeaders = {}; - export type ResponseBody = SecretScanningListAlertsForRepoData; + export type ResponseBody = IssuesCreateMilestoneData; } /** - * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. - * @tags secret-scanning - * @name SecretScanningUpdateAlert - * @summary Update a secret scanning alert - * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * No description + * @tags issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace SecretScanningUpdateAlert { + export namespace IssuesDeleteComment { export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = SecretScanningUpdateAlertPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SecretScanningUpdateAlertData; + export type ResponseBody = IssuesDeleteCommentData; } -} -export namespace Repositories { /** - * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. - * @tags repos - * @name ReposListPublic - * @summary List public repositories - * @request GET:/repositories + * No description + * @tags issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - export namespace ReposListPublic { - export type RequestParams = {}; - export type RequestQuery = { - /** A repository ID. Only return repositories with an ID greater than this ID. */ - since?: number; + export namespace IssuesDeleteLabel { + export type RequestParams = { + name: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListPublicData; + export type ResponseBody = IssuesDeleteLabelData; } -} -export namespace Scim { /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * @tags enterprise-admin - * @name EnterpriseAdminDeleteScimGroupFromEnterprise - * @summary Delete a SCIM group from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * No description + * @tags issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace EnterpriseAdminDeleteScimGroupFromEnterprise { + export namespace IssuesDeleteMilestone { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteScimGroupFromEnterpriseData; + export type ResponseBody = IssuesDeleteMilestoneData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * @tags enterprise-admin - * @name EnterpriseAdminDeleteUserFromEnterprise - * @summary Delete a SCIM user from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags issues + * @name IssuesGet + * @summary Get an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number} */ - export namespace EnterpriseAdminDeleteUserFromEnterprise { + export namespace IssuesGet { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteUserFromEnterpriseData; + export type ResponseBody = IssuesGetData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup - * @summary Get SCIM provisioning information for an enterprise group - * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * No description + * @tags issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace EnterpriseAdminGetProvisioningInformationForEnterpriseGroup { + export namespace IssuesGetComment { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; + export type ResponseBody = IssuesGetCommentData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser - * @summary Get SCIM provisioning information for an enterprise user - * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * No description + * @tags issues + * @name IssuesGetEvent + * @summary Get an issue event + * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} */ - export namespace EnterpriseAdminGetProvisioningInformationForEnterpriseUser { + export namespace IssuesGetEvent { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; + eventId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; - } - - /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedGroupsEnterprise - * @summary List provisioned SCIM groups for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Groups - */ - export namespace EnterpriseAdminListProvisionedGroupsEnterprise { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** Used for pagination: the number of results to return. */ - count?: number; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListProvisionedGroupsEnterpriseData; + export type ResponseBody = IssuesGetEventData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedIdentitiesEnterprise - * @summary List SCIM provisioned identities for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Users + * No description + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - export namespace EnterpriseAdminListProvisionedIdentitiesEnterprise { + export namespace IssuesGetLabel { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - }; - export type RequestQuery = { - /** Used for pagination: the number of results to return. */ - count?: number; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + name: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListProvisionedIdentitiesEnterpriseData; + export type ResponseBody = IssuesGetLabelData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup - * @summary Provision a SCIM enterprise group and invite users - * @request POST:/scim/v2/enterprises/{enterprise}/Groups + * No description + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace EnterpriseAdminProvisionAndInviteEnterpriseGroup { + export namespace IssuesGetMilestone { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminProvisionAndInviteEnterpriseGroupData; + export type ResponseBody = IssuesGetMilestoneData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseUser - * @summary Provision and invite a SCIM enterprise user - * @request POST:/scim/v2/enterprises/{enterprise}/Users + * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. + * @tags issues + * @name IssuesListAssignees + * @summary List assignees + * @request GET:/repos/{owner}/{repo}/assignees */ - export namespace EnterpriseAdminProvisionAndInviteEnterpriseUser { + export namespace IssuesListAssignees { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminProvisionAndInviteEnterpriseUserData; - } - - /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup - * @summary Set SCIM information for a provisioned enterprise group - * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} - */ - export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseGroup { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; + export type ResponseBody = IssuesListAssigneesData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser - * @summary Set SCIM information for a provisioned enterprise user - * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @description Issue Comments are ordered by ascending ID. + * @tags issues + * @name IssuesListComments + * @summary List issue comments + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseUser { + export namespace IssuesListComments { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; - } - - /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup - * @summary Update an attribute for a SCIM enterprise group - * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} - */ - export namespace EnterpriseAdminUpdateAttributeForEnterpriseGroup { - export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** Identifier generated by the GitHub SCIM endpoint. */ - scimGroupId: string; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminUpdateAttributeForEnterpriseGroupData; + export type ResponseBody = IssuesListCommentsData; } /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseUser - * @summary Update an attribute for a SCIM enterprise user - * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @description By default, Issue Comments are ordered by ascending ID. + * @tags issues + * @name IssuesListCommentsForRepo + * @summary List issue comments for a repository + * @request GET:/repos/{owner}/{repo}/issues/comments */ - export namespace EnterpriseAdminUpdateAttributeForEnterpriseUser { + export namespace IssuesListCommentsForRepo { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; - /** scim_user_id parameter */ - scimUserId: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminUpdateAttributeForEnterpriseUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminUpdateAttributeForEnterpriseUserData; - } - - /** - * No description - * @tags scim - * @name ScimDeleteUserFromOrg - * @summary Delete a SCIM user from an organization - * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} - */ - export namespace ScimDeleteUserFromOrg { - export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + export type RequestQuery = { + /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: IssuesListCommentsForRepoParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: IssuesListCommentsForRepoParams1SortEnum; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ScimDeleteUserFromOrgData; + export type ResponseBody = IssuesListCommentsForRepoData; } /** * No description - * @tags scim - * @name ScimGetProvisioningInformationForUser - * @summary Get SCIM provisioning information for a user - * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events */ - export namespace ScimGetProvisioningInformationForUser { + export namespace IssuesListEvents { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ScimGetProvisioningInformationForUserData; + export type ResponseBody = IssuesListEventsData; } /** - * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. - * @tags scim - * @name ScimListProvisionedIdentities - * @summary List SCIM provisioned identities - * @request GET:/scim/v2/organizations/{org}/Users + * No description + * @tags issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events */ - export namespace ScimListProvisionedIdentities { + export namespace IssuesListEventsForRepo { export type RequestParams = { - org: string; + owner: string; + repo: string; }; export type RequestQuery = { - /** Used for pagination: the number of results to return. */ - count?: number; /** - * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: - * - * \`?filter=userName%20eq%20\\"Octocat\\"\`. - * - * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: - * - * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. + * Page number of the results to fetch. + * @default 1 */ - filter?: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ScimListProvisionedIdentitiesData; + export type ResponseBody = IssuesListEventsForRepoData; } /** - * @description Provision organization membership for a user, and send an activation email to the email address. - * @tags scim - * @name ScimProvisionAndInviteUser - * @summary Provision and invite a SCIM user - * @request POST:/scim/v2/organizations/{org}/Users + * No description + * @tags issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - export namespace ScimProvisionAndInviteUser { + export namespace IssuesListEventsForTimeline { export type RequestParams = { - org: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ScimProvisionAndInviteUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = ScimProvisionAndInviteUserData; - } - - /** - * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. - * @tags scim - * @name ScimSetInformationForProvisionedUser - * @summary Update a provisioned organization membership - * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} - */ - export namespace ScimSetInformationForProvisionedUser { - export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; - export type RequestBody = ScimSetInformationForProvisionedUserPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ScimSetInformationForProvisionedUserData; + export type ResponseBody = IssuesListEventsForTimelineData; } /** - * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` - * @tags scim - * @name ScimUpdateAttributeForUser - * @summary Update an attribute for a SCIM user - * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags issues + * @name IssuesListForRepo + * @summary List repository issues + * @request GET:/repos/{owner}/{repo}/issues */ - export namespace ScimUpdateAttributeForUser { + export namespace IssuesListForRepo { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ScimUpdateAttributeForUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = ScimUpdateAttributeForUserData; - } -} - -export namespace Search { - /** - * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. - * @tags search - * @name SearchCode - * @summary Search code - * @request GET:/search/code - */ - export namespace SearchCode { - export type RequestParams = {}; export type RequestQuery = { + /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ + assignee?: string; + /** The user that created the issue. */ + creator?: string; /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * One of \`asc\` (ascending) or \`desc\` (descending). * @default "desc" */ - order?: SearchCodeParams1OrderEnum; + direction?: IssuesListForRepoParams1DirectionEnum; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** A user that's mentioned in the issue. */ + mentioned?: string; + /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ + milestone?: string; /** * Page number of the results to fetch. * @default 1 @@ -47298,31 +44372,39 @@ export namespace Search { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchCodeParams1SortEnum; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: IssuesListForRepoParams1SortEnum; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: IssuesListForRepoParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchCodeData; + export type ResponseBody = IssuesListForRepoData; } /** - * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` - * @tags search - * @name SearchCommits - * @summary Search commits - * @request GET:/search/commits + * No description + * @tags issues + * @name IssuesListLabelsForMilestone + * @summary List labels for issues in a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels */ - export namespace SearchCommits { - export type RequestParams = {}; + export namespace IssuesListLabelsForMilestone { + export type RequestParams = { + /** milestone_number parameter */ + milestoneNumber: number; + owner: string; + repo: string; + }; export type RequestQuery = { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: SearchCommitsParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47333,31 +44415,25 @@ export namespace Search { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchCommitsParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchCommitsData; + export type ResponseBody = IssuesListLabelsForMilestoneData; } /** - * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." - * @tags search - * @name SearchIssuesAndPullRequests - * @summary Search issues and pull requests - * @request GET:/search/issues + * No description + * @tags issues + * @name IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - export namespace SearchIssuesAndPullRequests { - export type RequestParams = {}; + export namespace IssuesListLabelsForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; export type RequestQuery = { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: SearchIssuesAndPullRequestsParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47368,58 +44444,27 @@ export namespace Search { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchIssuesAndPullRequestsParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchIssuesAndPullRequestsData; + export type ResponseBody = IssuesListLabelsForRepoData; } /** - * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. - * @tags search - * @name SearchLabels - * @summary Search labels - * @request GET:/search/labels + * No description + * @tags issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace SearchLabels { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: SearchLabelsParams1OrderEnum; - /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; - /** The id of the repository. */ - repository_id: number; - /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchLabelsParams1SortEnum; + export namespace IssuesListLabelsOnIssue { + export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = SearchLabelsData; - } - - /** - * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` - * @tags search - * @name SearchRepos - * @summary Search repositories - * @request GET:/search/repositories - */ - export namespace SearchRepos { - export type RequestParams = {}; export type RequestQuery = { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: SearchReposParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47430,49 +44475,30 @@ export namespace Search { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchReposParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchReposData; + export type ResponseBody = IssuesListLabelsOnIssueData; } /** - * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. - * @tags search - * @name SearchTopics - * @summary Search topics - * @request GET:/search/topics + * No description + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - export namespace SearchTopics { - export type RequestParams = {}; - export type RequestQuery = { - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; + export namespace IssuesListMilestones { + export type RequestParams = { + owner: string; + repo: string; }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = SearchTopicsData; - } - - /** - * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. - * @tags search - * @name SearchUsers - * @summary Search users - * @request GET:/search/users - */ - export namespace SearchUsers { - export type RequestParams = {}; export type RequestQuery = { /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" */ - order?: SearchUsersParams1OrderEnum; + direction?: IssuesListMilestonesParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -47483,461 +44509,677 @@ export namespace Search { * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: SearchUsersParams1SortEnum; + /** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ + sort?: IssuesListMilestonesParams1SortEnum; + /** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: IssuesListMilestonesParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchUsersData; + export type ResponseBody = IssuesListMilestonesData; } -} -export namespace Teams { /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentLegacy - * @summary Create reaction for a team discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags issues + * @name IssuesLock + * @summary Lock an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - export namespace ReactionsCreateForTeamDiscussionCommentLegacy { + export namespace IssuesLock { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = - ReactionsCreateForTeamDiscussionCommentLegacyPayload; + export type RequestBody = IssuesLockPayload; export type RequestHeaders = {}; - export type ResponseBody = - ReactionsCreateForTeamDiscussionCommentLegacyData; + export type ResponseBody = IssuesLockData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. - * @tags reactions - * @name ReactionsCreateForTeamDiscussionLegacy - * @summary Create reaction for a team discussion (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * No description + * @tags issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace ReactionsCreateForTeamDiscussionLegacy { + export namespace IssuesRemoveAllLabels { export type RequestParams = { - discussionNumber: number; - teamId: number; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForTeamDiscussionLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionLegacyData; + export type ResponseBody = IssuesRemoveAllLabelsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentLegacy - * @summary List reactions for a team discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @description Removes one or more assignees from an issue. + * @tags issues + * @name IssuesRemoveAssignees + * @summary Remove assignees from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - export namespace ReactionsListForTeamDiscussionCommentLegacy { + export namespace IssuesRemoveAssignees { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; - }; - export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesRemoveAssigneesPayload; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionCommentLegacyData; + export type ResponseBody = IssuesRemoveAssigneesData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags reactions - * @name ReactionsListForTeamDiscussionLegacy - * @summary List reactions for a team discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. + * @tags issues + * @name IssuesRemoveLabel + * @summary Remove a label from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} */ - export namespace ReactionsListForTeamDiscussionLegacy { + export namespace IssuesRemoveLabel { export type RequestParams = { - discussionNumber: number; - teamId: number; - }; - export type RequestQuery = { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ - content?: ReactionsListForTeamDiscussionLegacyParams1ContentEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** issue_number parameter */ + issueNumber: number; + name: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionLegacyData; + export type ResponseBody = IssuesRemoveLabelData; } /** - * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags teams - * @name TeamsAddMemberLegacy - * @summary Add team member (Legacy) - * @request PUT:/teams/{team_id}/members/{username} - * @deprecated + * @description Removes any previous labels and sets the new labels for an issue. + * @tags issues + * @name IssuesSetLabels + * @summary Set labels for an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace TeamsAddMemberLegacy { + export namespace IssuesSetLabels { export type RequestParams = { - teamId: number; - username: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesSetLabelsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddMemberLegacyData; + export type ResponseBody = IssuesSetLabelsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserLegacy - * @summary Add or update team membership for a user (Legacy) - * @request PUT:/teams/{team_id}/memberships/{username} - * @deprecated + * @description Users with push access can unlock an issue's conversation. + * @tags issues + * @name IssuesUnlock + * @summary Unlock an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - export namespace TeamsAddOrUpdateMembershipForUserLegacy { + export namespace IssuesUnlock { export type RequestParams = { - teamId: number; - username: string; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateMembershipForUserLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateMembershipForUserLegacyData; + export type ResponseBody = IssuesUnlockData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsLegacy - * @summary Add or update team project permissions (Legacy) - * @request PUT:/teams/{team_id}/projects/{project_id} - * @deprecated + * @description Issue owners and users with push access can edit an issue. + * @tags issues + * @name IssuesUpdate + * @summary Update an issue + * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} */ - export namespace TeamsAddOrUpdateProjectPermissionsLegacy { + export namespace IssuesUpdate { export type RequestParams = { - projectId: number; - teamId: number; + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateProjectPermissionsLegacyPayload; + export type RequestBody = IssuesUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateProjectPermissionsLegacyData; + export type ResponseBody = IssuesUpdateData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsLegacy - * @summary Add or update team repository permissions (Legacy) - * @request PUT:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * No description + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace TeamsAddOrUpdateRepoPermissionsLegacy { + export namespace IssuesUpdateComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateRepoPermissionsLegacyPayload; + export type RequestBody = IssuesUpdateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateRepoPermissionsLegacyData; + export type ResponseBody = IssuesUpdateCommentData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. - * @tags teams - * @name TeamsCheckPermissionsForProjectLegacy - * @summary Check team permissions for a project (Legacy) - * @request GET:/teams/{team_id}/projects/{project_id} - * @deprecated + * No description + * @tags issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - export namespace TeamsCheckPermissionsForProjectLegacy { + export namespace IssuesUpdateLabel { export type RequestParams = { - projectId: number; - teamId: number; + name: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesUpdateLabelPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForProjectLegacyData; + export type ResponseBody = IssuesUpdateLabelData; } /** - * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: - * @tags teams - * @name TeamsCheckPermissionsForRepoLegacy - * @summary Check team permissions for a repository (Legacy) - * @request GET:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * No description + * @tags issues + * @name IssuesUpdateMilestone + * @summary Update a milestone + * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace TeamsCheckPermissionsForRepoLegacy { + export namespace IssuesUpdateMilestone { export type RequestParams = { + /** milestone_number parameter */ + milestoneNumber: number; owner: string; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesUpdateMilestonePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForRepoLegacyData; + export type ResponseBody = IssuesUpdateMilestoneData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags teams - * @name TeamsCreateDiscussionCommentLegacy - * @summary Create a discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. + * @tags licenses + * @name LicensesGetForRepo + * @summary Get the license for a repository + * @request GET:/repos/{owner}/{repo}/license */ - export namespace TeamsCreateDiscussionCommentLegacy { + export namespace LicensesGetForRepo { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionCommentLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionCommentLegacyData; + export type ResponseBody = LicensesGetForRepoData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. - * @tags teams - * @name TeamsCreateDiscussionLegacy - * @summary Create a discussion (Legacy) - * @request POST:/teams/{team_id}/discussions - * @deprecated + * @description Stop an import for a repository. + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - export namespace TeamsCreateDiscussionLegacy { + export namespace MigrationsCancelImport { export type RequestParams = { - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionLegacyData; + export type ResponseBody = MigrationsCancelImportData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy - * @summary Create or update IdP group connections (Legacy) - * @request PATCH:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + * @tags migrations + * @name MigrationsGetCommitAuthors + * @summary Get commit authors + * @request GET:/repos/{owner}/{repo}/import/authors */ - export namespace TeamsCreateOrUpdateIdpGroupConnectionsLegacy { + export namespace MigrationsGetCommitAuthors { export type RequestParams = { - teamId: number; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; + export type RequestQuery = { + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyData; + export type ResponseBody = MigrationsGetCommitAuthorsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsDeleteDiscussionCommentLegacy - * @summary Delete a discussion comment (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. + * @tags migrations + * @name MigrationsGetImportStatus + * @summary Get an import status + * @request GET:/repos/{owner}/{repo}/import */ - export namespace TeamsDeleteDiscussionCommentLegacy { + export namespace MigrationsGetImportStatus { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionCommentLegacyData; + export type ResponseBody = MigrationsGetImportStatusData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsDeleteDiscussionLegacy - * @summary Delete a discussion (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @description List files larger than 100MB found during the import + * @tags migrations + * @name MigrationsGetLargeFiles + * @summary Get large files + * @request GET:/repos/{owner}/{repo}/import/large_files */ - export namespace TeamsDeleteDiscussionLegacy { + export namespace MigrationsGetLargeFiles { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionLegacyData; + export type ResponseBody = MigrationsGetLargeFilesData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. - * @tags teams - * @name TeamsDeleteLegacy - * @summary Delete a team (Legacy) - * @request DELETE:/teams/{team_id} - * @deprecated + * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. + * @tags migrations + * @name MigrationsMapCommitAuthor + * @summary Map a commit author + * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} */ - export namespace TeamsDeleteLegacy { + export namespace MigrationsMapCommitAuthor { export type RequestParams = { - teamId: number; + authorId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MigrationsMapCommitAuthorPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteLegacyData; + export type ResponseBody = MigrationsMapCommitAuthorData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsGetDiscussionCommentLegacy - * @summary Get a discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). + * @tags migrations + * @name MigrationsSetLfsPreference + * @summary Update Git LFS preference + * @request PATCH:/repos/{owner}/{repo}/import/lfs */ - export namespace TeamsGetDiscussionCommentLegacy { + export namespace MigrationsSetLfsPreference { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MigrationsSetLfsPreferencePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionCommentLegacyData; + export type ResponseBody = MigrationsSetLfsPreferenceData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsGetDiscussionLegacy - * @summary Get a discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number} - * @deprecated - */ - export namespace TeamsGetDiscussionLegacy { - export type RequestParams = { - discussionNumber: number; - teamId: number; + * @description Start a source import to a GitHub repository using GitHub Importer. + * @tags migrations + * @name MigrationsStartImport + * @summary Start an import + * @request PUT:/repos/{owner}/{repo}/import + */ + export namespace MigrationsStartImport { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = MigrationsStartImportPayload; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsStartImportData; + } + + /** + * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. + * @tags migrations + * @name MigrationsUpdateImport + * @summary Update an import + * @request PATCH:/repos/{owner}/{repo}/import + */ + export namespace MigrationsUpdateImport { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = MigrationsUpdateImportPayload; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsUpdateImportData; + } + + /** + * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsCreateForRepo + * @summary Create a repository project + * @request POST:/repos/{owner}/{repo}/projects + */ + export namespace ProjectsCreateForRepo { + export type RequestParams = { + owner: string; + repo: string; }; export type RequestQuery = {}; + export type RequestBody = ProjectsCreateForRepoPayload; + export type RequestHeaders = {}; + export type ResponseBody = ProjectsCreateForRepoData; + } + + /** + * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @tags projects + * @name ProjectsListForRepo + * @summary List repository projects + * @request GET:/repos/{owner}/{repo}/projects + */ + export namespace ProjectsListForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: ProjectsListForRepoParams1StateEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionLegacyData; + export type ResponseBody = ProjectsListForRepoData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. - * @tags teams - * @name TeamsGetLegacy - * @summary Get a team (Legacy) - * @request GET:/teams/{team_id} - * @deprecated + * No description + * @tags pulls + * @name PullsCheckIfMerged + * @summary Check if a pull request has been merged + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - export namespace TeamsGetLegacy { + export namespace PullsCheckIfMerged { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetLegacyData; + export type ResponseBody = PullsCheckIfMergedData; } /** - * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. - * @tags teams - * @name TeamsGetMemberLegacy - * @summary Get team member (Legacy) - * @request GET:/teams/{team_id}/members/{username} - * @deprecated + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags pulls + * @name PullsCreate + * @summary Create a pull request + * @request POST:/repos/{owner}/{repo}/pulls */ - export namespace TeamsGetMemberLegacy { + export namespace PullsCreate { export type RequestParams = { - teamId: number; - username: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = PullsCreatePayload; + export type RequestHeaders = {}; + export type ResponseBody = PullsCreateData; + } + + /** + * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags pulls + * @name PullsCreateReplyForReviewComment + * @summary Create a reply for a review comment + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + */ + export namespace PullsCreateReplyForReviewComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + pullNumber: number; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = PullsCreateReplyForReviewCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = PullsCreateReplyForReviewCommentData; + } + + /** + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + * @tags pulls + * @name PullsCreateReview + * @summary Create a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + */ + export namespace PullsCreateReview { + export type RequestParams = { + owner: string; + pullNumber: number; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = PullsCreateReviewPayload; + export type RequestHeaders = {}; + export type ResponseBody = PullsCreateReviewData; + } + + /** + * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags pulls + * @name PullsCreateReviewComment + * @summary Create a review comment for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments + */ + export namespace PullsCreateReviewComment { + export type RequestParams = { + owner: string; + pullNumber: number; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = PullsCreateReviewCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = PullsCreateReviewCommentData; + } + + /** + * No description + * @tags pulls + * @name PullsDeletePendingReview + * @summary Delete a pending review for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + */ + export namespace PullsDeletePendingReview { + export type RequestParams = { + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMemberLegacyData; + export type ResponseBody = PullsDeletePendingReviewData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). - * @tags teams - * @name TeamsGetMembershipForUserLegacy - * @summary Get team membership for a user (Legacy) - * @request GET:/teams/{team_id}/memberships/{username} - * @deprecated + * @description Deletes a review comment. + * @tags pulls + * @name PullsDeleteReviewComment + * @summary Delete a review comment for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - export namespace TeamsGetMembershipForUserLegacy { + export namespace PullsDeleteReviewComment { export type RequestParams = { - teamId: number; - username: string; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMembershipForUserLegacyData; + export type ResponseBody = PullsDeleteReviewCommentData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. - * @tags teams - * @name TeamsListChildLegacy - * @summary List child teams (Legacy) - * @request GET:/teams/{team_id}/teams - * @deprecated + * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. + * @tags pulls + * @name PullsDismissReview + * @summary Dismiss a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals */ - export namespace TeamsListChildLegacy { + export namespace PullsDismissReview { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; + }; + export type RequestQuery = {}; + export type RequestBody = PullsDismissReviewPayload; + export type RequestHeaders = {}; + export type ResponseBody = PullsDismissReviewData; + } + + /** + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * @tags pulls + * @name PullsGet + * @summary Get a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + */ + export namespace PullsGet { + export type RequestParams = { + owner: string; + pullNumber: number; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = PullsGetData; + } + + /** + * No description + * @tags pulls + * @name PullsGetReview + * @summary Get a review for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + */ + export namespace PullsGetReview { + export type RequestParams = { + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = PullsGetReviewData; + } + + /** + * @description Provides details for a review comment. + * @tags pulls + * @name PullsGetReviewComment + * @summary Get a review comment for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + */ + export namespace PullsGetReviewComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = PullsGetReviewCommentData; + } + + /** + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags pulls + * @name PullsList + * @summary List pull requests + * @request GET:/repos/{owner}/{repo}/pulls + */ + export namespace PullsList { + export type RequestParams = { + owner: string; + repo: string; }; export type RequestQuery = { + /** Filter pulls by base branch name. Example: \`gh-pages\`. */ + base?: string; + /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ + direction?: PullsListParams1DirectionEnum; + /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ + head?: string; /** * Page number of the results to fetch. * @default 1 @@ -47948,31 +45190,38 @@ export namespace Teams { * @default 30 */ per_page?: number; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). + * @default "created" + */ + sort?: PullsListParams1SortEnum; + /** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ + state?: PullsListParams1StateEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListChildLegacyData; + export type ResponseBody = PullsListData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsListDiscussionCommentsLegacy - * @summary List discussion comments (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @description List comments for a specific pull request review. + * @tags pulls + * @name PullsListCommentsForReview + * @summary List comments for a pull request review + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments */ - export namespace TeamsListDiscussionCommentsLegacy { + export namespace PullsListCommentsForReview { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: TeamsListDiscussionCommentsLegacyParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -47986,27 +45235,23 @@ export namespace Teams { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionCommentsLegacyData; + export type ResponseBody = PullsListCommentsForReviewData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsListDiscussionsLegacy - * @summary List discussions (Legacy) - * @request GET:/teams/{team_id}/discussions - * @deprecated + * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. + * @tags pulls + * @name PullsListCommits + * @summary List commits on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits */ - export namespace TeamsListDiscussionsLegacy { + export namespace PullsListCommits { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: TeamsListDiscussionsLegacyParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -48020,38 +45265,21 @@ export namespace Teams { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionsLegacyData; - } - - /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. - * @tags teams - * @name TeamsListIdpGroupsForLegacy - * @summary List IdP groups for a team (Legacy) - * @request GET:/teams/{team_id}/team-sync/group-mappings - * @deprecated - */ - export namespace TeamsListIdpGroupsForLegacy { - export type RequestParams = { - teamId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsForLegacyData; + export type ResponseBody = PullsListCommitsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. - * @tags teams - * @name TeamsListMembersLegacy - * @summary List team members (Legacy) - * @request GET:/teams/{team_id}/members - * @deprecated + * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. + * @tags pulls + * @name PullsListFiles + * @summary List pull requests files + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files */ - export namespace TeamsListMembersLegacy { + export namespace PullsListFiles { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = { /** @@ -48064,31 +45292,24 @@ export namespace Teams { * @default 30 */ per_page?: number; - /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ - role?: TeamsListMembersLegacyParams1RoleEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListMembersLegacyData; + export type ResponseBody = PullsListFilesData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. - * @tags teams - * @name TeamsListPendingInvitationsLegacy - * @summary List pending team invitations (Legacy) - * @request GET:/teams/{team_id}/invitations - * @deprecated + * No description + * @tags pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - export namespace TeamsListPendingInvitationsLegacy { + export namespace PullsListRequestedReviewers { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = { /** @@ -48104,22 +45325,25 @@ export namespace Teams { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListPendingInvitationsLegacyData; + export type ResponseBody = PullsListRequestedReviewersData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. - * @tags teams - * @name TeamsListProjectsLegacy - * @summary List team projects (Legacy) - * @request GET:/teams/{team_id}/projects - * @deprecated + * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. + * @tags pulls + * @name PullsListReviewComments + * @summary List review comments on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - export namespace TeamsListProjectsLegacy { + export namespace PullsListReviewComments { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: PullsListReviewCommentsParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -48130,25 +45354,34 @@ export namespace Teams { * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: PullsListReviewCommentsParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListProjectsLegacyData; + export type ResponseBody = PullsListReviewCommentsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. - * @tags teams - * @name TeamsListReposLegacy - * @summary List team repositories (Legacy) - * @request GET:/teams/{team_id}/repos - * @deprecated + * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. + * @tags pulls + * @name PullsListReviewCommentsForRepo + * @summary List review comments in a repository + * @request GET:/repos/{owner}/{repo}/pulls/comments */ - export namespace TeamsListReposLegacy { + export namespace PullsListReviewCommentsForRepo { export type RequestParams = { - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: PullsListReviewCommentsForRepoParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -48159,297 +45392,387 @@ export namespace Teams { * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: PullsListReviewCommentsForRepoParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListReposLegacyData; + export type ResponseBody = PullsListReviewCommentsForRepoData; } /** - * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - * @tags teams - * @name TeamsRemoveMemberLegacy - * @summary Remove team member (Legacy) - * @request DELETE:/teams/{team_id}/members/{username} - * @deprecated + * @description The list of reviews returns in chronological order. + * @tags pulls + * @name PullsListReviews + * @summary List reviews for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - export namespace TeamsRemoveMemberLegacy { + export namespace PullsListReviews { export type RequestParams = { - teamId: number; - username: string; + owner: string; + pullNumber: number; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveMemberLegacyData; + export type ResponseBody = PullsListReviewsData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." - * @tags teams - * @name TeamsRemoveMembershipForUserLegacy - * @summary Remove team membership for a user (Legacy) - * @request DELETE:/teams/{team_id}/memberships/{username} - * @deprecated + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @tags pulls + * @name PullsMerge + * @summary Merge a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - export namespace TeamsRemoveMembershipForUserLegacy { + export namespace PullsMerge { export type RequestParams = { - teamId: number; - username: string; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsMergePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveMembershipForUserLegacyData; + export type ResponseBody = PullsMergeData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. - * @tags teams - * @name TeamsRemoveProjectLegacy - * @summary Remove a project from a team (Legacy) - * @request DELETE:/teams/{team_id}/projects/{project_id} - * @deprecated + * No description + * @tags pulls + * @name PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - export namespace TeamsRemoveProjectLegacy { + export namespace PullsRemoveRequestedReviewers { export type RequestParams = { - projectId: number; - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsRemoveRequestedReviewersPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveProjectLegacyData; + export type ResponseBody = PullsRemoveRequestedReviewersData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. - * @tags teams - * @name TeamsRemoveRepoLegacy - * @summary Remove a repository from a team (Legacy) - * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @tags pulls + * @name PullsRequestReviewers + * @summary Request reviewers for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - export namespace TeamsRemoveRepoLegacy { + export namespace PullsRequestReviewers { export type RequestParams = { owner: string; + pullNumber: number; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsRequestReviewersPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveRepoLegacyData; + export type ResponseBody = PullsRequestReviewersData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsUpdateDiscussionCommentLegacy - * @summary Update a discussion comment (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * No description + * @tags pulls + * @name PullsSubmitReview + * @summary Submit a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events */ - export namespace TeamsUpdateDiscussionCommentLegacy { + export namespace PullsSubmitReview { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionCommentLegacyPayload; + export type RequestBody = PullsSubmitReviewPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionCommentLegacyData; + export type ResponseBody = PullsSubmitReviewData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags teams - * @name TeamsUpdateDiscussionLegacy - * @summary Update a discussion (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + * @tags pulls + * @name PullsUpdate + * @summary Update a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} */ - export namespace TeamsUpdateDiscussionLegacy { + export namespace PullsUpdate { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionLegacyPayload; + export type RequestBody = PullsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionLegacyData; + export type ResponseBody = PullsUpdateData; } /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. - * @tags teams - * @name TeamsUpdateLegacy - * @summary Update a team (Legacy) - * @request PATCH:/teams/{team_id} - * @deprecated + * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + * @tags pulls + * @name PullsUpdateBranch + * @summary Update a pull request branch + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch */ - export namespace TeamsUpdateLegacy { + export namespace PullsUpdateBranch { export type RequestParams = { - teamId: number; + owner: string; + pullNumber: number; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateLegacyPayload; + export type RequestBody = PullsUpdateBranchPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateLegacyData; + export type ResponseBody = PullsUpdateBranchData; } -} -export namespace User { /** - * No description - * @tags activity - * @name ActivityCheckRepoIsStarredByAuthenticatedUser - * @summary Check if a repository is starred by the authenticated user - * @request GET:/user/starred/{owner}/{repo} + * @description Update the review summary comment with new text. + * @tags pulls + * @name PullsUpdateReview + * @summary Update a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - export namespace ActivityCheckRepoIsStarredByAuthenticatedUser { + export namespace PullsUpdateReview { export type RequestParams = { owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsUpdateReviewPayload; export type RequestHeaders = {}; - export type ResponseBody = - ActivityCheckRepoIsStarredByAuthenticatedUserData; + export type ResponseBody = PullsUpdateReviewData; } /** - * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: - * @tags activity - * @name ActivityListReposStarredByAuthenticatedUser - * @summary List repositories starred by the authenticated user - * @request GET:/user/starred + * @description Enables you to edit a review comment. + * @tags pulls + * @name PullsUpdateReviewComment + * @summary Update a review comment for a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - export namespace ActivityListReposStarredByAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: ActivityListReposStarredByAuthenticatedUserParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: ActivityListReposStarredByAuthenticatedUserParams1SortEnum; + export namespace PullsUpdateReviewComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = PullsUpdateReviewCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReposStarredByAuthenticatedUserData; + export type ResponseBody = PullsUpdateReviewCommentData; } /** - * @description Lists repositories the authenticated user is watching. - * @tags activity - * @name ActivityListWatchedReposForAuthenticatedUser - * @summary List repositories watched by the authenticated user - * @request GET:/user/subscriptions + * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. + * @tags reactions + * @name ReactionsCreateForCommitComment + * @summary Create reaction for a commit comment + * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - export namespace ActivityListWatchedReposForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReactionsCreateForCommitComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForCommitCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsCreateForCommitCommentData; + } + + /** + * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. + * @tags reactions + * @name ReactionsCreateForIssue + * @summary Create reaction for an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + */ + export namespace ReactionsCreateForIssue { + export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForIssuePayload; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsCreateForIssueData; + } + + /** + * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. + * @tags reactions + * @name ReactionsCreateForIssueComment + * @summary Create reaction for an issue comment + * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + */ + export namespace ReactionsCreateForIssueComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForIssueCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsCreateForIssueCommentData; + } + + /** + * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. + * @tags reactions + * @name ReactionsCreateForPullRequestReviewComment + * @summary Create reaction for a pull request review comment + * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + */ + export namespace ReactionsCreateForPullRequestReviewComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForPullRequestReviewCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsCreateForPullRequestReviewCommentData; + } + + /** + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * @tags reactions + * @name ReactionsDeleteForCommitComment + * @summary Delete a commit comment reaction + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + */ + export namespace ReactionsDeleteForCommitComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + reactionId: number; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListWatchedReposForAuthenticatedUserData; + export type ResponseBody = ReactionsDeleteForCommitCommentData; } /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * @tags activity - * @name ActivityStarRepoForAuthenticatedUser - * @summary Star a repository for the authenticated user - * @request PUT:/user/starred/{owner}/{repo} + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + * @tags reactions + * @name ReactionsDeleteForIssue + * @summary Delete an issue reaction + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} */ - export namespace ActivityStarRepoForAuthenticatedUser { + export namespace ReactionsDeleteForIssue { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; + reactionId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityStarRepoForAuthenticatedUserData; + export type ResponseBody = ReactionsDeleteForIssueData; } /** - * No description - * @tags activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @tags reactions + * @name ReactionsDeleteForIssueComment + * @summary Delete an issue comment reaction + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} */ - export namespace ActivityUnstarRepoForAuthenticatedUser { + export namespace ReactionsDeleteForIssueComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityUnstarRepoForAuthenticatedUserData; + export type ResponseBody = ReactionsDeleteForIssueCommentData; } /** - * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. - * @tags apps - * @name AppsAddRepoToInstallation - * @summary Add a repository to an app installation - * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @tags reactions + * @name ReactionsDeleteForPullRequestComment + * @summary Delete a pull request comment reaction + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} */ - export namespace AppsAddRepoToInstallation { + export namespace ReactionsDeleteForPullRequestComment { export type RequestParams = { - /** installation_id parameter */ - installationId: number; - repositoryId: number; + /** comment_id parameter */ + commentId: number; + owner: string; + reactionId: number; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsAddRepoToInstallationData; + export type ResponseBody = ReactionsDeleteForPullRequestCommentData; } /** - * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. - * @tags apps - * @name AppsListInstallationReposForAuthenticatedUser - * @summary List repositories accessible to the user access token - * @request GET:/user/installations/{installation_id}/repositories + * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * @tags reactions + * @name ReactionsListForCommitComment + * @summary List reactions for a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - export namespace AppsListInstallationReposForAuthenticatedUser { + export namespace ReactionsListForCommitComment { export type RequestParams = { - /** installation_id parameter */ - installationId: number; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ + content?: ReactionsListForCommitCommentParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -48463,20 +45786,26 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - AppsListInstallationReposForAuthenticatedUserData; + export type ResponseBody = ReactionsListForCommitCommentData; } /** - * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. - * @tags apps - * @name AppsListInstallationsForAuthenticatedUser - * @summary List app installations accessible to the user access token - * @request GET:/user/installations + * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * @tags reactions + * @name ReactionsListForIssue + * @summary List reactions for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - export namespace AppsListInstallationsForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReactionsListForIssue { + export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; + owner: string; + repo: string; + }; export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ + content?: ReactionsListForIssueParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -48490,19 +45819,26 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListInstallationsForAuthenticatedUserData; + export type ResponseBody = ReactionsListForIssueData; } /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUser - * @summary List subscriptions for the authenticated user - * @request GET:/user/marketplace_purchases + * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @tags reactions + * @name ReactionsListForIssueComment + * @summary List reactions for an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - export namespace AppsListSubscriptionsForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReactionsListForIssueComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ + content?: ReactionsListForIssueCommentParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -48516,19 +45852,26 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListSubscriptionsForAuthenticatedUserData; + export type ResponseBody = ReactionsListForIssueCommentData; } /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUserStubbed - * @summary List subscriptions for the authenticated user (stubbed) - * @request GET:/user/marketplace_purchases/stubbed + * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @tags reactions + * @name ReactionsListForPullRequestReviewComment + * @summary List reactions for a pull request review comment + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - export namespace AppsListSubscriptionsForAuthenticatedUserStubbed { - export type RequestParams = {}; + export namespace ReactionsListForPullRequestReviewComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ + content?: ReactionsListForPullRequestReviewCommentParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -48542,5212 +45885,6510 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - AppsListSubscriptionsForAuthenticatedUserStubbedData; + export type ResponseBody = ReactionsListForPullRequestReviewCommentData; } /** - * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. - * @tags apps - * @name AppsRemoveRepoFromInstallation - * @summary Remove a repository from an app installation - * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - export namespace AppsRemoveRepoFromInstallation { + export namespace ReposAddAppAccessRestrictions { export type RequestParams = { - /** installation_id parameter */ - installationId: number; - repositoryId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddAppAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = AppsRemoveRepoFromInstallationData; + export type ResponseBody = ReposAddAppAccessRestrictionsData; } /** - * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. - * @tags interactions - * @name InteractionsGetRestrictionsForAuthenticatedUser - * @summary Get interaction restrictions for your public repositories - * @request GET:/user/interaction-limits + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + * @tags repos + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - export namespace InteractionsGetRestrictionsForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposAddCollaborator { + export type RequestParams = { + owner: string; + repo: string; + username: string; + }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddCollaboratorPayload; export type RequestHeaders = {}; - export type ResponseBody = - InteractionsGetRestrictionsForAuthenticatedUserData; + export type ResponseBody = ReposAddCollaboratorData; } /** - * @description Removes any interaction restrictions from your public repositories. - * @tags interactions - * @name InteractionsRemoveRestrictionsForAuthenticatedUser - * @summary Remove interaction restrictions from your public repositories - * @request DELETE:/user/interaction-limits + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - export namespace InteractionsRemoveRestrictionsForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposAddStatusCheckContexts { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddStatusCheckContextsPayload; export type RequestHeaders = {}; - export type ResponseBody = - InteractionsRemoveRestrictionsForAuthenticatedUserData; + export type ResponseBody = ReposAddStatusCheckContextsData; } /** - * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. - * @tags interactions - * @name InteractionsSetRestrictionsForAuthenticatedUser - * @summary Set interaction restrictions for your public repositories - * @request PUT:/user/interaction-limits + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - export namespace InteractionsSetRestrictionsForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposAddTeamAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = InteractionLimit; + export type RequestBody = ReposAddTeamAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = - InteractionsSetRestrictionsForAuthenticatedUserData; + export type ResponseBody = ReposAddTeamAccessRestrictionsData; } /** - * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * @tags issues - * @name IssuesListForAuthenticatedUser - * @summary List user account issues assigned to the authenticated user - * @request GET:/user/issues + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - export namespace IssuesListForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: IssuesListForAuthenticatedUserParams1DirectionEnum; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: IssuesListForAuthenticatedUserParams1FilterEnum; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: IssuesListForAuthenticatedUserParams1SortEnum; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListForAuthenticatedUserParams1StateEnum; + export namespace ReposAddUserAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposAddUserAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesListForAuthenticatedUserData; + export type ResponseBody = ReposAddUserAccessRestrictionsData; } /** - * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. - * @tags migrations - * @name MigrationsDeleteArchiveForAuthenticatedUser - * @summary Delete a user migration archive - * @request DELETE:/user/migrations/{migration_id}/archive + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * @tags repos + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} */ - export namespace MigrationsDeleteArchiveForAuthenticatedUser { + export namespace ReposCheckCollaborator { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + owner: string; + repo: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsDeleteArchiveForAuthenticatedUserData; + export type ResponseBody = ReposCheckCollaboratorData; } /** - * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. - * @tags migrations - * @name MigrationsGetArchiveForAuthenticatedUser - * @summary Download a user migration archive - * @request GET:/user/migrations/{migration_id}/archive + * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @tags repos + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace MigrationsGetArchiveForAuthenticatedUser { + export namespace ReposCheckVulnerabilityAlerts { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = ReposCheckVulnerabilityAlertsData; } /** - * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). - * @tags migrations - * @name MigrationsGetStatusForAuthenticatedUser - * @summary Get a user migration status - * @request GET:/user/migrations/{migration_id} + * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags repos + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - export namespace MigrationsGetStatusForAuthenticatedUser { + export namespace ReposCompareCommits { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - }; - export type RequestQuery = { - exclude?: string[]; + base: string; + head: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetStatusForAuthenticatedUserData; + export type ResponseBody = ReposCompareCommitsData; } /** - * @description Lists all migrations a user has started. - * @tags migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags repos + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - export namespace MigrationsListForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposCreateCommitComment { + export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposCreateCommitCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsListForAuthenticatedUserData; + export type ResponseBody = ReposCreateCommitCommentData; } /** - * @description Lists all the repositories for this user migration. - * @tags migrations - * @name MigrationsListReposForUser - * @summary List repositories for a user migration - * @request GET:/user/migrations/{migration_id}/repositories + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. + * @tags repos + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace MigrationsListReposForUser { + export namespace ReposCreateCommitSignatureProtection { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsListReposForUserData; + export type ResponseBody = ReposCreateCommitSignatureProtectionData; } /** - * @description Initiates the generation of a user migration archive. - * @tags migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. + * @tags repos + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - export namespace MigrationsStartForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposCreateCommitStatus { + export type RequestParams = { + owner: string; + repo: string; + sha: string; + }; export type RequestQuery = {}; - export type RequestBody = MigrationsStartForAuthenticatedUserPayload; + export type RequestBody = ReposCreateCommitStatusPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsStartForAuthenticatedUserData; + export type ResponseBody = ReposCreateCommitStatusData; } /** - * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. - * @tags migrations - * @name MigrationsUnlockRepoForAuthenticatedUser - * @summary Unlock a user repository - * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + * @description You can create a read-only deploy key. + * @tags repos + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys */ - export namespace MigrationsUnlockRepoForAuthenticatedUser { + export namespace ReposCreateDeployKey { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - /** repo_name parameter */ - repoName: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDeployKeyPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsUnlockRepoForAuthenticatedUserData; + export type ResponseBody = ReposCreateDeployKeyData; } /** - * No description - * @tags orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. + * @tags repos + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - export namespace OrgsGetMembershipForAuthenticatedUser { + export namespace ReposCreateDeployment { export type RequestParams = { - org: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDeploymentPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetMembershipForAuthenticatedUserData; + export type ResponseBody = ReposCreateDeploymentData; } /** - * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. - * @tags orgs - * @name OrgsListForAuthenticatedUser - * @summary List organizations for the authenticated user - * @request GET:/user/orgs + * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. + * @tags repos + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - export namespace OrgsListForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposCreateDeploymentStatus { + export type RequestParams = { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposCreateDeploymentStatusPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsListForAuthenticatedUserData; + export type ResponseBody = ReposCreateDeploymentStatusData; } /** - * No description - * @tags orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. + * @tags repos + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches */ - export namespace OrgsListMembershipsForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ - state?: OrgsListMembershipsForAuthenticatedUserParams1StateEnum; + export namespace ReposCreateDispatchEvent { + export type RequestParams = { + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposCreateDispatchEventPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsListMembershipsForAuthenticatedUserData; + export type ResponseBody = ReposCreateDispatchEventData; } /** - * No description - * @tags orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} + * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). + * @tags repos + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - export namespace OrgsUpdateMembershipForAuthenticatedUser { + export namespace ReposCreateFork { export type RequestParams = { - org: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = OrgsUpdateMembershipForAuthenticatedUserPayload; + export type RequestBody = ReposCreateForkPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateMembershipForAuthenticatedUserData; + export type ResponseBody = ReposCreateForkData; } /** - * No description - * @tags projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @description Creates a new file or replaces an existing file in a repository. + * @tags repos + * @name ReposCreateOrUpdateFileContents + * @summary Create or update file contents + * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - export namespace ProjectsCreateForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposCreateOrUpdateFileContents { + export type RequestParams = { + owner: string; + /** path+ parameter */ + path: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForAuthenticatedUserPayload; + export type RequestBody = ReposCreateOrUpdateFileContentsPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForAuthenticatedUserData; + export type ResponseBody = ReposCreateOrUpdateFileContentsData; } /** - * No description + * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * @tags repos - * @name ReposAcceptInvitation - * @summary Accept a repository invitation - * @request PATCH:/user/repository_invitations/{invitation_id} + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - export namespace ReposAcceptInvitation { + export namespace ReposCreatePagesSite { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreatePagesSitePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAcceptInvitationData; + export type ResponseBody = ReposCreatePagesSiteData; } /** - * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * @tags repos - * @name ReposCreateForAuthenticatedUser - * @summary Create a repository for the authenticated user - * @request POST:/user/repos + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - export namespace ReposCreateForAuthenticatedUser { - export type RequestParams = {}; + export namespace ReposCreateRelease { + export type RequestParams = { + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = ReposCreateForAuthenticatedUserPayload; + export type RequestBody = ReposCreateReleasePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateForAuthenticatedUserData; + export type ResponseBody = ReposCreateReleaseData; } /** - * No description + * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository * @tags repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - export namespace ReposDeclineInvitation { + export namespace ReposCreateUsingTemplate { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; + templateOwner: string; + templateRepo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateUsingTemplatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeclineInvitationData; + export type ResponseBody = ReposCreateUsingTemplateData; } /** - * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. * @tags repos - * @name ReposListForAuthenticatedUser - * @summary List repositories for the authenticated user - * @request GET:/user/repos + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - export namespace ReposListForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Comma-separated list of values. Can include: - * \\* \`owner\`: Repositories that are owned by the authenticated user. - * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. - * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. - * @default "owner,collaborator,organization_member" - */ - affiliation?: string; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: ReposListForAuthenticatedUserParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: ReposListForAuthenticatedUserParams1SortEnum; - /** - * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` - * - * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. - * @default "all" - */ - type?: ReposListForAuthenticatedUserParams1TypeEnum; - /** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ - visibility?: ReposListForAuthenticatedUserParams1VisibilityEnum; + export namespace ReposCreateWebhook { + export type RequestParams = { + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposCreateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposListForAuthenticatedUserData; + export type ResponseBody = ReposCreateWebhookData; } /** - * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. * @tags repos - * @name ReposListInvitationsForAuthenticatedUser - * @summary List repository invitations for the authenticated user - * @request GET:/user/repository_invitations + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - export namespace ReposListInvitationsForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposDelete { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListInvitationsForAuthenticatedUserData; + export type ResponseBody = ReposDeleteData; } /** - * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). - * @tags teams - * @name TeamsListForAuthenticatedUser - * @summary List teams for the authenticated user - * @request GET:/user/teams + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. + * @tags repos + * @name ReposDeleteAccessRestrictions + * @summary Delete access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - export namespace TeamsListForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposDeleteAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListForAuthenticatedUserData; + export type ResponseBody = ReposDeleteAccessRestrictionsData; } /** - * @description This endpoint is accessible with the \`user\` scope. - * @tags users - * @name UsersAddEmailForAuthenticated - * @summary Add an email address for the authenticated user - * @request POST:/user/emails + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @tags repos + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - export namespace UsersAddEmailForAuthenticated { - export type RequestParams = {}; + export namespace ReposDeleteAdminBranchProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersAddEmailForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersAddEmailForAuthenticatedData; + export type ResponseBody = ReposDeleteAdminBranchProtectionData; } /** - * No description - * @tags users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - export namespace UsersBlock { + export namespace ReposDeleteBranchProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersBlockData; + export type ResponseBody = ReposDeleteBranchProtectionData; } /** * No description - * @tags users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} + * @tags repos + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - export namespace UsersCheckBlocked { + export namespace ReposDeleteCommitComment { export type RequestParams = { - username: string; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCheckBlockedData; + export type ResponseBody = ReposDeleteCommitCommentData; } /** - * No description - * @tags users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. + * @tags repos + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace UsersCheckPersonIsFollowedByAuthenticated { + export namespace ReposDeleteCommitSignatureProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCheckPersonIsFollowedByAuthenticatedData; + export type ResponseBody = ReposDeleteCommitSignatureProtectionData; } /** - * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersCreateGpgKeyForAuthenticated - * @summary Create a GPG key for the authenticated user - * @request POST:/user/gpg_keys + * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. + * @tags repos + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} */ - export namespace UsersCreateGpgKeyForAuthenticated { - export type RequestParams = {}; + export namespace ReposDeleteDeployKey { + export type RequestParams = { + /** key_id parameter */ + keyId: number; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersCreateGpgKeyForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCreateGpgKeyForAuthenticatedData; + export type ResponseBody = ReposDeleteDeployKeyData; } /** - * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersCreatePublicSshKeyForAuthenticated - * @summary Create a public SSH key for the authenticated user - * @request POST:/user/keys + * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." + * @tags repos + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} */ - export namespace UsersCreatePublicSshKeyForAuthenticated { - export type RequestParams = {}; + export namespace ReposDeleteDeployment { + export type RequestParams = { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersCreatePublicSshKeyForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCreatePublicSshKeyForAuthenticatedData; + export type ResponseBody = ReposDeleteDeploymentData; } /** - * @description This endpoint is accessible with the \`user\` scope. - * @tags users - * @name UsersDeleteEmailForAuthenticated - * @summary Delete an email address for the authenticated user - * @request DELETE:/user/emails + * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. + * @tags repos + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - export namespace UsersDeleteEmailForAuthenticated { - export type RequestParams = {}; + export namespace ReposDeleteFile { + export type RequestParams = { + owner: string; + /** path+ parameter */ + path: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersDeleteEmailForAuthenticatedPayload; + export type RequestBody = ReposDeleteFilePayload; export type RequestHeaders = {}; - export type ResponseBody = UsersDeleteEmailForAuthenticatedData; + export type ResponseBody = ReposDeleteFileData; } /** - * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersDeleteGpgKeyForAuthenticated - * @summary Delete a GPG key for the authenticated user - * @request DELETE:/user/gpg_keys/{gpg_key_id} + * No description + * @tags repos + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - export namespace UsersDeleteGpgKeyForAuthenticated { + export namespace ReposDeleteInvitation { export type RequestParams = { - /** gpg_key_id parameter */ - gpgKeyId: number; + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersDeleteGpgKeyForAuthenticatedData; + export type ResponseBody = ReposDeleteInvitationData; } /** - * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersDeletePublicSshKeyForAuthenticated - * @summary Delete a public SSH key for the authenticated user - * @request DELETE:/user/keys/{key_id} + * No description + * @tags repos + * @name ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages */ - export namespace UsersDeletePublicSshKeyForAuthenticated { + export namespace ReposDeletePagesSite { export type RequestParams = { - /** key_id parameter */ - keyId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersDeletePublicSshKeyForAuthenticatedData; + export type ResponseBody = ReposDeletePagesSiteData; } /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. - * @tags users - * @name UsersFollow - * @summary Follow a user - * @request PUT:/user/following/{username} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - export namespace UsersFollow { + export namespace ReposDeletePullRequestReviewProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersFollowData; + export type ResponseBody = ReposDeletePullRequestReviewProtectionData; } /** - * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. - * @tags users - * @name UsersGetAuthenticated - * @summary Get the authenticated user - * @request GET:/user + * @description Users with push access to the repository can delete a release. + * @tags repos + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - export namespace UsersGetAuthenticated { - export type RequestParams = {}; + export namespace ReposDeleteRelease { + export type RequestParams = { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; + }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetAuthenticatedData; + export type ResponseBody = ReposDeleteReleaseData; } /** - * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersGetGpgKeyForAuthenticated - * @summary Get a GPG key for the authenticated user - * @request GET:/user/gpg_keys/{gpg_key_id} + * No description + * @tags repos + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - export namespace UsersGetGpgKeyForAuthenticated { + export namespace ReposDeleteReleaseAsset { export type RequestParams = { - /** gpg_key_id parameter */ - gpgKeyId: number; + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetGpgKeyForAuthenticatedData; + export type ResponseBody = ReposDeleteReleaseAssetData; } /** - * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersGetPublicSshKeyForAuthenticated - * @summary Get a public SSH key for the authenticated user - * @request GET:/user/keys/{key_id} + * No description + * @tags repos + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - export namespace UsersGetPublicSshKeyForAuthenticated { + export namespace ReposDeleteWebhook { export type RequestParams = { - /** key_id parameter */ - keyId: number; + hookId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetPublicSshKeyForAuthenticatedData; + export type ResponseBody = ReposDeleteWebhookData; } /** - * @description List the users you've blocked on your personal account. - * @tags users - * @name UsersListBlockedByAuthenticated - * @summary List users blocked by the authenticated user - * @request GET:/user/blocks + * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * @tags repos + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes */ - export namespace UsersListBlockedByAuthenticated { - export type RequestParams = {}; + export namespace ReposDisableAutomatedSecurityFixes { + export type RequestParams = { + owner: string; + repo: string; + }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListBlockedByAuthenticatedData; + export type ResponseBody = ReposDisableAutomatedSecurityFixesData; } /** - * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. - * @tags users - * @name UsersListEmailsForAuthenticated - * @summary List email addresses for the authenticated user - * @request GET:/user/emails + * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @tags repos + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace UsersListEmailsForAuthenticated { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposDisableVulnerabilityAlerts { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListEmailsForAuthenticatedData; + export type ResponseBody = ReposDisableVulnerabilityAlertsData; } /** - * @description Lists the people who the authenticated user follows. - * @tags users - * @name UsersListFollowedByAuthenticated - * @summary List the people the authenticated user follows - * @request GET:/user/following + * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * @tags repos + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - export namespace UsersListFollowedByAuthenticated { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposDownloadTarballArchive { + export type RequestParams = { + owner: string; + ref: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowedByAuthenticatedData; + export type ResponseBody = any; } /** - * @description Lists the people following the authenticated user. - * @tags users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * @tags repos + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - export namespace UsersListFollowersForAuthenticatedUser { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposDownloadZipballArchive { + export type RequestParams = { + owner: string; + ref: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowersForAuthenticatedUserData; + export type ResponseBody = any; } /** - * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersListGpgKeysForAuthenticated - * @summary List GPG keys for the authenticated user - * @request GET:/user/gpg_keys + * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * @tags repos + * @name ReposEnableAutomatedSecurityFixes + * @summary Enable automated security fixes + * @request PUT:/repos/{owner}/{repo}/automated-security-fixes */ - export namespace UsersListGpgKeysForAuthenticated { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposEnableAutomatedSecurityFixes { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListGpgKeysForAuthenticatedData; + export type ResponseBody = ReposEnableAutomatedSecurityFixesData; } /** - * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. - * @tags users - * @name UsersListPublicEmailsForAuthenticated - * @summary List public email addresses for the authenticated user - * @request GET:/user/public_emails + * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @tags repos + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace UsersListPublicEmailsForAuthenticated { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposEnableVulnerabilityAlerts { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicEmailsForAuthenticatedData; + export type ResponseBody = ReposEnableVulnerabilityAlertsData; } /** - * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * @tags users - * @name UsersListPublicSshKeysForAuthenticated - * @summary List public SSH keys for the authenticated user - * @request GET:/user/keys + * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. + * @tags repos + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} */ - export namespace UsersListPublicSshKeysForAuthenticated { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace ReposGet { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicSshKeysForAuthenticatedData; + export type ResponseBody = ReposGetData; } /** - * @description Sets the visibility for your primary email addresses. - * @tags users - * @name UsersSetPrimaryEmailVisibilityForAuthenticated - * @summary Set primary email visibility for the authenticated user - * @request PATCH:/user/email/visibility + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. + * @tags repos + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - export namespace UsersSetPrimaryEmailVisibilityForAuthenticated { - export type RequestParams = {}; + export namespace ReposGetAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = - UsersSetPrimaryEmailVisibilityForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - UsersSetPrimaryEmailVisibilityForAuthenticatedData; + export type ResponseBody = ReposGetAccessRestrictionsData; } /** - * No description - * @tags users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - export namespace UsersUnblock { + export namespace ReposGetAdminBranchProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUnblockData; + export type ResponseBody = ReposGetAdminBranchProtectionData; } /** - * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. - * @tags users - * @name UsersUnfollow - * @summary Unfollow a user - * @request DELETE:/user/following/{username} + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - export namespace UsersUnfollow { + export namespace ReposGetAllStatusCheckContexts { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUnfollowData; + export type ResponseBody = ReposGetAllStatusCheckContextsData; } /** - * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. - * @tags users - * @name UsersUpdateAuthenticated - * @summary Update the authenticated user - * @request PATCH:/user + * No description + * @tags repos + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - export namespace UsersUpdateAuthenticated { - export type RequestParams = {}; + export namespace ReposGetAllTopics { + export type RequestParams = { + owner: string; + repo: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersUpdateAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUpdateAuthenticatedData; + export type ResponseBody = ReposGetAllTopicsData; } -} -export namespace Users { /** - * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. - * @tags activity - * @name ActivityListEventsForAuthenticatedUser - * @summary List events for the authenticated user - * @request GET:/users/{username}/events + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. + * @tags repos + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - export namespace ActivityListEventsForAuthenticatedUser { + export namespace ReposGetAppsWithAccessToProtectedBranch { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListEventsForAuthenticatedUserData; + export type ResponseBody = ReposGetAppsWithAccessToProtectedBranchData; } /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. - * @tags activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} + * No description + * @tags repos + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - export namespace ActivityListOrgEventsForAuthenticatedUser { + export namespace ReposGetBranch { export type RequestParams = { - org: string; - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListOrgEventsForAuthenticatedUserData; + export type ResponseBody = ReposGetBranchData; } /** - * No description - * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - export namespace ActivityListPublicEventsForUser { + export namespace ReposGetBranchProtection { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicEventsForUserData; + export type ResponseBody = ReposGetBranchProtectionData; } /** - * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. - * @tags activity - * @name ActivityListReceivedEventsForUser - * @summary List events received by the authenticated user - * @request GET:/users/{username}/received_events + * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @tags repos + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones */ - export namespace ActivityListReceivedEventsForUser { + export namespace ReposGetClones { export type RequestParams = { - username: string; + owner: string; + repo: string; }; export type RequestQuery = { /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - per_page?: number; + per?: ReposGetClonesParams1PerEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReceivedEventsForUserData; + export type ResponseBody = ReposGetClonesData; } /** - * No description - * @tags activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * @tags repos + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - export namespace ActivityListReceivedPublicEventsForUser { + export namespace ReposGetCodeFrequencyStats { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReceivedPublicEventsForUserData; + export type ResponseBody = ReposGetCodeFrequencyStatsData; } /** - * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: - * @tags activity - * @name ActivityListReposStarredByUser - * @summary List repositories starred by a user - * @request GET:/users/{username}/starred + * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. + * @tags repos + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - export namespace ActivityListReposStarredByUser { + export namespace ReposGetCollaboratorPermissionLevel { export type RequestParams = { + owner: string; + repo: string; username: string; }; - export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: ActivityListReposStarredByUserParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: ActivityListReposStarredByUserParams1SortEnum; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReposStarredByUserData; + export type ResponseBody = ReposGetCollaboratorPermissionLevelData; } /** - * @description Lists repositories a user is watching. - * @tags activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` + * @tags repos + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - export namespace ActivityListReposWatchedByUser { + export namespace ReposGetCombinedStatusForRef { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReposWatchedByUserData; + export type ResponseBody = ReposGetCombinedStatusForRefData; } /** - * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * @tags apps - * @name AppsGetUserInstallation - * @summary Get a user installation for the authenticated app - * @request GET:/users/{username}/installation + * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags repos + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} */ - export namespace AppsGetUserInstallation { + export namespace ReposGetCommit { export type RequestParams = { - username: string; + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsGetUserInstallationData; + export type ResponseBody = ReposGetCommitData; } /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. - * @tags billing - * @name BillingGetGithubActionsBillingUser - * @summary Get GitHub Actions billing for a user - * @request GET:/users/{username}/settings/billing/actions + * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. + * @tags repos + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - export namespace BillingGetGithubActionsBillingUser { + export namespace ReposGetCommitActivityStats { export type RequestParams = { - username: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubActionsBillingUserData; + export type ResponseBody = ReposGetCommitActivityStatsData; } /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. - * @tags billing - * @name BillingGetGithubPackagesBillingUser - * @summary Get GitHub Packages billing for a user - * @request GET:/users/{username}/settings/billing/packages + * No description + * @tags repos + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - export namespace BillingGetGithubPackagesBillingUser { + export namespace ReposGetCommitComment { export type RequestParams = { - username: string; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubPackagesBillingUserData; + export type ResponseBody = ReposGetCommitCommentData; } /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. - * @tags billing - * @name BillingGetSharedStorageBillingUser - * @summary Get shared storage billing for a user - * @request GET:/users/{username}/settings/billing/shared-storage + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. + * @tags repos + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace BillingGetSharedStorageBillingUser { + export namespace ReposGetCommitSignatureProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetSharedStorageBillingUserData; + export type ResponseBody = ReposGetCommitSignatureProtectionData; } /** - * @description Lists public gists for the specified user: - * @tags gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. + * @tags repos + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - export namespace GistsListForUser { + export namespace ReposGetCommunityProfileMetrics { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GistsListForUserData; + export type ResponseBody = ReposGetCommunityProfileMetricsData; } /** - * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. - * @tags orgs - * @name OrgsListForUser - * @summary List organizations for a user - * @request GET:/users/{username}/orgs + * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. + * @tags repos + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} */ - export namespace OrgsListForUser { + export namespace ReposGetContent { export type RequestParams = { - username: string; + owner: string; + /** path+ parameter */ + path: string; + repo: string; }; export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsListForUserData; + export type ResponseBody = ReposGetContentData; } /** - * No description - * @tags projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits + * @tags repos + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors */ - export namespace ProjectsListForUser { + export namespace ReposGetContributorsStats { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: ProjectsListForUserParams1StateEnum; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListForUserData; + export type ResponseBody = ReposGetContributorsStatsData; } /** - * @description Lists public repositories for the specified user. + * No description * @tags repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} */ - export namespace ReposListForUser { + export namespace ReposGetDeployKey { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: ReposListForUserParams1DirectionEnum; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: ReposListForUserParams1SortEnum; - /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" - */ - type?: ReposListForUserParams1TypeEnum; + /** key_id parameter */ + keyId: number; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListForUserData; + export type ResponseBody = ReposGetDeployKeyData; } /** * No description - * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} + * @tags repos + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} */ - export namespace UsersCheckFollowingForUser { + export namespace ReposGetDeployment { export type RequestParams = { - targetUser: string; - username: string; + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCheckFollowingForUserData; + export type ResponseBody = ReposGetDeploymentData; } /** - * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". - * @tags users - * @name UsersGetByUsername - * @summary Get a user - * @request GET:/users/{username} + * @description Users with pull access can view a deployment status for a deployment: + * @tags repos + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - export namespace UsersGetByUsername { + export namespace ReposGetDeploymentStatus { export type RequestParams = { - username: string; + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; + statusId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetByUsernameData; + export type ResponseBody = ReposGetDeploymentStatusData; } /** - * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` - * @tags users - * @name UsersGetContextForUser - * @summary Get contextual information for a user - * @request GET:/users/{username}/hovercard + * No description + * @tags repos + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - export namespace UsersGetContextForUser { + export namespace ReposGetLatestPagesBuild { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ - subject_id?: string; - /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ - subject_type?: UsersGetContextForUserParams1SubjectTypeEnum; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetContextForUserData; + export type ResponseBody = ReposGetLatestPagesBuildData; } /** - * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. - * @tags users - * @name UsersList - * @summary List users - * @request GET:/users + * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. + * @tags repos + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest */ - export namespace UsersList { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; + export namespace ReposGetLatestRelease { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListData; + export type ResponseBody = ReposGetLatestReleaseData; } /** - * @description Lists the people following the specified user. - * @tags users - * @name UsersListFollowersForUser - * @summary List followers of a user - * @request GET:/users/{username}/followers + * No description + * @tags repos + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - export namespace UsersListFollowersForUser { + export namespace ReposGetPages { export type RequestParams = { - username: string; - }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowersForUserData; + export type ResponseBody = ReposGetPagesData; } /** - * @description Lists the people who the specified user follows. - * @tags users - * @name UsersListFollowingForUser - * @summary List the people a user follows - * @request GET:/users/{username}/following + * No description + * @tags repos + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - export namespace UsersListFollowingForUser { + export namespace ReposGetPagesBuild { export type RequestParams = { - username: string; + buildId: number; + owner: string; + repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetPagesBuildData; + } + + /** + * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. + * @tags repos + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation + */ + export namespace ReposGetParticipationStats { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowingForUserData; + export type ResponseBody = ReposGetParticipationStatsData; } /** - * @description Lists the GPG keys for a user. This information is accessible by anyone. - * @tags users - * @name UsersListGpgKeysForUser - * @summary List GPG keys for a user - * @request GET:/users/{username}/gpg_keys + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - export namespace UsersListGpgKeysForUser { + export namespace ReposGetPullRequestReviewProtection { export type RequestParams = { - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetPullRequestReviewProtectionData; + } + + /** + * @description 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. + * @tags repos + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card + */ + export namespace ReposGetPunchCardStats { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListGpgKeysForUserData; + export type ResponseBody = ReposGetPunchCardStatsData; } /** - * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. - * @tags users - * @name UsersListPublicKeysForUser - * @summary List public keys for a user - * @request GET:/users/{username}/keys + * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + * @tags repos + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - export namespace UsersListPublicKeysForUser { + export namespace ReposGetReadme { export type RequestParams = { - username: string; + owner: string; + repo: string; }; export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicKeysForUserData; + export type ResponseBody = ReposGetReadmeData; } -} -export namespace Zen { /** - * @description Get a random sentence from the Zen of GitHub - * @tags meta - * @name MetaGetZen - * @summary Get the Zen of GitHub - * @request GET:/zen + * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). + * @tags repos + * @name ReposGetRelease + * @summary Get a release + * @request GET:/repos/{owner}/{repo}/releases/{release_id} */ - export namespace MetaGetZen { - export type RequestParams = {}; + export namespace ReposGetRelease { + export type RequestParams = { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; + }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MetaGetZenData; + export type ResponseBody = ReposGetReleaseData; } -} - -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -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); + /** + * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. + * @tags repos + * @name ReposGetReleaseAsset + * @summary Get a release asset + * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + */ + export namespace ReposGetReleaseAsset { + export type RequestParams = { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetReleaseAssetData; } - 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}\`)}\`; + /** + * @description Get a published release with the specified tag. + * @tags repos + * @name ReposGetReleaseByTag + * @summary Get a release by tag name + * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + */ + export namespace ReposGetReleaseByTag { + export type RequestParams = { + owner: string; + repo: string; + /** tag+ parameter */ + tag: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetReleaseByTagData; } - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposGetStatusChecksProtection + * @summary Get status checks protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + */ + export namespace ReposGetStatusChecksProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetStatusChecksProtectionData; } - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. + * @tags repos + * @name ReposGetTeamsWithAccessToProtectedBranch + * @summary Get teams with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + */ + export namespace ReposGetTeamsWithAccessToProtectedBranch { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetTeamsWithAccessToProtectedBranchData; } - 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("&"); + /** + * @description Get the top 10 popular contents over the last 14 days. + * @tags repos + * @name ReposGetTopPaths + * @summary Get top referral paths + * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + */ + export namespace ReposGetTopPaths { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetTopPathsData; } - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; + /** + * @description Get the top 10 referrers over the last 14 days. + * @tags repos + * @name ReposGetTopReferrers + * @summary Get top referral sources + * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + */ + export namespace ReposGetTopReferrers { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetTopReferrersData; } - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } - - return 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), - }; + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. + * @tags repos + * @name ReposGetUsersWithAccessToProtectedBranch + * @summary Get users with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + */ + export namespace ReposGetUsersWithAccessToProtectedBranch { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetUsersWithAccessToProtectedBranchData; + } - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, + /** + * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @tags repos + * @name ReposGetViews + * @summary Get page views + * @request GET:/repos/{owner}/{repo}/traffic/views + */ + export namespace ReposGetViews { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ + per?: ReposGetViewsParams1PerEnum; }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetViewsData; } - 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; - } + /** + * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." + * @tags repos + * @name ReposGetWebhook + * @summary Get a repository webhook + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + */ + export namespace ReposGetWebhook { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetWebhookData; + } - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. + * @tags repos + * @name ReposGetWebhookConfigForRepo + * @summary Get a webhook configuration for a repository + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + */ + export namespace ReposGetWebhookConfigForRepo { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposGetWebhookConfigForRepoData; + } - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * No description + * @tags repos + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches + */ + export namespace ReposListBranches { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ + protected?: boolean; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListBranchesData; + } - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + * @tags repos + * @name ReposListBranchesForHeadCommit + * @summary List branches for HEAD commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + */ + export namespace ReposListBranchesForHeadCommit { + export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListBranchesForHeadCommitData; + } - 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; + /** + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * @tags repos + * @name ReposListCollaborators + * @summary List repository collaborators + * @request GET:/repos/{owner}/{repo}/collaborators + */ + export namespace ReposListCollaborators { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Filter collaborators returned by their affiliation. Can be one of: + * \\* \`outside\`: All outside collaborators of an organization-owned repository. + * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ + affiliation?: ReposListCollaboratorsParams1AffiliationEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListCollaboratorsData; + } - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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; + /** + * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * @tags repos + * @name ReposListCommentsForCommit + * @summary List commit comments + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + */ + export namespace ReposListCommentsForCommit { + export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListCommentsForCommitData; + } - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. + * @tags repos + * @name ReposListCommitCommentsForRepo + * @summary List commit comments for a repository + * @request GET:/repos/{owner}/{repo}/comments + */ + export namespace ReposListCommitCommentsForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListCommitCommentsForRepoData; + } - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @tags repos + * @name ReposListCommits + * @summary List commits + * @request GET:/repos/{owner}/{repo}/commits + */ + export namespace ReposListCommits { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** GitHub login or email address by which to filter by commit author. */ + author?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** Only commits containing this file path will be returned. */ + path?: string; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ + sha?: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + until?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListCommitsData; + } - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. + * @tags repos + * @name ReposListCommitStatusesForRef + * @summary List commit statuses for a reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + */ + export namespace ReposListCommitStatusesForRef { + export type RequestParams = { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListCommitStatusesForRefData; + } -/** - * @title GitHub v3 REST API - * @version 1.1.4 - * @license MIT (https://spdx.org/licenses/MIT) - * @termsOfService https://docs.github.com/articles/github-terms-of-service - * @baseUrl https://api.github.com - * @externalDocs https://docs.github.com/rest/ - * @contact Support (https://support.github.com/contact) - * - * GitHub's v3 REST API. - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { /** - * @description Get Hypermedia links to resources accessible in GitHub's REST API - * - * @tags meta - * @name MetaRoot - * @summary GitHub API Root - * @request GET:/ + * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. + * @tags repos + * @name ReposListContributors + * @summary List repository contributors + * @request GET:/repos/{owner}/{repo}/contributors */ - metaRoot = (params: RequestParams = {}) => - this.request({ - path: \`/\`, - method: "GET", - format: "json", - ...params, - }); + export namespace ReposListContributors { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ + anon?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListContributorsData; + } - app = { - /** - * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsCreateInstallationAccessToken - * @summary Create an installation access token for an app - * @request POST:/app/installations/{installation_id}/access_tokens - */ - appsCreateInstallationAccessToken: ( - { installationId }: AppsCreateInstallationAccessTokenParams, - data: AppsCreateInstallationAccessTokenPayload, - params: RequestParams = {}, - ) => - this.request< - AppsCreateInstallationAccessTokenData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/app/installations/\${installationId}/access_tokens\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * No description + * @tags repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys + */ + export namespace ReposListDeployKeys { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListDeployKeysData; + } + + /** + * @description Simple filtering of deployments is available via query parameters: + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments + */ + export namespace ReposListDeployments { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). + * @default "none" + */ + environment?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * The name of the ref. This can be a branch, tag, or SHA. + * @default "none" + */ + ref?: string; + /** + * The SHA recorded at creation time. + * @default "none" + */ + sha?: string; + /** + * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). + * @default "none" + */ + task?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListDeploymentsData; + } + + /** + * @description Users with pull access can view deployment statuses for a deployment: + * @tags repos + * @name ReposListDeploymentStatuses + * @summary List deployment statuses + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + */ + export namespace ReposListDeploymentStatuses { + export type RequestParams = { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListDeploymentStatusesData; + } + + /** + * No description + * @tags repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks + */ + export namespace ReposListForks { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ + sort?: ReposListForksParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListForksData; + } + + /** + * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. + * @tags repos + * @name ReposListInvitations + * @summary List repository invitations + * @request GET:/repos/{owner}/{repo}/invitations + */ + export namespace ReposListInvitations { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListInvitationsData; + } + + /** + * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. + * @tags repos + * @name ReposListLanguages + * @summary List repository languages + * @request GET:/repos/{owner}/{repo}/languages + */ + export namespace ReposListLanguages { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListLanguagesData; + } + + /** + * No description + * @tags repos + * @name ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds + */ + export namespace ReposListPagesBuilds { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListPagesBuildsData; + } + + /** + * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. + * @tags repos + * @name ReposListPullRequestsAssociatedWithCommit + * @summary List pull requests associated with a commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + */ + export namespace ReposListPullRequestsAssociatedWithCommit { + export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListPullRequestsAssociatedWithCommitData; + } + + /** + * No description + * @tags repos + * @name ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + */ + export namespace ReposListReleaseAssets { + export type RequestParams = { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListReleaseAssetsData; + } + + /** + * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + * @tags repos + * @name ReposListReleases + * @summary List releases + * @request GET:/repos/{owner}/{repo}/releases + */ + export namespace ReposListReleases { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListReleasesData; + } + + /** + * No description + * @tags repos + * @name ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags + */ + export namespace ReposListTags { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListTagsData; + } + + /** + * No description + * @tags repos + * @name ReposListTeams + * @summary List repository teams + * @request GET:/repos/{owner}/{repo}/teams + */ + export namespace ReposListTeams { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListTeamsData; + } + + /** + * No description + * @tags repos + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks + */ + export namespace ReposListWebhooks { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListWebhooksData; + } + + /** + * No description + * @tags repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges + */ + export namespace ReposMerge { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposMergePayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposMergeData; + } + + /** + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @tags repos + * @name ReposPingWebhook + * @summary Ping a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + */ + export namespace ReposPingWebhook { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposPingWebhookData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposRemoveAppAccessRestrictions + * @summary Remove app access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + */ + export namespace ReposRemoveAppAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposRemoveAppAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveAppAccessRestrictionsData; + } + + /** + * No description + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + */ + export namespace ReposRemoveCollaborator { + export type RequestParams = { + owner: string; + repo: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveCollaboratorData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposRemoveStatusCheckContexts + * @summary Remove status check contexts + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + */ + export namespace ReposRemoveStatusCheckContexts { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposRemoveStatusCheckContextsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveStatusCheckContextsData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposRemoveStatusCheckProtection + * @summary Remove status check protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + */ + export namespace ReposRemoveStatusCheckProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveStatusCheckProtectionData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposRemoveTeamAccessRestrictions + * @summary Remove team access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + */ + export namespace ReposRemoveTeamAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposRemoveTeamAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveTeamAccessRestrictionsData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposRemoveUserAccessRestrictions + * @summary Remove user access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + */ + export namespace ReposRemoveUserAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposRemoveUserAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposRemoveUserAccessRestrictionsData; + } + + /** + * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. + * @tags repos + * @name ReposRenameBranch + * @summary Rename a branch + * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + */ + export namespace ReposRenameBranch { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposRenameBranchPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposRenameBranchData; + } + + /** + * No description + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics + */ + export namespace ReposReplaceAllTopics { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposReplaceAllTopicsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposReplaceAllTopicsData; + } + + /** + * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. + * @tags repos + * @name ReposRequestPagesBuild + * @summary Request a GitHub Pages build + * @request POST:/repos/{owner}/{repo}/pages/builds + */ + export namespace ReposRequestPagesBuild { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposRequestPagesBuildData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @tags repos + * @name ReposSetAdminBranchProtection + * @summary Set admin branch protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + */ + export namespace ReposSetAdminBranchProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposSetAdminBranchProtectionData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposSetAppAccessRestrictions + * @summary Set app access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + */ + export namespace ReposSetAppAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposSetAppAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposSetAppAccessRestrictionsData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @tags repos + * @name ReposSetStatusCheckContexts + * @summary Set status check contexts + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + */ + export namespace ReposSetStatusCheckContexts { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposSetStatusCheckContextsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposSetStatusCheckContextsData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposSetTeamAccessRestrictions + * @summary Set team access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + */ + export namespace ReposSetTeamAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposSetTeamAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposSetTeamAccessRestrictionsData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @tags repos + * @name ReposSetUserAccessRestrictions + * @summary Set user access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + */ + export namespace ReposSetUserAccessRestrictions { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposSetUserAccessRestrictionsPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposSetUserAccessRestrictionsData; + } + + /** + * @description 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/:hook_id/test\` + * @tags repos + * @name ReposTestPushWebhook + * @summary Test the push repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + */ + export namespace ReposTestPushWebhook { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposTestPushWebhookData; + } + + /** + * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). + * @tags repos + * @name ReposTransfer + * @summary Transfer a repository + * @request POST:/repos/{owner}/{repo}/transfer + */ + export namespace ReposTransfer { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposTransferPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposTransferData; + } + + /** + * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. + * @tags repos + * @name ReposUpdate + * @summary Update a repository + * @request PATCH:/repos/{owner}/{repo} + */ + export namespace ReposUpdate { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdatePayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. + * @tags repos + * @name ReposUpdateBranchProtection + * @summary Update branch protection + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + */ + export namespace ReposUpdateBranchProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateBranchProtectionPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateBranchProtectionData; + } + + /** + * No description + * @tags repos + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + */ + export namespace ReposUpdateCommitComment { + export type RequestParams = { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateCommitCommentPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateCommitCommentData; + } + + /** + * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). + * @tags repos + * @name ReposUpdateInformationAboutPagesSite + * @summary Update information about a GitHub Pages site + * @request PUT:/repos/{owner}/{repo}/pages + */ + export namespace ReposUpdateInformationAboutPagesSite { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateInformationAboutPagesSitePayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateInformationAboutPagesSiteData; + } + + /** + * No description + * @tags repos + * @name ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + */ + export namespace ReposUpdateInvitation { + export type RequestParams = { + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateInvitationPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateInvitationData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. + * @tags repos + * @name ReposUpdatePullRequestReviewProtection + * @summary Update pull request review protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + */ + export namespace ReposUpdatePullRequestReviewProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdatePullRequestReviewProtectionPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdatePullRequestReviewProtectionData; + } + + /** + * @description Users with push access to the repository can edit a release. + * @tags repos + * @name ReposUpdateRelease + * @summary Update a release + * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + */ + export namespace ReposUpdateRelease { + export type RequestParams = { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateReleasePayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateReleaseData; + } + + /** + * @description Users with push access to the repository can edit a release asset. + * @tags repos + * @name ReposUpdateReleaseAsset + * @summary Update a release asset + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} + */ + export namespace ReposUpdateReleaseAsset { + export type RequestParams = { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateReleaseAssetPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateReleaseAssetData; + } + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + * @tags repos + * @name ReposUpdateStatusCheckProtection + * @summary Update status check protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + */ + export namespace ReposUpdateStatusCheckProtection { + export type RequestParams = { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateStatusCheckProtectionPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateStatusCheckProtectionData; + } + + /** + * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." + * @tags repos + * @name ReposUpdateWebhook + * @summary Update a repository webhook + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + */ + export namespace ReposUpdateWebhook { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateWebhookPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateWebhookData; + } + + /** + * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. + * @tags repos + * @name ReposUpdateWebhookConfigForRepo + * @summary Update a webhook configuration for a repository + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + */ + export namespace ReposUpdateWebhookConfigForRepo { + export type RequestParams = { + hookId: number; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateWebhookConfigForRepoPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUpdateWebhookConfigForRepoData; + } + + /** + * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + * @tags repos + * @name ReposUploadReleaseAsset + * @summary Upload a release asset + * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + */ + export namespace ReposUploadReleaseAsset { + export type RequestParams = { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; + }; + export type RequestQuery = { + label?: string; + name?: string; + }; + export type RequestBody = ReposUploadReleaseAssetPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposUploadReleaseAssetData; + } + + /** + * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * @tags secret-scanning + * @name SecretScanningGetAlert + * @summary Get a secret scanning alert + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + */ + export namespace SecretScanningGetAlert { + export type RequestParams = { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SecretScanningGetAlertData; + } + + /** + * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * @tags secret-scanning + * @name SecretScanningListAlertsForRepo + * @summary List secret scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + */ + export namespace SecretScanningListAlertsForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ + state?: SecretScanningListAlertsForRepoParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SecretScanningListAlertsForRepoData; + } + + /** + * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. + * @tags secret-scanning + * @name SecretScanningUpdateAlert + * @summary Update a secret scanning alert + * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + */ + export namespace SecretScanningUpdateAlert { + export type RequestParams = { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = SecretScanningUpdateAlertPayload; + export type RequestHeaders = {}; + export type ResponseBody = SecretScanningUpdateAlertData; + } +} + +export namespace Repositories { + /** + * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + * @tags repos + * @name ReposListPublic + * @summary List public repositories + * @request GET:/repositories + */ + export namespace ReposListPublic { + export type RequestParams = {}; + export type RequestQuery = { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListPublicData; + } +} + +export namespace Scim { + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @tags enterprise-admin + * @name EnterpriseAdminDeleteScimGroupFromEnterprise + * @summary Delete a SCIM group from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + export namespace EnterpriseAdminDeleteScimGroupFromEnterprise { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = EnterpriseAdminDeleteScimGroupFromEnterpriseData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @tags enterprise-admin + * @name EnterpriseAdminDeleteUserFromEnterprise + * @summary Delete a SCIM user from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + export namespace EnterpriseAdminDeleteUserFromEnterprise { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = EnterpriseAdminDeleteUserFromEnterpriseData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup + * @summary Get SCIM provisioning information for an enterprise group + * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + export namespace EnterpriseAdminGetProvisioningInformationForEnterpriseGroup { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser + * @summary Get SCIM provisioning information for an enterprise user + * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + export namespace EnterpriseAdminGetProvisioningInformationForEnterpriseUser { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedGroupsEnterprise + * @summary List provisioned SCIM groups for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Groups + */ + export namespace EnterpriseAdminListProvisionedGroupsEnterprise { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + }; + export type RequestQuery = { + /** Used for pagination: the number of results to return. */ + count?: number; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminListProvisionedGroupsEnterpriseData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedIdentitiesEnterprise + * @summary List SCIM provisioned identities for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Users + */ + export namespace EnterpriseAdminListProvisionedIdentitiesEnterprise { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + }; + export type RequestQuery = { + /** Used for pagination: the number of results to return. */ + count?: number; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminListProvisionedIdentitiesEnterpriseData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup + * @summary Provision a SCIM enterprise group and invite users + * @request POST:/scim/v2/enterprises/{enterprise}/Groups + */ + export namespace EnterpriseAdminProvisionAndInviteEnterpriseGroup { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminProvisionAndInviteEnterpriseGroupData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseUser + * @summary Provision and invite a SCIM enterprise user + * @request POST:/scim/v2/enterprises/{enterprise}/Users + */ + export namespace EnterpriseAdminProvisionAndInviteEnterpriseUser { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminProvisionAndInviteEnterpriseUserData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup + * @summary Set SCIM information for a provisioned enterprise group + * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseGroup { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser + * @summary Set SCIM information for a provisioned enterprise user + * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseUser { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup + * @summary Update an attribute for a SCIM enterprise group + * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + export namespace EnterpriseAdminUpdateAttributeForEnterpriseGroup { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Identifier generated by the GitHub SCIM endpoint. */ + scimGroupId: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupData; + } + + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseUser + * @summary Update an attribute for a SCIM enterprise user + * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + export namespace EnterpriseAdminUpdateAttributeForEnterpriseUser { + export type RequestParams = { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminUpdateAttributeForEnterpriseUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = + EnterpriseAdminUpdateAttributeForEnterpriseUserData; + } + + /** + * No description + * @tags scim + * @name ScimDeleteUserFromOrg + * @summary Delete a SCIM user from an organization + * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + export namespace ScimDeleteUserFromOrg { + export type RequestParams = { + org: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ScimDeleteUserFromOrgData; + } + + /** + * No description + * @tags scim + * @name ScimGetProvisioningInformationForUser + * @summary Get SCIM provisioning information for a user + * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + export namespace ScimGetProvisioningInformationForUser { + export type RequestParams = { + org: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ScimGetProvisioningInformationForUserData; + } + + /** + * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. + * @tags scim + * @name ScimListProvisionedIdentities + * @summary List SCIM provisioned identities + * @request GET:/scim/v2/organizations/{org}/Users + */ + export namespace ScimListProvisionedIdentities { + export type RequestParams = { + org: string; + }; + export type RequestQuery = { + /** Used for pagination: the number of results to return. */ + count?: number; + /** + * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: + * + * \`?filter=userName%20eq%20\\"Octocat\\"\`. + * + * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: + * + * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. + */ + filter?: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ScimListProvisionedIdentitiesData; + } + + /** + * @description Provision organization membership for a user, and send an activation email to the email address. + * @tags scim + * @name ScimProvisionAndInviteUser + * @summary Provision and invite a SCIM user + * @request POST:/scim/v2/organizations/{org}/Users + */ + export namespace ScimProvisionAndInviteUser { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = ScimProvisionAndInviteUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = ScimProvisionAndInviteUserData; + } + + /** + * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * @tags scim + * @name ScimSetInformationForProvisionedUser + * @summary Update a provisioned organization membership + * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + export namespace ScimSetInformationForProvisionedUser { + export type RequestParams = { + org: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = ScimSetInformationForProvisionedUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = ScimSetInformationForProvisionedUserData; + } + + /** + * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * @tags scim + * @name ScimUpdateAttributeForUser + * @summary Update an attribute for a SCIM user + * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + export namespace ScimUpdateAttributeForUser { + export type RequestParams = { + org: string; + /** scim_user_id parameter */ + scimUserId: string; + }; + export type RequestQuery = {}; + export type RequestBody = ScimUpdateAttributeForUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = ScimUpdateAttributeForUserData; + } +} - /** - * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsDeleteInstallation - * @summary Delete an installation for the authenticated app - * @request DELETE:/app/installations/{installation_id} - */ - appsDeleteInstallation: ( - { installationId }: AppsDeleteInstallationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}\`, - method: "DELETE", - ...params, - }), +export namespace Search { + /** + * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + * @tags search + * @name SearchCode + * @summary Search code + * @request GET:/search/code + */ + export namespace SearchCode { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchCodeParams1OrderEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchCodeParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchCodeData; + } - /** - * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetAuthenticated - * @summary Get the authenticated app - * @request GET:/app - */ - appsGetAuthenticated: (params: RequestParams = {}) => - this.request({ - path: \`/app\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` + * @tags search + * @name SearchCommits + * @summary Search commits + * @request GET:/search/commits + */ + export namespace SearchCommits { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchCommitsParams1OrderEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchCommitsParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchCommitsData; + } - /** - * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetInstallation - * @summary Get an installation for the authenticated app - * @request GET:/app/installations/{installation_id} - */ - appsGetInstallation: ( - { installationId }: AppsGetInstallationParams, - params: RequestParams = {}, - ) => - this.request< - AppsGetInstallationData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/app/installations/\${installationId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + * @tags search + * @name SearchIssuesAndPullRequests + * @summary Search issues and pull requests + * @request GET:/search/issues + */ + export namespace SearchIssuesAndPullRequests { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchIssuesAndPullRequestsParams1OrderEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchIssuesAndPullRequestsParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchIssuesAndPullRequestsData; + } - /** - * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetWebhookConfigForApp - * @summary Get a webhook configuration for an app - * @request GET:/app/hook/config - */ - appsGetWebhookConfigForApp: (params: RequestParams = {}) => - this.request({ - path: \`/app/hook/config\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. + * @tags search + * @name SearchLabels + * @summary Search labels + * @request GET:/search/labels + */ + export namespace SearchLabels { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchLabelsParams1OrderEnum; + /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + /** The id of the repository. */ + repository_id: number; + /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchLabelsParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchLabelsData; + } + + /** + * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` + * @tags search + * @name SearchRepos + * @summary Search repositories + * @request GET:/search/repositories + */ + export namespace SearchRepos { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchReposParams1OrderEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchReposParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchReposData; + } + + /** + * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. + * @tags search + * @name SearchTopics + * @summary Search topics + * @request GET:/search/topics + */ + export namespace SearchTopics { + export type RequestParams = {}; + export type RequestQuery = { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchTopicsData; + } + + /** + * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + * @tags search + * @name SearchUsers + * @summary Search users + * @request GET:/search/users + */ + export namespace SearchUsers { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: SearchUsersParams1OrderEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: SearchUsersParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = SearchUsersData; + } +} + +export namespace Teams { + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. + * @tags reactions + * @name ReactionsCreateForTeamDiscussionCommentLegacy + * @summary Create reaction for a team discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated + */ + export namespace ReactionsCreateForTeamDiscussionCommentLegacy { + export type RequestParams = { + commentNumber: number; + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = + ReactionsCreateForTeamDiscussionCommentLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = + ReactionsCreateForTeamDiscussionCommentLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. + * @tags reactions + * @name ReactionsCreateForTeamDiscussionLegacy + * @summary Create reaction for a team discussion (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + export namespace ReactionsCreateForTeamDiscussionLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForTeamDiscussionLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsCreateForTeamDiscussionLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags reactions + * @name ReactionsListForTeamDiscussionCommentLegacy + * @summary List reactions for a team discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated + */ + export namespace ReactionsListForTeamDiscussionCommentLegacy { + export type RequestParams = { + commentNumber: number; + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsListForTeamDiscussionCommentLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags reactions + * @name ReactionsListForTeamDiscussionLegacy + * @summary List reactions for a team discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + export namespace ReactionsListForTeamDiscussionLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: ReactionsListForTeamDiscussionLegacyParams1ContentEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReactionsListForTeamDiscussionLegacyData; + } + + /** + * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags teams + * @name TeamsAddMemberLegacy + * @summary Add team member (Legacy) + * @request PUT:/teams/{team_id}/members/{username} + * @deprecated + */ + export namespace TeamsAddMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsAddMemberLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserLegacy + * @summary Add or update team membership for a user (Legacy) + * @request PUT:/teams/{team_id}/memberships/{username} + * @deprecated + */ + export namespace TeamsAddOrUpdateMembershipForUserLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsAddOrUpdateMembershipForUserLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsAddOrUpdateMembershipForUserLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsLegacy + * @summary Add or update team project permissions (Legacy) + * @request PUT:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + export namespace TeamsAddOrUpdateProjectPermissionsLegacy { + export type RequestParams = { + projectId: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsAddOrUpdateProjectPermissionsLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsAddOrUpdateProjectPermissionsLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsLegacy + * @summary Add or update team repository permissions (Legacy) + * @request PUT:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + export namespace TeamsAddOrUpdateRepoPermissionsLegacy { + export type RequestParams = { + owner: string; + repo: string; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsAddOrUpdateRepoPermissionsLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsAddOrUpdateRepoPermissionsLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. + * @tags teams + * @name TeamsCheckPermissionsForProjectLegacy + * @summary Check team permissions for a project (Legacy) + * @request GET:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + export namespace TeamsCheckPermissionsForProjectLegacy { + export type RequestParams = { + projectId: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsCheckPermissionsForProjectLegacyData; + } + + /** + * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @tags teams + * @name TeamsCheckPermissionsForRepoLegacy + * @summary Check team permissions for a repository (Legacy) + * @request GET:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + export namespace TeamsCheckPermissionsForRepoLegacy { + export type RequestParams = { + owner: string; + repo: string; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsCheckPermissionsForRepoLegacyData; + } - /** - * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. - * - * @tags apps - * @name AppsListInstallations - * @summary List installations for the authenticated app - * @request GET:/app/installations - */ - appsListInstallations: ( - query: AppsListInstallationsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags teams + * @name TeamsCreateDiscussionCommentLegacy + * @summary Create a discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated + */ + export namespace TeamsCreateDiscussionCommentLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsCreateDiscussionCommentLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsCreateDiscussionCommentLegacyData; + } - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsSuspendInstallation - * @summary Suspend an app installation - * @request PUT:/app/installations/{installation_id}/suspended - */ - appsSuspendInstallation: ( - { installationId }: AppsSuspendInstallationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}/suspended\`, - method: "PUT", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @tags teams + * @name TeamsCreateDiscussionLegacy + * @summary Create a discussion (Legacy) + * @request POST:/teams/{team_id}/discussions + * @deprecated + */ + export namespace TeamsCreateDiscussionLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsCreateDiscussionLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsCreateDiscussionLegacyData; + } - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsUnsuspendInstallation - * @summary Unsuspend an app installation - * @request DELETE:/app/installations/{installation_id}/suspended - */ - appsUnsuspendInstallation: ( - { installationId }: AppsUnsuspendInstallationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}/suspended\`, - method: "DELETE", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy + * @summary Create or update IdP group connections (Legacy) + * @request PATCH:/teams/{team_id}/team-sync/group-mappings + * @deprecated + */ + export namespace TeamsCreateOrUpdateIdpGroupConnectionsLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = + TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyData; + } - /** - * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsUpdateWebhookConfigForApp - * @summary Update a webhook configuration for an app - * @request PATCH:/app/hook/config - */ - appsUpdateWebhookConfigForApp: ( - data: AppsUpdateWebhookConfigForAppPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/hook/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - appManifests = { - /** - * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. - * - * @tags apps - * @name AppsCreateFromManifest - * @summary Create a GitHub App from a manifest - * @request POST:/app-manifests/{code}/conversions - */ - appsCreateFromManifest: ( - { code }: AppsCreateFromManifestParams, - params: RequestParams = {}, - ) => - this.request< - AppsCreateFromManifestData, - BasicError | ValidationErrorSimple - >({ - path: \`/app-manifests/\${code}/conversions\`, - method: "POST", - format: "json", - ...params, - }), - }; - applications = { - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsCheckAuthorization - * @summary Check an authorization - * @request GET:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsCheckAuthorization: ( - { clientId, accessToken }: AppsCheckAuthorizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsDeleteDiscussionCommentLegacy + * @summary Delete a discussion comment (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + export namespace TeamsDeleteDiscussionCommentLegacy { + export type RequestParams = { + commentNumber: number; + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsDeleteDiscussionCommentLegacyData; + } - /** - * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsCheckToken - * @summary Check a token - * @request POST:/applications/{client_id}/token - */ - appsCheckToken: ( - { clientId }: AppsCheckTokenParams, - data: AppsCheckTokenPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsDeleteDiscussionLegacy + * @summary Delete a discussion (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + export namespace TeamsDeleteDiscussionLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsDeleteDiscussionLegacyData; + } - /** - * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * - * @tags apps - * @name AppsDeleteAuthorization - * @summary Delete an app authorization - * @request DELETE:/applications/{client_id}/grant - */ - appsDeleteAuthorization: ( - { clientId }: AppsDeleteAuthorizationParams, - data: AppsDeleteAuthorizationPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/grant\`, - method: "DELETE", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * @tags teams + * @name TeamsDeleteLegacy + * @summary Delete a team (Legacy) + * @request DELETE:/teams/{team_id} + * @deprecated + */ + export namespace TeamsDeleteLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsDeleteLegacyData; + } - /** - * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * - * @tags apps - * @name AppsDeleteToken - * @summary Delete an app token - * @request DELETE:/applications/{client_id}/token - */ - appsDeleteToken: ( - { clientId }: AppsDeleteTokenParams, - data: AppsDeleteTokenPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "DELETE", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsGetDiscussionCommentLegacy + * @summary Get a discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + export namespace TeamsGetDiscussionCommentLegacy { + export type RequestParams = { + commentNumber: number; + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsGetDiscussionCommentLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsResetAuthorization - * @summary Reset an authorization - * @request POST:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsResetAuthorization: ( - { clientId, accessToken }: AppsResetAuthorizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "POST", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsGetDiscussionLegacy + * @summary Get a discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + export namespace TeamsGetDiscussionLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsGetDiscussionLegacyData; + } - /** - * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsResetToken - * @summary Reset a token - * @request PATCH:/applications/{client_id}/token - */ - appsResetToken: ( - { clientId }: AppsResetTokenParams, - data: AppsResetTokenPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * @tags teams + * @name TeamsGetLegacy + * @summary Get a team (Legacy) + * @request GET:/teams/{team_id} + * @deprecated + */ + export namespace TeamsGetLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsGetLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * - * @tags apps - * @name AppsRevokeAuthorizationForApplication - * @summary Revoke an authorization for an application - * @request DELETE:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsRevokeAuthorizationForApplication: ( - { clientId, accessToken }: AppsRevokeAuthorizationForApplicationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "DELETE", - ...params, - }), + /** + * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. + * @tags teams + * @name TeamsGetMemberLegacy + * @summary Get team member (Legacy) + * @request GET:/teams/{team_id}/members/{username} + * @deprecated + */ + export namespace TeamsGetMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsGetMemberLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). - * - * @tags apps - * @name AppsRevokeGrantForApplication - * @summary Revoke a grant for an application - * @request DELETE:/applications/{client_id}/grants/{access_token} - * @deprecated - */ - appsRevokeGrantForApplication: ( - { clientId, accessToken }: AppsRevokeGrantForApplicationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/grants/\${accessToken}\`, - method: "DELETE", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @tags teams + * @name TeamsGetMembershipForUserLegacy + * @summary Get team membership for a user (Legacy) + * @request GET:/teams/{team_id}/memberships/{username} + * @deprecated + */ + export namespace TeamsGetMembershipForUserLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsGetMembershipForUserLegacyData; + } - /** - * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsScopeToken - * @summary Create a scoped access token - * @request POST:/applications/{client_id}/token/scoped - */ - appsScopeToken: ( - { clientId }: AppsScopeTokenParams, - data: AppsScopeTokenPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token/scoped\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. + * @tags teams + * @name TeamsListChildLegacy + * @summary List child teams (Legacy) + * @request GET:/teams/{team_id}/teams + * @deprecated + */ + export namespace TeamsListChildLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListChildLegacyData; + } + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsListDiscussionCommentsLegacy + * @summary List discussion comments (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated + */ + export namespace TeamsListDiscussionCommentsLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: TeamsListDiscussionCommentsLegacyParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListDiscussionCommentsLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteGrant - * @summary Delete a grant - * @request DELETE:/applications/grants/{grant_id} - * @deprecated - */ - oauthAuthorizationsDeleteGrant: ( - { grantId }: OauthAuthorizationsDeleteGrantParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants/\${grantId}\`, - method: "DELETE", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsListDiscussionsLegacy + * @summary List discussions (Legacy) + * @request GET:/teams/{team_id}/discussions + * @deprecated + */ + export namespace TeamsListDiscussionsLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: TeamsListDiscussionsLegacyParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListDiscussionsLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetGrant - * @summary Get a single grant - * @request GET:/applications/grants/{grant_id} - * @deprecated - */ - oauthAuthorizationsGetGrant: ( - { grantId }: OauthAuthorizationsGetGrantParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants/\${grantId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. + * @tags teams + * @name TeamsListIdpGroupsForLegacy + * @summary List IdP groups for a team (Legacy) + * @request GET:/teams/{team_id}/team-sync/group-mappings + * @deprecated + */ + export namespace TeamsListIdpGroupsForLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListIdpGroupsForLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. - * - * @tags oauth-authorizations - * @name OauthAuthorizationsListGrants - * @summary List your grants - * @request GET:/applications/grants - * @deprecated - */ - oauthAuthorizationsListGrants: ( - query: OauthAuthorizationsListGrantsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - apps = { - /** - * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsGetBySlug - * @summary Get an app - * @request GET:/apps/{app_slug} - */ - appsGetBySlug: ( - { appSlug }: AppsGetBySlugParams, - params: RequestParams = {}, - ) => - this.request< - AppsGetBySlugData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/apps/\${appSlug}\`, - method: "GET", - format: "json", - ...params, - }), - }; - authorizations = { - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsCreateAuthorization - * @summary Create a new authorization - * @request POST:/authorizations - * @deprecated - */ - oauthAuthorizationsCreateAuthorization: ( - data: OauthAuthorizationsCreateAuthorizationPayload, - params: RequestParams = {}, - ) => - this.request< - OauthAuthorizationsCreateAuthorizationData, - BasicError | ValidationError - >({ - path: \`/authorizations\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * @tags teams + * @name TeamsListMembersLegacy + * @summary List team members (Legacy) + * @request GET:/teams/{team_id}/members + * @deprecated + */ + export namespace TeamsListMembersLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ + role?: TeamsListMembersLegacyParams1RoleEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListMembersLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteAuthorization - * @summary Delete an authorization - * @request DELETE:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsDeleteAuthorization: ( - { authorizationId }: OauthAuthorizationsDeleteAuthorizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "DELETE", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * @tags teams + * @name TeamsListPendingInvitationsLegacy + * @summary List pending team invitations (Legacy) + * @request GET:/teams/{team_id}/invitations + * @deprecated + */ + export namespace TeamsListPendingInvitationsLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListPendingInvitationsLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetAuthorization - * @summary Get a single authorization - * @request GET:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsGetAuthorization: ( - { authorizationId }: OauthAuthorizationsGetAuthorizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. + * @tags teams + * @name TeamsListProjectsLegacy + * @summary List team projects (Legacy) + * @request GET:/teams/{team_id}/projects + * @deprecated + */ + export namespace TeamsListProjectsLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListProjectsLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForApp - * @summary Get-or-create an authorization for a specific app - * @request PUT:/authorizations/clients/{client_id} - * @deprecated - */ - oauthAuthorizationsGetOrCreateAuthorizationForApp: ( - { clientId }: OauthAuthorizationsGetOrCreateAuthorizationForAppParams, - data: OauthAuthorizationsGetOrCreateAuthorizationForAppPayload, - params: RequestParams = {}, - ) => - this.request< - OauthAuthorizationsGetOrCreateAuthorizationForAppData, - BasicError | ValidationError - >({ - path: \`/authorizations/clients/\${clientId}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * @tags teams + * @name TeamsListReposLegacy + * @summary List team repositories (Legacy) + * @request GET:/teams/{team_id}/repos + * @deprecated + */ + export namespace TeamsListReposLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListReposLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint - * @summary Get-or-create an authorization for a specific app and fingerprint - * @request PUT:/authorizations/clients/{client_id}/{fingerprint} - * @deprecated - */ - oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( - { - clientId, - fingerprint, - }: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintParams, - data: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload, - params: RequestParams = {}, - ) => - this.request< - OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData, - ValidationError - >({ - path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * @tags teams + * @name TeamsRemoveMemberLegacy + * @summary Remove team member (Legacy) + * @request DELETE:/teams/{team_id}/members/{username} + * @deprecated + */ + export namespace TeamsRemoveMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsRemoveMemberLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsListAuthorizations - * @summary List your authorizations - * @request GET:/authorizations - * @deprecated - */ - oauthAuthorizationsListAuthorizations: ( - query: OauthAuthorizationsListAuthorizationsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * @tags teams + * @name TeamsRemoveMembershipForUserLegacy + * @summary Remove team membership for a user (Legacy) + * @request DELETE:/teams/{team_id}/memberships/{username} + * @deprecated + */ + export namespace TeamsRemoveMembershipForUserLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsRemoveMembershipForUserLegacyData; + } - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. - * - * @tags oauth-authorizations - * @name OauthAuthorizationsUpdateAuthorization - * @summary Update an existing authorization - * @request PATCH:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsUpdateAuthorization: ( - { authorizationId }: OauthAuthorizationsUpdateAuthorizationParams, - data: OauthAuthorizationsUpdateAuthorizationPayload, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/authorizations/\${authorizationId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }, - ), - }; - codesOfConduct = { - /** - * No description - * - * @tags codes-of-conduct - * @name CodesOfConductGetAllCodesOfConduct - * @summary Get all codes of conduct - * @request GET:/codes_of_conduct - */ - codesOfConductGetAllCodesOfConduct: (params: RequestParams = {}) => - this.request< - CodesOfConductGetAllCodesOfConductData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/codes_of_conduct\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + * @tags teams + * @name TeamsRemoveProjectLegacy + * @summary Remove a project from a team (Legacy) + * @request DELETE:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + export namespace TeamsRemoveProjectLegacy { + export type RequestParams = { + projectId: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsRemoveProjectLegacyData; + } - /** - * No description - * - * @tags codes-of-conduct - * @name CodesOfConductGetConductCode - * @summary Get a code of conduct - * @request GET:/codes_of_conduct/{key} - */ - codesOfConductGetConductCode: ( - { key }: CodesOfConductGetConductCodeParams, - params: RequestParams = {}, - ) => - this.request< - CodesOfConductGetConductCodeData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/codes_of_conduct/\${key}\`, - method: "GET", - format: "json", - ...params, - }), - }; - contentReferences = { - /** - * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsCreateContentAttachment - * @summary Create a content attachment - * @request POST:/content_references/{content_reference_id}/attachments - */ - appsCreateContentAttachment: ( - { contentReferenceId }: AppsCreateContentAttachmentParams, - data: AppsCreateContentAttachmentPayload, - params: RequestParams = {}, - ) => - this.request< - AppsCreateContentAttachmentData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/content_references/\${contentReferenceId}/attachments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - emojis = { - /** - * @description Lists all the emojis available to use on GitHub. - * - * @tags emojis - * @name EmojisGet - * @summary Get emojis - * @request GET:/emojis - */ - emojisGet: (params: RequestParams = {}) => - this.request({ - path: \`/emojis\`, - method: "GET", - format: "json", - ...params, - }), - }; - enterprises = { - /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. - * - * @tags audit-log - * @name AuditLogGetAuditLog - * @summary Get the audit log for an enterprise - * @request GET:/enterprises/{enterprise}/audit-log - */ - auditLogGetAuditLog: ( - { enterprise, ...query }: AuditLogGetAuditLogParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/audit-log\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + * @tags teams + * @name TeamsRemoveRepoLegacy + * @summary Remove a repository from a team (Legacy) + * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + export namespace TeamsRemoveRepoLegacy { + export type RequestParams = { + owner: string; + repo: string; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsRemoveRepoLegacyData; + } - /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetGithubActionsBillingGhe - * @summary Get GitHub Actions billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/actions - */ - billingGetGithubActionsBillingGhe: ( - { enterprise }: BillingGetGithubActionsBillingGheParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/actions\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsUpdateDiscussionCommentLegacy + * @summary Update a discussion comment (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + export namespace TeamsUpdateDiscussionCommentLegacy { + export type RequestParams = { + commentNumber: number; + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsUpdateDiscussionCommentLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsUpdateDiscussionCommentLegacyData; + } - /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetGithubPackagesBillingGhe - * @summary Get GitHub Packages billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/packages - */ - billingGetGithubPackagesBillingGhe: ( - { enterprise }: BillingGetGithubPackagesBillingGheParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/packages\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags teams + * @name TeamsUpdateDiscussionLegacy + * @summary Update a discussion (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + export namespace TeamsUpdateDiscussionLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsUpdateDiscussionLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsUpdateDiscussionLegacyData; + } - /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetSharedStorageBillingGhe - * @summary Get shared storage billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage - */ - billingGetSharedStorageBillingGhe: ( - { enterprise }: BillingGetSharedStorageBillingGheParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. + * @tags teams + * @name TeamsUpdateLegacy + * @summary Update a team (Legacy) + * @request PATCH:/teams/{team_id} + * @deprecated + */ + export namespace TeamsUpdateLegacy { + export type RequestParams = { + teamId: number; + }; + export type RequestQuery = {}; + export type RequestBody = TeamsUpdateLegacyPayload; + export type RequestHeaders = {}; + export type ResponseBody = TeamsUpdateLegacyData; + } +} - /** - * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Add organization access to a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - */ - enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - { - enterprise, - runnerGroupId, - orgId, - }: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, - method: "PUT", - ...params, - }), +export namespace User { + /** + * No description + * @tags activity + * @name ActivityCheckRepoIsStarredByAuthenticatedUser + * @summary Check if a repository is starred by the authenticated user + * @request GET:/user/starred/{owner}/{repo} + */ + export namespace ActivityCheckRepoIsStarredByAuthenticatedUser { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + ActivityCheckRepoIsStarredByAuthenticatedUserData; + } - /** - * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise - * @summary Add a self-hosted runner to a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - runnerId, - }: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "PUT", - ...params, - }), + /** + * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @tags activity + * @name ActivityListReposStarredByAuthenticatedUser + * @summary List repositories starred by the authenticated user + * @request GET:/user/starred + */ + export namespace ActivityListReposStarredByAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: ActivityListReposStarredByAuthenticatedUserParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: ActivityListReposStarredByAuthenticatedUserParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListReposStarredByAuthenticatedUserData; + } - /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateRegistrationTokenForEnterprise - * @summary Create a registration token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/registration-token - */ - enterpriseAdminCreateRegistrationTokenForEnterprise: ( - { enterprise }: EnterpriseAdminCreateRegistrationTokenForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminCreateRegistrationTokenForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, - method: "POST", - format: "json", - ...params, - }), + /** + * @description Lists repositories the authenticated user is watching. + * @tags activity + * @name ActivityListWatchedReposForAuthenticatedUser + * @summary List repositories watched by the authenticated user + * @request GET:/user/subscriptions + */ + export namespace ActivityListWatchedReposForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListWatchedReposForAuthenticatedUserData; + } - /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateRemoveTokenForEnterprise - * @summary Create a remove token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/remove-token - */ - enterpriseAdminCreateRemoveTokenForEnterprise: ( - { enterprise }: EnterpriseAdminCreateRemoveTokenForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, - method: "POST", - format: "json", - ...params, - }), + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @tags activity + * @name ActivityStarRepoForAuthenticatedUser + * @summary Star a repository for the authenticated user + * @request PUT:/user/starred/{owner}/{repo} + */ + export namespace ActivityStarRepoForAuthenticatedUser { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityStarRepoForAuthenticatedUserData; + } - /** - * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise - * @summary Create a self-hosted runner group for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runner-groups - */ - enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( - { - enterprise, - }: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseParams, - data: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * No description + * @tags activity + * @name ActivityUnstarRepoForAuthenticatedUser + * @summary Unstar a repository for the authenticated user + * @request DELETE:/user/starred/{owner}/{repo} + */ + export namespace ActivityUnstarRepoForAuthenticatedUser { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityUnstarRepoForAuthenticatedUserData; + } - /** - * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise - * @summary Delete a self-hosted runner from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} - */ - enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( - { - enterprise, - runnerId, - }: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @tags apps + * @name AppsAddRepoToInstallation + * @summary Add a repository to an app installation + * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + */ + export namespace AppsAddRepoToInstallation { + export type RequestParams = { + /** installation_id parameter */ + installationId: number; + repositoryId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsAddRepoToInstallationData; + } + + /** + * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. + * @tags apps + * @name AppsListInstallationReposForAuthenticatedUser + * @summary List repositories accessible to the user access token + * @request GET:/user/installations/{installation_id}/repositories + */ + export namespace AppsListInstallationReposForAuthenticatedUser { + export type RequestParams = { + /** installation_id parameter */ + installationId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + AppsListInstallationReposForAuthenticatedUserData; + } - /** - * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise - * @summary Delete a self-hosted runner group from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( - { - enterprise, - runnerGroupId, - }: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. + * @tags apps + * @name AppsListInstallationsForAuthenticatedUser + * @summary List app installations accessible to the user access token + * @request GET:/user/installations + */ + export namespace AppsListInstallationsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsListInstallationsForAuthenticatedUserData; + } - /** - * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise - * @summary Disable a selected organization for GitHub Actions in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} - */ - enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( - { - enterprise, - orgId, - }: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUser + * @summary List subscriptions for the authenticated user + * @request GET:/user/marketplace_purchases + */ + export namespace AppsListSubscriptionsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsListSubscriptionsForAuthenticatedUserData; + } - /** - * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise - * @summary Enable a selected organization for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} - */ - enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( - { - enterprise, - orgId, - }: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, - method: "PUT", - ...params, - }), + /** + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUserStubbed + * @summary List subscriptions for the authenticated user (stubbed) + * @request GET:/user/marketplace_purchases/stubbed + */ + export namespace AppsListSubscriptionsForAuthenticatedUserStubbed { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + AppsListSubscriptionsForAuthenticatedUserStubbedData; + } - /** - * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetAllowedActionsEnterprise - * @summary Get allowed actions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions - */ - enterpriseAdminGetAllowedActionsEnterprise: ( - { enterprise }: EnterpriseAdminGetAllowedActionsEnterpriseParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @tags apps + * @name AppsRemoveRepoFromInstallation + * @summary Remove a repository from an app installation + * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + */ + export namespace AppsRemoveRepoFromInstallation { + export type RequestParams = { + /** installation_id parameter */ + installationId: number; + repositoryId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsRemoveRepoFromInstallationData; + } - /** - * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise - * @summary Get GitHub Actions permissions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions - */ - enterpriseAdminGetGithubActionsPermissionsEnterprise: ( - { - enterprise, - }: EnterpriseAdminGetGithubActionsPermissionsEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminGetGithubActionsPermissionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. + * @tags interactions + * @name InteractionsGetRestrictionsForAuthenticatedUser + * @summary Get interaction restrictions for your public repositories + * @request GET:/user/interaction-limits + */ + export namespace InteractionsGetRestrictionsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + InteractionsGetRestrictionsForAuthenticatedUserData; + } - /** - * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise - * @summary Get a self-hosted runner for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} - */ - enterpriseAdminGetSelfHostedRunnerForEnterprise: ( - { - enterprise, - runnerId, - }: EnterpriseAdminGetSelfHostedRunnerForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Removes any interaction restrictions from your public repositories. + * @tags interactions + * @name InteractionsRemoveRestrictionsForAuthenticatedUser + * @summary Remove interaction restrictions from your public repositories + * @request DELETE:/user/interaction-limits + */ + export namespace InteractionsRemoveRestrictionsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + InteractionsRemoveRestrictionsForAuthenticatedUserData; + } - /** - * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise - * @summary Get a self-hosted runner group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - }: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * @tags interactions + * @name InteractionsSetRestrictionsForAuthenticatedUser + * @summary Set interaction restrictions for your public repositories + * @request PUT:/user/interaction-limits + */ + export namespace InteractionsSetRestrictionsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = InteractionLimit; + export type RequestHeaders = {}; + export type ResponseBody = + InteractionsSetRestrictionsForAuthenticatedUserData; + } - /** - * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary List organization access to a self-hosted runner group in an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - */ - enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - { - enterprise, - runnerGroupId, - ...query - }: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @tags issues + * @name IssuesListForAuthenticatedUser + * @summary List user account issues assigned to the authenticated user + * @request GET:/user/issues + */ + export namespace IssuesListForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: IssuesListForAuthenticatedUserParams1DirectionEnum; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: IssuesListForAuthenticatedUserParams1FilterEnum; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: IssuesListForAuthenticatedUserParams1SortEnum; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: IssuesListForAuthenticatedUserParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = IssuesListForAuthenticatedUserData; + } - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListRunnerApplicationsForEnterprise - * @summary List runner applications for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/downloads - */ - enterpriseAdminListRunnerApplicationsForEnterprise: ( - { enterprise }: EnterpriseAdminListRunnerApplicationsForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, - method: "GET", - format: "json", - ...params, - }, - ), + /** + * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * @tags migrations + * @name MigrationsDeleteArchiveForAuthenticatedUser + * @summary Delete a user migration archive + * @request DELETE:/user/migrations/{migration_id}/archive + */ + export namespace MigrationsDeleteArchiveForAuthenticatedUser { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsDeleteArchiveForAuthenticatedUserData; + } - /** - * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary List selected organizations enabled for GitHub Actions in an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/organizations - */ - enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. + * @tags migrations + * @name MigrationsGetArchiveForAuthenticatedUser + * @summary Download a user migration archive + * @request GET:/user/migrations/{migration_id}/archive + */ + export namespace MigrationsGetArchiveForAuthenticatedUser { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = any; + } - /** - * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise - * @summary List self-hosted runner groups for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups - */ - enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + * @tags migrations + * @name MigrationsGetStatusForAuthenticatedUser + * @summary Get a user migration status + * @request GET:/user/migrations/{migration_id} + */ + export namespace MigrationsGetStatusForAuthenticatedUser { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + }; + export type RequestQuery = { + exclude?: string[]; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsGetStatusForAuthenticatedUserData; + } + + /** + * @description Lists all migrations a user has started. + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations + */ + export namespace MigrationsListForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsListForAuthenticatedUserData; + } - /** - * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersForEnterprise - * @summary List self-hosted runners for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners - */ - enterpriseAdminListSelfHostedRunnersForEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListSelfHostedRunnersForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Lists all the repositories for this user migration. + * @tags migrations + * @name MigrationsListReposForUser + * @summary List repositories for a user migration + * @request GET:/user/migrations/{migration_id}/repositories + */ + export namespace MigrationsListReposForUser { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsListReposForUserData; + } - /** - * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise - * @summary List self-hosted runners in a group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - */ - enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - ...query - }: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Initiates the generation of a user migration archive. + * @tags migrations + * @name MigrationsStartForAuthenticatedUser + * @summary Start a user migration + * @request POST:/user/migrations + */ + export namespace MigrationsStartForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = MigrationsStartForAuthenticatedUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsStartForAuthenticatedUserData; + } - /** - * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Remove organization access to a self-hosted runner group in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - */ - enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - { - enterprise, - runnerGroupId, - orgId, - }: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. + * @tags migrations + * @name MigrationsUnlockRepoForAuthenticatedUser + * @summary Unlock a user repository + * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + */ + export namespace MigrationsUnlockRepoForAuthenticatedUser { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + /** repo_name parameter */ + repoName: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MigrationsUnlockRepoForAuthenticatedUserData; + } - /** - * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise - * @summary Remove a self-hosted runner from a group for an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - runnerId, - }: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseParams, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), + /** + * No description + * @tags orgs + * @name OrgsGetMembershipForAuthenticatedUser + * @summary Get an organization membership for the authenticated user + * @request GET:/user/memberships/orgs/{org} + */ + export namespace OrgsGetMembershipForAuthenticatedUser { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetMembershipForAuthenticatedUserData; + } - /** - * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetAllowedActionsEnterprise - * @summary Set allowed actions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions - */ - enterpriseAdminSetAllowedActionsEnterprise: ( - { enterprise }: EnterpriseAdminSetAllowedActionsEnterpriseParams, - data: SelectedActions, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. + * @tags orgs + * @name OrgsListForAuthenticatedUser + * @summary List organizations for the authenticated user + * @request GET:/user/orgs + */ + export namespace OrgsListForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListForAuthenticatedUserData; + } - /** - * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise - * @summary Set GitHub Actions permissions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions - */ - enterpriseAdminSetGithubActionsPermissionsEnterprise: ( - { - enterprise, - }: EnterpriseAdminSetGithubActionsPermissionsEnterpriseParams, - data: EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminSetGithubActionsPermissionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * No description + * @tags orgs + * @name OrgsListMembershipsForAuthenticatedUser + * @summary List organization memberships for the authenticated user + * @request GET:/user/memberships/orgs + */ + export namespace OrgsListMembershipsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ + state?: OrgsListMembershipsForAuthenticatedUserParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListMembershipsForAuthenticatedUserData; + } - /** - * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Set organization access for a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - */ - enterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - { - enterprise, - runnerGroupId, - }: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, - data: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * No description + * @tags orgs + * @name OrgsUpdateMembershipForAuthenticatedUser + * @summary Update an organization membership for the authenticated user + * @request PATCH:/user/memberships/orgs/{org} + */ + export namespace OrgsUpdateMembershipForAuthenticatedUser { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = OrgsUpdateMembershipForAuthenticatedUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = OrgsUpdateMembershipForAuthenticatedUserData; + } - /** - * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary Set selected organizations enabled for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations - */ - enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( - { - enterprise, - }: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseParams, - data: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * No description + * @tags projects + * @name ProjectsCreateForAuthenticatedUser + * @summary Create a user project + * @request POST:/user/projects + */ + export namespace ProjectsCreateForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = ProjectsCreateForAuthenticatedUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = ProjectsCreateForAuthenticatedUserData; + } - /** - * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise - * @summary Set self-hosted runners in a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - */ - enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - }: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseParams, - data: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * No description + * @tags repos + * @name ReposAcceptInvitation + * @summary Accept a repository invitation + * @request PATCH:/user/repository_invitations/{invitation_id} + */ + export namespace ReposAcceptInvitation { + export type RequestParams = { + /** invitation_id parameter */ + invitationId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposAcceptInvitationData; + } - /** - * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise - * @summary Update a self-hosted runner group for an enterprise - * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( - { - enterprise, - runnerGroupId, - }: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseParams, - data: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload, - params: RequestParams = {}, - ) => - this.request< - EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - events = { - /** - * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. - * - * @tags activity - * @name ActivityListPublicEvents - * @summary List public events - * @request GET:/events - */ - activityListPublicEvents: ( - query: ActivityListPublicEventsParams, - params: RequestParams = {}, - ) => - this.request< - ActivityListPublicEventsData, - | BasicError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - feeds = { - /** - * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. - * - * @tags activity - * @name ActivityGetFeeds - * @summary Get feeds - * @request GET:/feeds - */ - activityGetFeeds: (params: RequestParams = {}) => - this.request({ - path: \`/feeds\`, - method: "GET", - format: "json", - ...params, - }), - }; - gists = { - /** - * No description - * - * @tags gists - * @name GistsCheckIsStarred - * @summary Check if a gist is starred - * @request GET:/gists/{gist_id}/star - */ - gistsCheckIsStarred: ( - { gistId }: GistsCheckIsStarredParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "GET", - ...params, - }), + /** + * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @tags repos + * @name ReposCreateForAuthenticatedUser + * @summary Create a repository for the authenticated user + * @request POST:/user/repos + */ + export namespace ReposCreateForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = ReposCreateForAuthenticatedUserPayload; + export type RequestHeaders = {}; + export type ResponseBody = ReposCreateForAuthenticatedUserData; + } - /** - * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. - * - * @tags gists - * @name GistsCreate - * @summary Create a gist - * @request POST:/gists - */ - gistsCreate: (data: GistsCreatePayload, params: RequestParams = {}) => - this.request({ - path: \`/gists\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * No description + * @tags repos + * @name ReposDeclineInvitation + * @summary Decline a repository invitation + * @request DELETE:/user/repository_invitations/{invitation_id} + */ + export namespace ReposDeclineInvitation { + export type RequestParams = { + /** invitation_id parameter */ + invitationId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposDeclineInvitationData; + } - /** - * No description - * - * @tags gists - * @name GistsCreateComment - * @summary Create a gist comment - * @request POST:/gists/{gist_id}/comments - */ - gistsCreateComment: ( - { gistId }: GistsCreateCommentParams, - data: GistsCreateCommentPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * @tags repos + * @name ReposListForAuthenticatedUser + * @summary List repositories for the authenticated user + * @request GET:/user/repos + */ + export namespace ReposListForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Comma-separated list of values. Can include: + * \\* \`owner\`: Repositories that are owned by the authenticated user. + * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. + * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + * @default "owner,collaborator,organization_member" + */ + affiliation?: string; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: ReposListForAuthenticatedUserParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: ReposListForAuthenticatedUserParams1SortEnum; + /** + * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` + * + * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * @default "all" + */ + type?: ReposListForAuthenticatedUserParams1TypeEnum; + /** + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" + */ + visibility?: ReposListForAuthenticatedUserParams1VisibilityEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListForAuthenticatedUserData; + } - /** - * No description - * - * @tags gists - * @name GistsDelete - * @summary Delete a gist - * @request DELETE:/gists/{gist_id} - */ - gistsDelete: ({ gistId }: GistsDeleteParams, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}\`, - method: "DELETE", - ...params, - }), + /** + * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * @tags repos + * @name ReposListInvitationsForAuthenticatedUser + * @summary List repository invitations for the authenticated user + * @request GET:/user/repository_invitations + */ + export namespace ReposListInvitationsForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListInvitationsForAuthenticatedUserData; + } - /** - * No description - * - * @tags gists - * @name GistsDeleteComment - * @summary Delete a gist comment - * @request DELETE:/gists/{gist_id}/comments/{comment_id} - */ - gistsDeleteComment: ( - { gistId, commentId }: GistsDeleteCommentParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "DELETE", - ...params, - }), + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). + * @tags teams + * @name TeamsListForAuthenticatedUser + * @summary List teams for the authenticated user + * @request GET:/user/teams + */ + export namespace TeamsListForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = TeamsListForAuthenticatedUserData; + } - /** - * @description **Note**: This was previously \`/gists/:gist_id/fork\`. - * - * @tags gists - * @name GistsFork - * @summary Fork a gist - * @request POST:/gists/{gist_id}/forks - */ - gistsFork: ({ gistId }: GistsForkParams, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/forks\`, - method: "POST", - format: "json", - ...params, - }), + /** + * @description This endpoint is accessible with the \`user\` scope. + * @tags users + * @name UsersAddEmailForAuthenticated + * @summary Add an email address for the authenticated user + * @request POST:/user/emails + */ + export namespace UsersAddEmailForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = UsersAddEmailForAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = UsersAddEmailForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsGet - * @summary Get a gist - * @request GET:/gists/{gist_id} - */ - gistsGet: ({ gistId }: GistsGetParams, params: RequestParams = {}) => - this.request< - GistsGetData, - | { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; - } - | BasicError - >({ - path: \`/gists/\${gistId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * No description + * @tags users + * @name UsersBlock + * @summary Block a user + * @request PUT:/user/blocks/{username} + */ + export namespace UsersBlock { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersBlockData; + } - /** - * No description - * - * @tags gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} - */ - gistsGetComment: ( - { gistId, commentId }: GistsGetCommentParams, - params: RequestParams = {}, - ) => - this.request< - GistsGetCommentData, - | { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; - } - | BasicError - >({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * No description + * @tags users + * @name UsersCheckBlocked + * @summary Check if a user is blocked by the authenticated user + * @request GET:/user/blocks/{username} + */ + export namespace UsersCheckBlocked { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersCheckBlockedData; + } - /** - * No description - * - * @tags gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} - */ - gistsGetRevision: ( - { gistId, sha }: GistsGetRevisionParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/\${sha}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * No description + * @tags users + * @name UsersCheckPersonIsFollowedByAuthenticated + * @summary Check if a person is followed by the authenticated user + * @request GET:/user/following/{username} + */ + export namespace UsersCheckPersonIsFollowedByAuthenticated { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersCheckPersonIsFollowedByAuthenticatedData; + } - /** - * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: - * - * @tags gists - * @name GistsList - * @summary List gists for the authenticated user - * @request GET:/gists - */ - gistsList: (query: GistsListParams, params: RequestParams = {}) => - this.request({ - path: \`/gists\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersCreateGpgKeyForAuthenticated + * @summary Create a GPG key for the authenticated user + * @request POST:/user/gpg_keys + */ + export namespace UsersCreateGpgKeyForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = UsersCreateGpgKeyForAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = UsersCreateGpgKeyForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments - */ - gistsListComments: ( - { gistId, ...query }: GistsListCommentsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersCreatePublicSshKeyForAuthenticated + * @summary Create a public SSH key for the authenticated user + * @request POST:/user/keys + */ + export namespace UsersCreatePublicSshKeyForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = UsersCreatePublicSshKeyForAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = UsersCreatePublicSshKeyForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits - */ - gistsListCommits: ( - { gistId, ...query }: GistsListCommitsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/commits\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description This endpoint is accessible with the \`user\` scope. + * @tags users + * @name UsersDeleteEmailForAuthenticated + * @summary Delete an email address for the authenticated user + * @request DELETE:/user/emails + */ + export namespace UsersDeleteEmailForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = UsersDeleteEmailForAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = UsersDeleteEmailForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks - */ - gistsListForks: ( - { gistId, ...query }: GistsListForksParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/forks\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersDeleteGpgKeyForAuthenticated + * @summary Delete a GPG key for the authenticated user + * @request DELETE:/user/gpg_keys/{gpg_key_id} + */ + export namespace UsersDeleteGpgKeyForAuthenticated { + export type RequestParams = { + /** gpg_key_id parameter */ + gpgKeyId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersDeleteGpgKeyForAuthenticatedData; + } + + /** + * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersDeletePublicSshKeyForAuthenticated + * @summary Delete a public SSH key for the authenticated user + * @request DELETE:/user/keys/{key_id} + */ + export namespace UsersDeletePublicSshKeyForAuthenticated { + export type RequestParams = { + /** key_id parameter */ + keyId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersDeletePublicSshKeyForAuthenticatedData; + } + + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * @tags users + * @name UsersFollow + * @summary Follow a user + * @request PUT:/user/following/{username} + */ + export namespace UsersFollow { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersFollowData; + } - /** - * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. - * - * @tags gists - * @name GistsListPublic - * @summary List public gists - * @request GET:/gists/public - */ - gistsListPublic: ( - query: GistsListPublicParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/public\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. + * @tags users + * @name UsersGetAuthenticated + * @summary Get the authenticated user + * @request GET:/user + */ + export namespace UsersGetAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersGetAuthenticatedData; + } - /** - * @description List the authenticated user's starred gists: - * - * @tags gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred - */ - gistsListStarred: ( - query: GistsListStarredParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/starred\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersGetGpgKeyForAuthenticated + * @summary Get a GPG key for the authenticated user + * @request GET:/user/gpg_keys/{gpg_key_id} + */ + export namespace UsersGetGpgKeyForAuthenticated { + export type RequestParams = { + /** gpg_key_id parameter */ + gpgKeyId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersGetGpgKeyForAuthenticatedData; + } - /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * - * @tags gists - * @name GistsStar - * @summary Star a gist - * @request PUT:/gists/{gist_id}/star - */ - gistsStar: ({ gistId }: GistsStarParams, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "PUT", - ...params, - }), + /** + * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersGetPublicSshKeyForAuthenticated + * @summary Get a public SSH key for the authenticated user + * @request GET:/user/keys/{key_id} + */ + export namespace UsersGetPublicSshKeyForAuthenticated { + export type RequestParams = { + /** key_id parameter */ + keyId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersGetPublicSshKeyForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsUnstar - * @summary Unstar a gist - * @request DELETE:/gists/{gist_id}/star - */ - gistsUnstar: ({ gistId }: GistsUnstarParams, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "DELETE", - ...params, - }), + /** + * @description List the users you've blocked on your personal account. + * @tags users + * @name UsersListBlockedByAuthenticated + * @summary List users blocked by the authenticated user + * @request GET:/user/blocks + */ + export namespace UsersListBlockedByAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListBlockedByAuthenticatedData; + } - /** - * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. - * - * @tags gists - * @name GistsUpdate - * @summary Update a gist - * @request PATCH:/gists/{gist_id} - */ - gistsUpdate: ( - { gistId }: GistsUpdateParams, - data: GistsUpdatePayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. + * @tags users + * @name UsersListEmailsForAuthenticated + * @summary List email addresses for the authenticated user + * @request GET:/user/emails + */ + export namespace UsersListEmailsForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListEmailsForAuthenticatedData; + } - /** - * No description - * - * @tags gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_id} - */ - gistsUpdateComment: ( - { gistId, commentId }: GistsUpdateCommentParams, - data: GistsUpdateCommentPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - gitignore = { - /** - * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). - * - * @tags gitignore - * @name GitignoreGetAllTemplates - * @summary Get all gitignore templates - * @request GET:/gitignore/templates - */ - gitignoreGetAllTemplates: (params: RequestParams = {}) => - this.request({ - path: \`/gitignore/templates\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Lists the people who the authenticated user follows. + * @tags users + * @name UsersListFollowedByAuthenticated + * @summary List the people the authenticated user follows + * @request GET:/user/following + */ + export namespace UsersListFollowedByAuthenticated { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListFollowedByAuthenticatedData; + } - /** - * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. - * - * @tags gitignore - * @name GitignoreGetTemplate - * @summary Get a gitignore template - * @request GET:/gitignore/templates/{name} - */ - gitignoreGetTemplate: ( - { name }: GitignoreGetTemplateParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gitignore/templates/\${name}\`, - method: "GET", - format: "json", - ...params, - }), - }; - installation = { - /** - * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsListReposAccessibleToInstallation - * @summary List repositories accessible to the app installation - * @request GET:/installation/repositories - */ - appsListReposAccessibleToInstallation: ( - query: AppsListReposAccessibleToInstallationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/installation/repositories\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Lists the people following the authenticated user. + * @tags users + * @name UsersListFollowersForAuthenticatedUser + * @summary List followers of the authenticated user + * @request GET:/user/followers + */ + export namespace UsersListFollowersForAuthenticatedUser { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListFollowersForAuthenticatedUserData; + } - /** - * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token - */ - appsRevokeInstallationAccessToken: (params: RequestParams = {}) => - this.request({ - path: \`/installation/token\`, - method: "DELETE", - ...params, - }), - }; - issues = { - /** - * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * - * @tags issues - * @name IssuesList - * @summary List issues assigned to the authenticated user - * @request GET:/issues - */ - issuesList: (query: IssuesListParams, params: RequestParams = {}) => - this.request({ - path: \`/issues\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - licenses = { - /** - * No description - * - * @tags licenses - * @name LicensesGet - * @summary Get a license - * @request GET:/licenses/{license} - */ - licensesGet: ({ license }: LicensesGetParams, params: RequestParams = {}) => - this.request({ - path: \`/licenses/\${license}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersListGpgKeysForAuthenticated + * @summary List GPG keys for the authenticated user + * @request GET:/user/gpg_keys + */ + export namespace UsersListGpgKeysForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListGpgKeysForAuthenticatedData; + } - /** - * No description - * - * @tags licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses - */ - licensesGetAllCommonlyUsed: ( - query: LicensesGetAllCommonlyUsedParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/licenses\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - markdown = { - /** - * No description - * - * @tags markdown - * @name MarkdownRender - * @summary Render a Markdown document - * @request POST:/markdown - */ - markdownRender: (data: MarkdownRenderPayload, params: RequestParams = {}) => - this.request({ - path: \`/markdown\`, - method: "POST", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. + * @tags users + * @name UsersListPublicEmailsForAuthenticated + * @summary List public email addresses for the authenticated user + * @request GET:/user/public_emails + */ + export namespace UsersListPublicEmailsForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListPublicEmailsForAuthenticatedData; + } - /** - * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. - * - * @tags markdown - * @name MarkdownRenderRaw - * @summary Render a Markdown document in raw mode - * @request POST:/markdown/raw - */ - markdownRenderRaw: ( - data: MarkdownRenderRawPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/markdown/raw\`, - method: "POST", - body: data, - type: ContentType.Text, - ...params, - }), - }; - marketplaceListing = { - /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} - */ - appsGetSubscriptionPlanForAccount: ( - { accountId }: AppsGetSubscriptionPlanForAccountParams, - params: RequestParams = {}, - ) => - this.request< - AppsGetSubscriptionPlanForAccountData, - AppsGetSubscriptionPlanForAccountError - >({ - path: \`/marketplace_listing/accounts/\${accountId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @tags users + * @name UsersListPublicSshKeysForAuthenticated + * @summary List public SSH keys for the authenticated user + * @request GET:/user/keys + */ + export namespace UsersListPublicSshKeysForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListPublicSshKeysForAuthenticatedData; + } - /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} - */ - appsGetSubscriptionPlanForAccountStubbed: ( - { accountId }: AppsGetSubscriptionPlanForAccountStubbedParams, - params: RequestParams = {}, - ) => - this.request< - AppsGetSubscriptionPlanForAccountStubbedData, - BasicError | void - >({ - path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Sets the visibility for your primary email addresses. + * @tags users + * @name UsersSetPrimaryEmailVisibilityForAuthenticated + * @summary Set primary email visibility for the authenticated user + * @request PATCH:/user/email/visibility + */ + export namespace UsersSetPrimaryEmailVisibilityForAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = + UsersSetPrimaryEmailVisibilityForAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = + UsersSetPrimaryEmailVisibilityForAuthenticatedData; + } - /** - * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts - */ - appsListAccountsForPlan: ( - { planId, ...query }: AppsListAccountsForPlanParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * No description + * @tags users + * @name UsersUnblock + * @summary Unblock a user + * @request DELETE:/user/blocks/{username} + */ + export namespace UsersUnblock { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersUnblockData; + } - /** - * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts - */ - appsListAccountsForPlanStubbed: ( - { planId, ...query }: AppsListAccountsForPlanStubbedParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * @tags users + * @name UsersUnfollow + * @summary Unfollow a user + * @request DELETE:/user/following/{username} + */ + export namespace UsersUnfollow { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersUnfollowData; + } - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListPlans - * @summary List plans - * @request GET:/marketplace_listing/plans - */ - appsListPlans: (query: AppsListPlansParams, params: RequestParams = {}) => - this.request({ - path: \`/marketplace_listing/plans\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. + * @tags users + * @name UsersUpdateAuthenticated + * @summary Update the authenticated user + * @request PATCH:/user + */ + export namespace UsersUpdateAuthenticated { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = UsersUpdateAuthenticatedPayload; + export type RequestHeaders = {}; + export type ResponseBody = UsersUpdateAuthenticatedData; + } +} - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListPlansStubbed - * @summary List plans (stubbed) - * @request GET:/marketplace_listing/stubbed/plans - */ - appsListPlansStubbed: ( - query: AppsListPlansStubbedParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - meta = { - /** - * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. - * - * @tags meta - * @name MetaGet - * @summary Get GitHub meta information - * @request GET:/meta - */ - metaGet: (params: RequestParams = {}) => - this.request({ - path: \`/meta\`, - method: "GET", - format: "json", - ...params, - }), - }; - networks = { - /** - * No description - * - * @tags activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events - */ - activityListPublicEventsForRepoNetwork: ( - { owner, repo, ...query }: ActivityListPublicEventsForRepoNetworkParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/networks/\${owner}/\${repo}/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - notifications = { - /** - * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. - * - * @tags activity - * @name ActivityDeleteThreadSubscription - * @summary Delete a thread subscription - * @request DELETE:/notifications/threads/{thread_id}/subscription - */ - activityDeleteThreadSubscription: ( - { threadId }: ActivityDeleteThreadSubscriptionParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "DELETE", - ...params, - }), +export namespace Users { + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * @tags activity + * @name ActivityListEventsForAuthenticatedUser + * @summary List events for the authenticated user + * @request GET:/users/{username}/events + */ + export namespace ActivityListEventsForAuthenticatedUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListEventsForAuthenticatedUserData; + } - /** - * No description - * - * @tags activity - * @name ActivityGetThread - * @summary Get a thread - * @request GET:/notifications/threads/{thread_id} - */ - activityGetThread: ( - { threadId }: ActivityGetThreadParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * @tags activity + * @name ActivityListOrgEventsForAuthenticatedUser + * @summary List organization events for the authenticated user + * @request GET:/users/{username}/events/orgs/{org} + */ + export namespace ActivityListOrgEventsForAuthenticatedUser { + export type RequestParams = { + org: string; + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListOrgEventsForAuthenticatedUserData; + } - /** - * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. - * - * @tags activity - * @name ActivityGetThreadSubscriptionForAuthenticatedUser - * @summary Get a thread subscription for the authenticated user - * @request GET:/notifications/threads/{thread_id}/subscription - */ - activityGetThreadSubscriptionForAuthenticatedUser: ( - { threadId }: ActivityGetThreadSubscriptionForAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request< - ActivityGetThreadSubscriptionForAuthenticatedUserData, - BasicError - >({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "GET", - format: "json", - ...params, - }), + /** + * No description + * @tags activity + * @name ActivityListPublicEventsForUser + * @summary List public events for a user + * @request GET:/users/{username}/events/public + */ + export namespace ActivityListPublicEventsForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListPublicEventsForUserData; + } - /** - * @description List all notifications for the current user, sorted by most recently updated. - * - * @tags activity - * @name ActivityListNotificationsForAuthenticatedUser - * @summary List notifications for the authenticated user - * @request GET:/notifications - */ - activityListNotificationsForAuthenticatedUser: ( - query: ActivityListNotificationsForAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request< - ActivityListNotificationsForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/notifications\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. + * @tags activity + * @name ActivityListReceivedEventsForUser + * @summary List events received by the authenticated user + * @request GET:/users/{username}/received_events + */ + export namespace ActivityListReceivedEventsForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListReceivedEventsForUserData; + } - /** - * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. - * - * @tags activity - * @name ActivityMarkNotificationsAsRead - * @summary Mark notifications as read - * @request PUT:/notifications - */ - activityMarkNotificationsAsRead: ( - data: ActivityMarkNotificationsAsReadPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * No description + * @tags activity + * @name ActivityListReceivedPublicEventsForUser + * @summary List public events received by a user + * @request GET:/users/{username}/received_events/public + */ + export namespace ActivityListReceivedPublicEventsForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListReceivedPublicEventsForUserData; + } + + /** + * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @tags activity + * @name ActivityListReposStarredByUser + * @summary List repositories starred by a user + * @request GET:/users/{username}/starred + */ + export namespace ActivityListReposStarredByUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: ActivityListReposStarredByUserParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: ActivityListReposStarredByUserParams1SortEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListReposStarredByUserData; + } + + /** + * @description Lists repositories a user is watching. + * @tags activity + * @name ActivityListReposWatchedByUser + * @summary List repositories watched by a user + * @request GET:/users/{username}/subscriptions + */ + export namespace ActivityListReposWatchedByUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityListReposWatchedByUserData; + } + + /** + * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @tags apps + * @name AppsGetUserInstallation + * @summary Get a user installation for the authenticated app + * @request GET:/users/{username}/installation + */ + export namespace AppsGetUserInstallation { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsGetUserInstallationData; + } - /** - * No description - * - * @tags activity - * @name ActivityMarkThreadAsRead - * @summary Mark a thread as read - * @request PATCH:/notifications/threads/{thread_id} - */ - activityMarkThreadAsRead: ( - { threadId }: ActivityMarkThreadAsReadParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, - method: "PATCH", - ...params, - }), + /** + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. + * @tags billing + * @name BillingGetGithubActionsBillingUser + * @summary Get GitHub Actions billing for a user + * @request GET:/users/{username}/settings/billing/actions + */ + export namespace BillingGetGithubActionsBillingUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = BillingGetGithubActionsBillingUserData; + } - /** - * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. - * - * @tags activity - * @name ActivitySetThreadSubscription - * @summary Set a thread subscription - * @request PUT:/notifications/threads/{thread_id}/subscription - */ - activitySetThreadSubscription: ( - { threadId }: ActivitySetThreadSubscriptionParams, - data: ActivitySetThreadSubscriptionPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - octocat = { - /** - * @description Get the octocat as ASCII art - * - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat - */ - metaGetOctocat: (query: MetaGetOctocatParams, params: RequestParams = {}) => - this.request({ - path: \`/octocat\`, - method: "GET", - query: query, - ...params, - }), - }; - organizations = { - /** - * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. - * - * @tags orgs - * @name OrgsList - * @summary List organizations - * @request GET:/organizations - */ - orgsList: (query: OrgsListParams, params: RequestParams = {}) => - this.request({ - path: \`/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - orgs = { - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Add repository access to a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - */ - actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - repositoryId, - }: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "PUT", - ...params, - }), + /** + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @tags billing + * @name BillingGetGithubPackagesBillingUser + * @summary Get GitHub Packages billing for a user + * @request GET:/users/{username}/settings/billing/packages + */ + export namespace BillingGetGithubPackagesBillingUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = BillingGetGithubPackagesBillingUserData; + } - /** - * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsAddSelectedRepoToOrgSecret - * @summary Add selected repository to an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - */ - actionsAddSelectedRepoToOrgSecret: ( - { - org, - secretName, - repositoryId, - }: ActionsAddSelectedRepoToOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "PUT", - ...params, - }), + /** + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @tags billing + * @name BillingGetSharedStorageBillingUser + * @summary Get shared storage billing for a user + * @request GET:/users/{username}/settings/billing/shared-storage + */ + export namespace BillingGetSharedStorageBillingUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = BillingGetSharedStorageBillingUserData; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsAddSelfHostedRunnerToGroupForOrg - * @summary Add a self-hosted runner to a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - actionsAddSelfHostedRunnerToGroupForOrg: ( - { - org, - runnerGroupId, - runnerId, - }: ActionsAddSelfHostedRunnerToGroupForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "PUT", - ...params, - }), + /** + * @description Lists public gists for the specified user: + * @tags gists + * @name GistsListForUser + * @summary List gists for a user + * @request GET:/users/{username}/gists + */ + export namespace GistsListForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = GistsListForUserData; + } - /** - * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` - * - * @tags actions - * @name ActionsCreateOrUpdateOrgSecret - * @summary Create or update an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name} - */ - actionsCreateOrUpdateOrgSecret: ( - { org, secretName }: ActionsCreateOrUpdateOrgSecretParams, - data: ActionsCreateOrUpdateOrgSecretPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + /** + * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + * @tags orgs + * @name OrgsListForUser + * @summary List organizations for a user + * @request GET:/users/{username}/orgs + */ + export namespace OrgsListForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListForUserData; + } - /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` - * - * @tags actions - * @name ActionsCreateRegistrationTokenForOrg - * @summary Create a registration token for an organization - * @request POST:/orgs/{org}/actions/runners/registration-token - */ - actionsCreateRegistrationTokenForOrg: ( - { org }: ActionsCreateRegistrationTokenForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/registration-token\`, - method: "POST", - format: "json", - ...params, - }), + /** + * No description + * @tags projects + * @name ProjectsListForUser + * @summary List user projects + * @request GET:/users/{username}/projects + */ + export namespace ProjectsListForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: ProjectsListForUserParams1StateEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ProjectsListForUserData; + } - /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * - * @tags actions - * @name ActionsCreateRemoveTokenForOrg - * @summary Create a remove token for an organization - * @request POST:/orgs/{org}/actions/runners/remove-token - */ - actionsCreateRemoveTokenForOrg: ( - { org }: ActionsCreateRemoveTokenForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/remove-token\`, - method: "POST", - format: "json", - ...params, - }), + /** + * @description Lists public repositories for the specified user. + * @tags repos + * @name ReposListForUser + * @summary List repositories for a user + * @request GET:/users/{username}/repos + */ + export namespace ReposListForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: ReposListForUserParams1DirectionEnum; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: ReposListForUserParams1SortEnum; + /** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ + type?: ReposListForUserParams1TypeEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ReposListForUserData; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsCreateSelfHostedRunnerGroupForOrg - * @summary Create a self-hosted runner group for an organization - * @request POST:/orgs/{org}/actions/runner-groups - */ - actionsCreateSelfHostedRunnerGroupForOrg: ( - { org }: ActionsCreateSelfHostedRunnerGroupForOrgParams, - data: ActionsCreateSelfHostedRunnerGroupForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + /** + * No description + * @tags users + * @name UsersCheckFollowingForUser + * @summary Check if a user follows another user + * @request GET:/users/{username}/following/{target_user} + */ + export namespace UsersCheckFollowingForUser { + export type RequestParams = { + targetUser: string; + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersCheckFollowingForUserData; + } - /** - * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsDeleteOrgSecret - * @summary Delete an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} - */ - actionsDeleteOrgSecret: ( - { org, secretName }: ActionsDeleteOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - method: "DELETE", - ...params, - }), + /** + * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + * @tags users + * @name UsersGetByUsername + * @summary Get a user + * @request GET:/users/{username} + */ + export namespace UsersGetByUsername { + export type RequestParams = { + username: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersGetByUsernameData; + } - /** - * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromOrg - * @summary Delete a self-hosted runner from an organization - * @request DELETE:/orgs/{org}/actions/runners/{runner_id} - */ - actionsDeleteSelfHostedRunnerFromOrg: ( - { org, runnerId }: ActionsDeleteSelfHostedRunnerFromOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` + * @tags users + * @name UsersGetContextForUser + * @summary Get contextual information for a user + * @request GET:/users/{username}/hovercard + */ + export namespace UsersGetContextForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ + subject_id?: string; + /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ + subject_type?: UsersGetContextForUserParams1SubjectTypeEnum; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersGetContextForUserData; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerGroupFromOrg - * @summary Delete a self-hosted runner group from an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - actionsDeleteSelfHostedRunnerGroupFromOrg: ( - { org, runnerGroupId }: ActionsDeleteSelfHostedRunnerGroupFromOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + * @tags users + * @name UsersList + * @summary List users + * @request GET:/users + */ + export namespace UsersList { + export type RequestParams = {}; + export type RequestQuery = { + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListData; + } - /** - * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsDisableSelectedRepositoryGithubActionsOrganization - * @summary Disable a selected repository for GitHub Actions in an organization - * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} - */ - actionsDisableSelectedRepositoryGithubActionsOrganization: ( - { - org, - repositoryId, - }: ActionsDisableSelectedRepositoryGithubActionsOrganizationParams, - params: RequestParams = {}, - ) => - this.request< - ActionsDisableSelectedRepositoryGithubActionsOrganizationData, - any - >({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "DELETE", - ...params, - }), + /** + * @description Lists the people following the specified user. + * @tags users + * @name UsersListFollowersForUser + * @summary List followers of a user + * @request GET:/users/{username}/followers + */ + export namespace UsersListFollowersForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListFollowersForUserData; + } - /** - * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsEnableSelectedRepositoryGithubActionsOrganization - * @summary Enable a selected repository for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} - */ - actionsEnableSelectedRepositoryGithubActionsOrganization: ( - { - org, - repositoryId, - }: ActionsEnableSelectedRepositoryGithubActionsOrganizationParams, - params: RequestParams = {}, - ) => - this.request< - ActionsEnableSelectedRepositoryGithubActionsOrganizationData, - any - >({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "PUT", - ...params, - }), + /** + * @description Lists the people who the specified user follows. + * @tags users + * @name UsersListFollowingForUser + * @summary List the people a user follows + * @request GET:/users/{username}/following + */ + export namespace UsersListFollowingForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListFollowingForUserData; + } - /** - * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsGetAllowedActionsOrganization - * @summary Get allowed actions for an organization - * @request GET:/orgs/{org}/actions/permissions/selected-actions - */ - actionsGetAllowedActionsOrganization: ( - { org }: ActionsGetAllowedActionsOrganizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Lists the GPG keys for a user. This information is accessible by anyone. + * @tags users + * @name UsersListGpgKeysForUser + * @summary List GPG keys for a user + * @request GET:/users/{username}/gpg_keys + */ + export namespace UsersListGpgKeysForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListGpgKeysForUserData; + } - /** - * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsGetGithubActionsPermissionsOrganization - * @summary Get GitHub Actions permissions for an organization - * @request GET:/orgs/{org}/actions/permissions - */ - actionsGetGithubActionsPermissionsOrganization: ( - { org }: ActionsGetGithubActionsPermissionsOrganizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "GET", - format: "json", - ...params, - }), + /** + * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * @tags users + * @name UsersListPublicKeysForUser + * @summary List public keys for a user + * @request GET:/users/{username}/keys + */ + export namespace UsersListPublicKeysForUser { + export type RequestParams = { + username: string; + }; + export type RequestQuery = { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = UsersListPublicKeysForUserData; + } +} - /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsGetOrgPublicKey - * @summary Get an organization public key - * @request GET:/orgs/{org}/actions/secrets/public-key - */ - actionsGetOrgPublicKey: ( - { org }: ActionsGetOrgPublicKeyParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/public-key\`, - method: "GET", - format: "json", - ...params, - }), +export namespace Zen { + /** + * @description Get a random sentence from the Zen of GitHub + * @tags meta + * @name MetaGetZen + * @summary Get the Zen of GitHub + * @request GET:/zen + */ + export namespace MetaGetZen { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MetaGetZenData; + } +} - /** - * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsGetOrgSecret - * @summary Get an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name} - */ - actionsGetOrgSecret: ( - { org, secretName }: ActionsGetOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - method: "GET", - format: "json", - ...params, - }), +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; - /** - * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsGetSelfHostedRunnerForOrg - * @summary Get a self-hosted runner for an organization - * @request GET:/orgs/{org}/actions/runners/{runner_id} - */ - actionsGetSelfHostedRunnerForOrg: ( - { org, runnerId }: ActionsGetSelfHostedRunnerForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, - method: "GET", - format: "json", - ...params, - }), +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; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsGetSelfHostedRunnerGroupForOrg - * @summary Get a self-hosted runner group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - actionsGetSelfHostedRunnerGroupForOrg: ( - { org, runnerGroupId }: ActionsGetSelfHostedRunnerGroupForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "GET", - format: "json", - ...params, - }), +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; - /** - * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsListOrgSecrets - * @summary List organization secrets - * @request GET:/orgs/{org}/actions/secrets - */ - actionsListOrgSecrets: ( - { org, ...query }: ActionsListOrgSecretsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg - * @summary List repository access to a self-hosted runner group in an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - */ - actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - }: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "GET", - format: "json", - ...params, - }), +export interface HttpResponse + extends Response { + data: D; + error: E; +} - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsListRunnerApplicationsForOrg - * @summary List runner applications for an organization - * @request GET:/orgs/{org}/actions/runners/downloads - */ - actionsListRunnerApplicationsForOrg: ( - { org }: ActionsListRunnerApplicationsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/downloads\`, - method: "GET", - format: "json", - ...params, - }), +type CancelToken = Symbol | string | number; - /** - * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsListSelectedReposForOrgSecret - * @summary List selected repositories for an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories - */ - actionsListSelectedReposForOrgSecret: ( - { org, secretName }: ActionsListSelectedReposForOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "GET", - format: "json", - ...params, - }), +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} - /** - * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization - * @summary List selected repositories enabled for GitHub Actions in an organization - * @request GET:/orgs/{org}/actions/permissions/repositories - */ - actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( - { - org, - ...query - }: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams, - params: RequestParams = {}, - ) => - this.request< - ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData, - any - >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +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); - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsListSelfHostedRunnerGroupsForOrg - * @summary List self-hosted runner groups for an organization - * @request GET:/orgs/{org}/actions/runner-groups - */ - actionsListSelfHostedRunnerGroupsForOrg: ( - { org, ...query }: ActionsListSelfHostedRunnerGroupsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; - /** - * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsListSelfHostedRunnersForOrg - * @summary List self-hosted runners for an organization - * @request GET:/orgs/{org}/actions/runners - */ - actionsListSelfHostedRunnersForOrg: ( - { org, ...query }: ActionsListSelfHostedRunnersForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsListSelfHostedRunnersInGroupForOrg - * @summary List self-hosted runners in a group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners - */ - actionsListSelfHostedRunnersInGroupForOrg: ( - { - org, - runnerGroupId, - ...query - }: ActionsListSelfHostedRunnersInGroupForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Remove repository access to a self-hosted runner group in an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - */ - actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - repositoryId, - }: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams, - params: RequestParams = {}, - ) => - this.request< - ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData, - any - >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "DELETE", - ...params, - }), + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } - /** - * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsRemoveSelectedRepoFromOrgSecret - * @summary Remove selected repository from an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} - */ - actionsRemoveSelectedRepoFromOrgSecret: ( - { - org, - secretName, - repositoryId, - }: ActionsRemoveSelectedRepoFromOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "DELETE", - ...params, - }), + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg - * @summary Remove a self-hosted runner from a group for an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - actionsRemoveSelfHostedRunnerFromGroupForOrg: ( - { - org, - runnerGroupId, - runnerId, - }: ActionsRemoveSelfHostedRunnerFromGroupForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } - /** - * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsSetAllowedActionsOrganization - * @summary Set allowed actions for an organization - * @request PUT:/orgs/{org}/actions/permissions/selected-actions - */ - actionsSetAllowedActionsOrganization: ( - { org }: ActionsSetAllowedActionsOrganizationParams, - data: SelectedActions, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + 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("&"); + } - /** - * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsSetGithubActionsPermissionsOrganization - * @summary Set GitHub Actions permissions for an organization - * @request PUT:/orgs/{org}/actions/permissions - */ - actionsSetGithubActionsPermissionsOrganization: ( - { org }: ActionsSetGithubActionsPermissionsOrganizationParams, - data: ActionsSetGithubActionsPermissionsOrganizationPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Set repository access for a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories - */ - actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - }: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams, - data: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } - /** - * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. - * - * @tags actions - * @name ActionsSetSelectedReposForOrgSecret - * @summary Set selected repositories for an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories - */ - actionsSetSelectedReposForOrgSecret: ( - { org, secretName }: ActionsSetSelectedReposForOrgSecretParams, - data: ActionsSetSelectedReposForOrgSecretPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + return 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), + }; - /** - * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization - * @summary Set selected repositories enabled for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories - */ - actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( - { - org, - }: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams, - data: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload, - params: RequestParams = {}, - ) => - this.request< - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData, - any - >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsSetSelfHostedRunnersInGroupForOrg - * @summary Set self-hosted runners in a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners - */ - actionsSetSelfHostedRunnersInGroupForOrg: ( - { org, runnerGroupId }: ActionsSetSelfHostedRunnersInGroupForOrgParams, - data: ActionsSetSelfHostedRunnersInGroupForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + 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; + } - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsUpdateSelfHostedRunnerGroupForOrg - * @summary Update a self-hosted runner group for an organization - * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} - */ - actionsUpdateSelfHostedRunnerGroupForOrg: ( - { org, runnerGroupId }: ActionsUpdateSelfHostedRunnerGroupForOrgParams, - data: ActionsUpdateSelfHostedRunnerGroupForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; - /** - * No description - * - * @tags activity - * @name ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events - */ - activityListPublicOrgEvents: ( - { org, ...query }: ActivityListPublicOrgEventsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); - /** - * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetOrgInstallation - * @summary Get an organization installation for the authenticated app - * @request GET:/orgs/{org}/installation - */ - appsGetOrgInstallation: ( - { org }: AppsGetOrgInstallationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/installation\`, - method: "GET", - format: "json", - ...params, - }), + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; - /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. - * - * @tags billing - * @name BillingGetGithubActionsBillingOrg - * @summary Get GitHub Actions billing for an organization - * @request GET:/orgs/{org}/settings/billing/actions - */ - billingGetGithubActionsBillingOrg: ( - { org }: BillingGetGithubActionsBillingOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/actions\`, - method: "GET", - format: "json", - ...params, - }), + 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; - /** - * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. - * - * @tags billing - * @name BillingGetGithubPackagesBillingOrg - * @summary Get GitHub Packages billing for an organization - * @request GET:/orgs/{org}/settings/billing/packages - */ - billingGetGithubPackagesBillingOrg: ( - { org }: BillingGetGithubPackagesBillingOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/packages\`, - method: "GET", - format: "json", - ...params, - }), + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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; - /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. - * - * @tags billing - * @name BillingGetSharedStorageBillingOrg - * @summary Get shared storage billing for an organization - * @request GET:/orgs/{org}/settings/billing/shared-storage - */ - billingGetSharedStorageBillingOrg: ( - { org }: BillingGetSharedStorageBillingOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/shared-storage\`, - method: "GET", - format: "json", - ...params, - }), + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); - /** - * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. - * - * @tags interactions - * @name InteractionsGetRestrictionsForOrg - * @summary Get interaction restrictions for an organization - * @request GET:/orgs/{org}/interaction-limits - */ - interactionsGetRestrictionsForOrg: ( - { org }: InteractionsGetRestrictionsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "GET", - format: "json", - ...params, - }), + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } - /** - * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. - * - * @tags interactions - * @name InteractionsRemoveRestrictionsForOrg - * @summary Remove interaction restrictions for an organization - * @request DELETE:/orgs/{org}/interaction-limits - */ - interactionsRemoveRestrictionsForOrg: ( - { org }: InteractionsRemoveRestrictionsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "DELETE", - ...params, - }), + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title GitHub v3 REST API + * @version 1.1.4 + * @license MIT (https://spdx.org/licenses/MIT) + * @termsOfService https://docs.github.com/articles/github-terms-of-service + * @baseUrl https://api.github.com + * @externalDocs https://docs.github.com/rest/ + * @contact Support (https://support.github.com/contact) + * + * GitHub's v3 REST API. + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + /** + * @description Get Hypermedia links to resources accessible in GitHub's REST API + * + * @tags meta + * @name MetaRoot + * @summary GitHub API Root + * @request GET:/ + */ + metaRoot = (params: RequestParams = {}) => + this.request({ + path: \`/\`, + method: "GET", + format: "json", + ...params, + }); + app = { /** - * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. + * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags interactions - * @name InteractionsSetRestrictionsForOrg - * @summary Set interaction restrictions for an organization - * @request PUT:/orgs/{org}/interaction-limits + * @tags apps + * @name AppsCreateInstallationAccessToken + * @summary Create an installation access token for an app + * @request POST:/app/installations/{installation_id}/access_tokens */ - interactionsSetRestrictionsForOrg: ( - { org }: InteractionsSetRestrictionsForOrgParams, - data: InteractionLimit, + appsCreateInstallationAccessToken: ( + { installationId }: AppsCreateInstallationAccessTokenParams, + data: AppsCreateInstallationAccessTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "PUT", + this.request< + AppsCreateInstallationAccessTokenData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/app/installations/\${installationId}/access_tokens\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -53755,114 +52396,95 @@ export class Api< }), /** - * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * - * @tags issues - * @name IssuesListForOrg - * @summary List organization issues assigned to the authenticated user - * @request GET:/orgs/{org}/issues - */ - issuesListForOrg: ( - { org, ...query }: IssuesListForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/issues\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. + * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags migrations - * @name MigrationsDeleteArchiveForOrg - * @summary Delete an organization migration archive - * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive + * @tags apps + * @name AppsDeleteInstallation + * @summary Delete an installation for the authenticated app + * @request DELETE:/app/installations/{installation_id} */ - migrationsDeleteArchiveForOrg: ( - { org, migrationId }: MigrationsDeleteArchiveForOrgParams, + appsDeleteInstallation: ( + { installationId }: AppsDeleteInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + this.request({ + path: \`/app/installations/\${installationId}\`, method: "DELETE", ...params, }), /** - * @description Fetches the URL to a migration archive. + * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags migrations - * @name MigrationsDownloadArchiveForOrg - * @summary Download an organization migration archive - * @request GET:/orgs/{org}/migrations/{migration_id}/archive + * @tags apps + * @name AppsGetAuthenticated + * @summary Get the authenticated app + * @request GET:/app */ - migrationsDownloadArchiveForOrg: ( - { org, migrationId }: MigrationsDownloadArchiveForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + appsGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/app\`, method: "GET", + format: "json", ...params, }), /** - * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. + * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags migrations - * @name MigrationsGetStatusForOrg - * @summary Get an organization migration status - * @request GET:/orgs/{org}/migrations/{migration_id} + * @tags apps + * @name AppsGetInstallation + * @summary Get an installation for the authenticated app + * @request GET:/app/installations/{installation_id} */ - migrationsGetStatusForOrg: ( - { org, migrationId }: MigrationsGetStatusForOrgParams, + appsGetInstallation: ( + { installationId }: AppsGetInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}\`, + this.request< + AppsGetInstallationData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/app/installations/\${installationId}\`, method: "GET", format: "json", ...params, }), /** - * @description Lists the most recent migrations. + * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * @tags apps + * @name AppsGetWebhookConfigForApp + * @summary Get a webhook configuration for an app + * @request GET:/app/hook/config */ - migrationsListForOrg: ( - { org, ...query }: MigrationsListForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + appsGetWebhookConfigForApp: (params: RequestParams = {}) => + this.request({ + path: \`/app/hook/config\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List all the repositories for this organization migration. + * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. * - * @tags migrations - * @name MigrationsListReposForOrg - * @summary List repositories in an organization migration - * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + * @tags apps + * @name AppsListInstallations + * @summary List installations for the authenticated app + * @request GET:/app/installations */ - migrationsListReposForOrg: ( - { org, migrationId, ...query }: MigrationsListReposForOrgParams, + appsListInstallations: ( + query: AppsListInstallationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/app/installations\`, method: "GET", query: query, format: "json", @@ -53870,171 +52492,121 @@ export class Api< }), /** - * @description Initiates the generation of a migration archive. - * - * @tags migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations - */ - migrationsStartForOrg: ( - { org }: MigrationsStartForOrgParams, - data: MigrationsStartForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. - * - * @tags migrations - * @name MigrationsUnlockRepoForOrg - * @summary Unlock an organization repository - * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock - */ - migrationsUnlockRepoForOrg: ( - { org, migrationId, repoName }: MigrationsUnlockRepoForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", - ...params, - }), - - /** - * No description + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} + * @tags apps + * @name AppsSuspendInstallation + * @summary Suspend an app installation + * @request PUT:/app/installations/{installation_id}/suspended */ - orgsBlockUser: ( - { org, username }: OrgsBlockUserParams, + appsSuspendInstallation: ( + { installationId }: AppsSuspendInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, method: "PUT", ...params, }), /** - * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags orgs - * @name OrgsCancelInvitation - * @summary Cancel an organization invitation - * @request DELETE:/orgs/{org}/invitations/{invitation_id} + * @tags apps + * @name AppsUnsuspendInstallation + * @summary Unsuspend an app installation + * @request DELETE:/app/installations/{installation_id}/suspended */ - orgsCancelInvitation: ( - { org, invitationId }: OrgsCancelInvitationParams, + appsUnsuspendInstallation: ( + { installationId }: AppsUnsuspendInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}\`, + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, method: "DELETE", ...params, }), /** - * No description + * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} + * @tags apps + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config */ - orgsCheckBlockedUser: ( - { org, username }: OrgsCheckBlockedUserParams, + appsUpdateWebhookConfigForApp: ( + data: AppsUpdateWebhookConfigForAppPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "GET", + this.request({ + path: \`/app/hook/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - + }; + appManifests = { /** - * @description Check if a user is, publicly or privately, a member of the organization. + * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. * - * @tags orgs - * @name OrgsCheckMembershipForUser - * @summary Check organization membership for a user - * @request GET:/orgs/{org}/members/{username} + * @tags apps + * @name AppsCreateFromManifest + * @summary Create a GitHub App from a manifest + * @request POST:/app-manifests/{code}/conversions */ - orgsCheckMembershipForUser: ( - { org, username }: OrgsCheckMembershipForUserParams, + appsCreateFromManifest: ( + { code }: AppsCreateFromManifestParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, - method: "GET", + this.request< + AppsCreateFromManifestData, + BasicError | ValidationErrorSimple + >({ + path: \`/app-manifests/\${code}/conversions\`, + method: "POST", + format: "json", ...params, }), - + }; + applications = { /** - * No description + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * @tags apps + * @name AppsCheckAuthorization + * @summary Check an authorization + * @request GET:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - orgsCheckPublicMembershipForUser: ( - { org, username }: OrgsCheckPublicMembershipForUserParams, + appsCheckAuthorization: ( + { clientId, accessToken }: AppsCheckAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "GET", + format: "json", ...params, }), /** - * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". - * - * @tags orgs - * @name OrgsConvertMemberToOutsideCollaborator - * @summary Convert an organization member to outside collaborator - * @request PUT:/orgs/{org}/outside_collaborators/{username} - */ - orgsConvertMemberToOutsideCollaborator: ( - { org, username }: OrgsConvertMemberToOutsideCollaboratorParams, - params: RequestParams = {}, - ) => - this.request< - OrgsConvertMemberToOutsideCollaboratorData, - OrgsConvertMemberToOutsideCollaboratorError - >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "PUT", - ...params, - }), - - /** - * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags orgs - * @name OrgsCreateInvitation - * @summary Create an organization invitation - * @request POST:/orgs/{org}/invitations + * @tags apps + * @name AppsCheckToken + * @summary Check a token + * @request POST:/applications/{client_id}/token */ - orgsCreateInvitation: ( - { org }: OrgsCreateInvitationParams, - data: OrgsCreateInvitationPayload, + appsCheckToken: ( + { clientId }: AppsCheckTokenParams, + data: AppsCheckTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, + this.request({ + path: \`/applications/\${clientId}/token\`, method: "POST", body: data, type: ContentType.Json, @@ -54043,644 +52615,688 @@ export class Api< }), /** - * @description Here's how you can create a hook that posts payloads in JSON format: + * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). * - * @tags orgs - * @name OrgsCreateWebhook - * @summary Create an organization webhook - * @request POST:/orgs/{org}/hooks + * @tags apps + * @name AppsDeleteAuthorization + * @summary Delete an app authorization + * @request DELETE:/applications/{client_id}/grant */ - orgsCreateWebhook: ( - { org }: OrgsCreateWebhookParams, - data: OrgsCreateWebhookPayload, + appsDeleteAuthorization: ( + { clientId }: AppsDeleteAuthorizationParams, + data: AppsDeleteAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, - method: "POST", + this.request({ + path: \`/applications/\${clientId}/grant\`, + method: "DELETE", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. * - * @tags orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * @tags apps + * @name AppsDeleteToken + * @summary Delete an app token + * @request DELETE:/applications/{client_id}/token */ - orgsDeleteWebhook: ( - { org, hookId }: OrgsDeleteWebhookParams, + appsDeleteToken: ( + { clientId }: AppsDeleteTokenParams, + data: AppsDeleteTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, + this.request({ + path: \`/applications/\${clientId}/token\`, method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." - * - * @tags orgs - * @name OrgsGet - * @summary Get an organization - * @request GET:/orgs/{org} - */ - orgsGet: ({ org }: OrgsGetParams, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags orgs - * @name OrgsGetAuditLog - * @summary Get the audit log for an organization - * @request GET:/orgs/{org}/audit-log + * @tags apps + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - orgsGetAuditLog: ( - { org, ...query }: OrgsGetAuditLogParams, + appsResetAuthorization: ( + { clientId, accessToken }: AppsResetAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/audit-log\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, + method: "POST", format: "json", ...params, }), /** - * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. + * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags orgs - * @name OrgsGetMembershipForUser - * @summary Get organization membership for a user - * @request GET:/orgs/{org}/memberships/{username} + * @tags apps + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - orgsGetMembershipForUser: ( - { org, username }: OrgsGetMembershipForUserParams, + appsResetToken: ( + { clientId }: AppsResetTokenParams, + data: AppsResetTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "GET", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. * - * @tags orgs - * @name OrgsGetWebhook - * @summary Get an organization webhook - * @request GET:/orgs/{org}/hooks/{hook_id} + * @tags apps + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - orgsGetWebhook: ( - { org, hookId }: OrgsGetWebhookParams, + appsRevokeAuthorizationForApplication: ( + { clientId, accessToken }: AppsRevokeAuthorizationForApplicationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, + method: "DELETE", ...params, }), /** - * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). * - * @tags orgs - * @name OrgsGetWebhookConfigForOrg - * @summary Get a webhook configuration for an organization - * @request GET:/orgs/{org}/hooks/{hook_id}/config + * @tags apps + * @name AppsRevokeGrantForApplication + * @summary Revoke a grant for an application + * @request DELETE:/applications/{client_id}/grants/{access_token} + * @deprecated */ - orgsGetWebhookConfigForOrg: ( - { org, hookId }: OrgsGetWebhookConfigForOrgParams, + appsRevokeGrantForApplication: ( + { clientId, accessToken }: AppsRevokeGrantForApplicationParams, params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "GET", - format: "json", + ) => + this.request({ + path: \`/applications/\${clientId}/grants/\${accessToken}\`, + method: "DELETE", ...params, }), /** - * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. + * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags orgs - * @name OrgsListAppInstallations - * @summary List app installations for an organization - * @request GET:/orgs/{org}/installations + * @tags apps + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - orgsListAppInstallations: ( - { org, ...query }: OrgsListAppInstallationsParams, + appsScopeToken: ( + { clientId }: AppsScopeTokenParams, + data: AppsScopeTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/installations\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/token/scoped\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List the users blocked by an organization. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). * - * @tags orgs - * @name OrgsListBlockedUsers - * @summary List users blocked by an organization - * @request GET:/orgs/{org}/blocks + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteGrant + * @summary Delete a grant + * @request DELETE:/applications/grants/{grant_id} + * @deprecated */ - orgsListBlockedUsers: ( - { org }: OrgsListBlockedUsersParams, + oauthAuthorizationsDeleteGrant: ( + { grantId }: OauthAuthorizationsDeleteGrantParams, params: RequestParams = {}, ) => - this.request< - OrgsListBlockedUsersData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/orgs/\${org}/blocks\`, - method: "GET", - format: "json", + this.request({ + path: \`/applications/grants/\${grantId}\`, + method: "DELETE", ...params, }), /** - * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags orgs - * @name OrgsListFailedInvitations - * @summary List failed organization invitations - * @request GET:/orgs/{org}/failed_invitations + * @tags oauth-authorizations + * @name OauthAuthorizationsGetGrant + * @summary Get a single grant + * @request GET:/applications/grants/{grant_id} + * @deprecated */ - orgsListFailedInvitations: ( - { org, ...query }: OrgsListFailedInvitationsParams, + oauthAuthorizationsGetGrant: ( + { grantId }: OauthAuthorizationsGetGrantParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/failed_invitations\`, + this.request({ + path: \`/applications/grants/\${grantId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. * - * @tags orgs - * @name OrgsListInvitationTeams - * @summary List organization invitation teams - * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + * @tags oauth-authorizations + * @name OauthAuthorizationsListGrants + * @summary List your grants + * @request GET:/applications/grants + * @deprecated */ - orgsListInvitationTeams: ( - { org, invitationId, ...query }: OrgsListInvitationTeamsParams, + oauthAuthorizationsListGrants: ( + query: OauthAuthorizationsListGrantsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, + this.request({ + path: \`/applications/grants\`, method: "GET", query: query, format: "json", ...params, }), - + }; + apps = { /** - * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. + * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags orgs - * @name OrgsListMembers - * @summary List organization members - * @request GET:/orgs/{org}/members + * @tags apps + * @name AppsGetBySlug + * @summary Get an app + * @request GET:/apps/{app_slug} */ - orgsListMembers: ( - { org, ...query }: OrgsListMembersParams, + appsGetBySlug: ( + { appSlug }: AppsGetBySlugParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members\`, + this.request< + AppsGetBySlugData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/apps/\${appSlug}\`, method: "GET", - query: query, format: "json", ...params, }), - + }; + authorizations = { /** - * @description List all users who are outside collaborators of an organization. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). * - * @tags orgs - * @name OrgsListOutsideCollaborators - * @summary List outside collaborators for an organization - * @request GET:/orgs/{org}/outside_collaborators + * @tags oauth-authorizations + * @name OauthAuthorizationsCreateAuthorization + * @summary Create a new authorization + * @request POST:/authorizations + * @deprecated */ - orgsListOutsideCollaborators: ( - { org, ...query }: OrgsListOutsideCollaboratorsParams, + oauthAuthorizationsCreateAuthorization: ( + data: OauthAuthorizationsCreateAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/outside_collaborators\`, - method: "GET", - query: query, + this.request< + OauthAuthorizationsCreateAuthorizationData, + BasicError | ValidationError + >({ + path: \`/authorizations\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags orgs - * @name OrgsListPendingInvitations - * @summary List pending organization invitations - * @request GET:/orgs/{org}/invitations + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteAuthorization + * @summary Delete an authorization + * @request DELETE:/authorizations/{authorization_id} + * @deprecated */ - orgsListPendingInvitations: ( - { org, ...query }: OrgsListPendingInvitationsParams, + oauthAuthorizationsDeleteAuthorization: ( + { authorizationId }: OauthAuthorizationsDeleteAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/authorizations/\${authorizationId}\`, + method: "DELETE", ...params, }), /** - * @description Members of an organization can choose to have their membership publicized or not. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags orgs - * @name OrgsListPublicMembers - * @summary List public organization members - * @request GET:/orgs/{org}/public_members + * @tags oauth-authorizations + * @name OauthAuthorizationsGetAuthorization + * @summary Get a single authorization + * @request GET:/authorizations/{authorization_id} + * @deprecated */ - orgsListPublicMembers: ( - { org, ...query }: OrgsListPublicMembersParams, + oauthAuthorizationsGetAuthorization: ( + { authorizationId }: OauthAuthorizationsGetAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members\`, + this.request({ + path: \`/authorizations/\${authorizationId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags orgs - * @name OrgsListSamlSsoAuthorizations - * @summary List SAML SSO authorizations for an organization - * @request GET:/orgs/{org}/credential-authorizations + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForApp + * @summary Get-or-create an authorization for a specific app + * @request PUT:/authorizations/clients/{client_id} + * @deprecated */ - orgsListSamlSsoAuthorizations: ( - { org }: OrgsListSamlSsoAuthorizationsParams, + oauthAuthorizationsGetOrCreateAuthorizationForApp: ( + { clientId }: OauthAuthorizationsGetOrCreateAuthorizationForAppParams, + data: OauthAuthorizationsGetOrCreateAuthorizationForAppPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations\`, - method: "GET", + this.request< + OauthAuthorizationsGetOrCreateAuthorizationForAppData, + BasicError | ValidationError + >({ + path: \`/authorizations/clients/\${clientId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * - * @tags orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint + * @summary Get-or-create an authorization for a specific app and fingerprint + * @request PUT:/authorizations/clients/{client_id}/{fingerprint} + * @deprecated */ - orgsListWebhooks: ( - { org, ...query }: OrgsListWebhooksParams, + oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( + { + clientId, + fingerprint, + }: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintParams, + data: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, - method: "GET", - query: query, + this.request< + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData, + ValidationError + >({ + path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags orgs - * @name OrgsPingWebhook - * @summary Ping an organization webhook - * @request POST:/orgs/{org}/hooks/{hook_id}/pings + * @tags oauth-authorizations + * @name OauthAuthorizationsListAuthorizations + * @summary List your authorizations + * @request GET:/authorizations + * @deprecated */ - orgsPingWebhook: ( - { org, hookId }: OrgsPingWebhookParams, + oauthAuthorizationsListAuthorizations: ( + query: OauthAuthorizationsListAuthorizationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/authorizations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description 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. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. * - * @tags orgs - * @name OrgsRemoveMember - * @summary Remove an organization member - * @request DELETE:/orgs/{org}/members/{username} + * @tags oauth-authorizations + * @name OauthAuthorizationsUpdateAuthorization + * @summary Update an existing authorization + * @request PATCH:/authorizations/{authorization_id} + * @deprecated */ - orgsRemoveMember: ( - { org, username }: OrgsRemoveMemberParams, + oauthAuthorizationsUpdateAuthorization: ( + { authorizationId }: OauthAuthorizationsUpdateAuthorizationParams, + data: OauthAuthorizationsUpdateAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, - method: "DELETE", - ...params, - }), - + this.request( + { + path: \`/authorizations/\${authorizationId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), + }; + codesOfConduct = { /** - * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + * No description * - * @tags orgs - * @name OrgsRemoveMembershipForUser - * @summary Remove organization membership for a user - * @request DELETE:/orgs/{org}/memberships/{username} + * @tags codes-of-conduct + * @name CodesOfConductGetAllCodesOfConduct + * @summary Get all codes of conduct + * @request GET:/codes_of_conduct */ - orgsRemoveMembershipForUser: ( - { org, username }: OrgsRemoveMembershipForUserParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "DELETE", + codesOfConductGetAllCodesOfConduct: (params: RequestParams = {}) => + this.request< + CodesOfConductGetAllCodesOfConductData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/codes_of_conduct\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removing a user from this list will remove them from all the organization's repositories. + * No description * - * @tags orgs - * @name OrgsRemoveOutsideCollaborator - * @summary Remove outside collaborator from an organization - * @request DELETE:/orgs/{org}/outside_collaborators/{username} + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - orgsRemoveOutsideCollaborator: ( - { org, username }: OrgsRemoveOutsideCollaboratorParams, + codesOfConductGetConductCode: ( + { key }: CodesOfConductGetConductCodeParams, params: RequestParams = {}, ) => this.request< - OrgsRemoveOutsideCollaboratorData, - OrgsRemoveOutsideCollaboratorError + CodesOfConductGetConductCodeData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "DELETE", + path: \`/codes_of_conduct/\${key}\`, + method: "GET", + format: "json", ...params, }), - + }; + contentReferences = { /** - * No description + * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} + * @tags apps + * @name AppsCreateContentAttachment + * @summary Create a content attachment + * @request POST:/content_references/{content_reference_id}/attachments */ - orgsRemovePublicMembershipForAuthenticatedUser: ( - { org, username }: OrgsRemovePublicMembershipForAuthenticatedUserParams, + appsCreateContentAttachment: ( + { contentReferenceId }: AppsCreateContentAttachmentParams, + data: AppsCreateContentAttachmentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "DELETE", + this.request< + AppsCreateContentAttachmentData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/content_references/\${contentReferenceId}/attachments\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - + }; + emojis = { /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. + * @description Lists all the emojis available to use on GitHub. * - * @tags orgs - * @name OrgsRemoveSamlSsoAuthorization - * @summary Remove a SAML SSO authorization for an organization - * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - orgsRemoveSamlSsoAuthorization: ( - { org, credentialId }: OrgsRemoveSamlSsoAuthorizationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, - method: "DELETE", + emojisGet: (params: RequestParams = {}) => + this.request({ + path: \`/emojis\`, + method: "GET", + format: "json", ...params, }), - + }; + enterprises = { /** - * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. * - * @tags orgs - * @name OrgsSetMembershipForUser - * @summary Set organization membership for a user - * @request PUT:/orgs/{org}/memberships/{username} + * @tags audit-log + * @name AuditLogGetAuditLog + * @summary Get the audit log for an enterprise + * @request GET:/enterprises/{enterprise}/audit-log */ - orgsSetMembershipForUser: ( - { org, username }: OrgsSetMembershipForUserParams, - data: OrgsSetMembershipForUserPayload, + auditLogGetAuditLog: ( + { enterprise, ...query }: AuditLogGetAuditLogParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/enterprises/\${enterprise}/audit-log\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsSetPublicMembershipForAuthenticatedUser - * @summary Set public organization membership for the authenticated user - * @request PUT:/orgs/{org}/public_members/{username} + * @tags billing + * @name BillingGetGithubActionsBillingGhe + * @summary Get GitHub Actions billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/actions */ - orgsSetPublicMembershipForAuthenticatedUser: ( - { org, username }: OrgsSetPublicMembershipForAuthenticatedUserParams, + billingGetGithubActionsBillingGhe: ( + { enterprise }: BillingGetGithubActionsBillingGheParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "PUT", - ...params, - }, - ), + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/actions\`, + method: "GET", + format: "json", + ...params, + }), /** - * No description + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} + * @tags billing + * @name BillingGetGithubPackagesBillingGhe + * @summary Get GitHub Packages billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/packages */ - orgsUnblockUser: ( - { org, username }: OrgsUnblockUserParams, + billingGetGithubPackagesBillingGhe: ( + { enterprise }: BillingGetGithubPackagesBillingGheParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "DELETE", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/packages\`, + method: "GET", + format: "json", ...params, }), /** - * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsUpdate - * @summary Update an organization - * @request PATCH:/orgs/{org} + * @tags billing + * @name BillingGetSharedStorageBillingGhe + * @summary Get shared storage billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage */ - orgsUpdate: ( - { org }: OrgsUpdateParams, - data: OrgsUpdatePayload, + billingGetSharedStorageBillingGhe: ( + { enterprise }: BillingGetSharedStorageBillingGheParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, + method: "GET", format: "json", ...params, }), /** - * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." + * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsUpdateWebhook - * @summary Update an organization webhook - * @request PATCH:/orgs/{org}/hooks/{hook_id} + * @tags enterprise-admin + * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Add organization access to a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - orgsUpdateWebhook: ( - { org, hookId }: OrgsUpdateWebhookParams, - data: OrgsUpdateWebhookPayload, + enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + { + enterprise, + runnerGroupId, + orgId, + }: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request< + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. + * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsUpdateWebhookConfigForOrg - * @summary Update a webhook configuration for an organization - * @request PATCH:/orgs/{org}/hooks/{hook_id}/config + * @tags enterprise-admin + * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise + * @summary Add a self-hosted runner to a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - orgsUpdateWebhookConfigForOrg: ( - { org, hookId }: OrgsUpdateWebhookConfigForOrgParams, - data: OrgsUpdateWebhookConfigForOrgPayload, + enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + runnerId, + }: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request< + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "PUT", ...params, }), /** - * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` * - * @tags projects - * @name ProjectsCreateForOrg - * @summary Create an organization project - * @request POST:/orgs/{org}/projects + * @tags enterprise-admin + * @name EnterpriseAdminCreateRegistrationTokenForEnterprise + * @summary Create a registration token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/registration-token */ - projectsCreateForOrg: ( - { org }: ProjectsCreateForOrgParams, - data: ProjectsCreateForOrgPayload, + enterpriseAdminCreateRegistrationTokenForEnterprise: ( + { enterprise }: EnterpriseAdminCreateRegistrationTokenForEnterpriseParams, params: RequestParams = {}, ) => this.request< - ProjectsCreateForOrgData, - BasicError | ValidationErrorSimple + EnterpriseAdminCreateRegistrationTokenForEnterpriseData, + any >({ - path: \`/orgs/\${org}/projects\`, + path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, method: "POST", - body: data, - type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * - * @tags projects - * @name ProjectsListForOrg - * @summary List organization projects - * @request GET:/orgs/{org}/projects + * @tags enterprise-admin + * @name EnterpriseAdminCreateRemoveTokenForEnterprise + * @summary Create a remove token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/remove-token */ - projectsListForOrg: ( - { org, ...query }: ProjectsListForOrgParams, + enterpriseAdminCreateRemoveTokenForEnterprise: ( + { enterprise }: EnterpriseAdminCreateRemoveTokenForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, - method: "GET", - query: query, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, + method: "POST", format: "json", ...params, }), /** - * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. + * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentInOrg - * @summary Create reaction for a team discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @tags enterprise-admin + * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise + * @summary Create a self-hosted runner group for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runner-groups */ - reactionsCreateForTeamDiscussionCommentInOrg: ( + enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( { - org, - teamSlug, - discussionNumber, - commentNumber, - }: ReactionsCreateForTeamDiscussionCommentInOrgParams, - data: ReactionsCreateForTeamDiscussionCommentInOrgPayload, + enterprise, + }: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseParams, + data: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request< + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "POST", body: data, type: ContentType.Json, @@ -54689,718 +53305,789 @@ export class Api< }), /** - * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. + * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionInOrg - * @summary Create reaction for a team discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise + * @summary Delete a self-hosted runner from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} */ - reactionsCreateForTeamDiscussionInOrg: ( + enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( { - org, - teamSlug, - discussionNumber, - }: ReactionsCreateForTeamDiscussionInOrgParams, - data: ReactionsCreateForTeamDiscussionInOrgPayload, + enterprise, + runnerId, + }: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request< + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsDeleteForTeamDiscussion - * @summary Delete team discussion reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise + * @summary Delete a self-hosted runner group from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - reactionsDeleteForTeamDiscussion: ( + enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( { - org, - teamSlug, - discussionNumber, - reactionId, - }: ReactionsDeleteForTeamDiscussionParams, + enterprise, + runnerGroupId, + }: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, + this.request< + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", ...params, }), /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsDeleteForTeamDiscussionComment - * @summary Delete team discussion comment reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + * @tags enterprise-admin + * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise + * @summary Disable a selected organization for GitHub Actions in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - reactionsDeleteForTeamDiscussionComment: ( + enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( { - org, - teamSlug, - discussionNumber, - commentNumber, - reactionId, - }: ReactionsDeleteForTeamDiscussionCommentParams, + enterprise, + orgId, + }: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, + this.request< + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, method: "DELETE", ...params, }), /** - * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. + * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentInOrg - * @summary List reactions for a team discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @tags enterprise-admin + * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise + * @summary Enable a selected organization for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - reactionsListForTeamDiscussionCommentInOrg: ( + enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( { - org, - teamSlug, - discussionNumber, - commentNumber, - ...query - }: ReactionsListForTeamDiscussionCommentInOrgParams, + enterprise, + orgId, + }: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "GET", - query: query, - format: "json", + this.request< + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. + * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags reactions - * @name ReactionsListForTeamDiscussionInOrg - * @summary List reactions for a team discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags enterprise-admin + * @name EnterpriseAdminGetAllowedActionsEnterprise + * @summary Get allowed actions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions */ - reactionsListForTeamDiscussionInOrg: ( - { - org, - teamSlug, - discussionNumber, - ...query - }: ReactionsListForTeamDiscussionInOrgParams, + enterpriseAdminGetAllowedActionsEnterprise: ( + { enterprise }: EnterpriseAdminGetAllowedActionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags repos - * @name ReposCreateInOrg - * @summary Create an organization repository - * @request POST:/orgs/{org}/repos + * @tags enterprise-admin + * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise + * @summary Get GitHub Actions permissions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions */ - reposCreateInOrg: ( - { org }: ReposCreateInOrgParams, - data: ReposCreateInOrgPayload, + enterpriseAdminGetGithubActionsPermissionsEnterprise: ( + { + enterprise, + }: EnterpriseAdminGetGithubActionsPermissionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/repos\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, + method: "GET", format: "json", ...params, }), /** - * @description Lists repositories for the specified organization. + * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise + * @summary Get a self-hosted runner for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} */ - reposListForOrg: ( - { org, ...query }: ReposListForOrgParams, + enterpriseAdminGetSelfHostedRunnerForEnterprise: ( + { + enterprise, + runnerId, + }: EnterpriseAdminGetSelfHostedRunnerForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/repos\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. + * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserInOrg - * @summary Add or update team membership for a user - * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise + * @summary Get a self-hosted runner group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - teamsAddOrUpdateMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsAddOrUpdateMembershipForUserInOrgParams, - data: TeamsAddOrUpdateMembershipForUserInOrgPayload, + enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseParams, params: RequestParams = {}, ) => this.request< - TeamsAddOrUpdateMembershipForUserInOrgData, - TeamsAddOrUpdateMembershipForUserInOrgError + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData, + any >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsInOrg - * @summary Add or update team project permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags enterprise-admin + * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary List organization access to a self-hosted runner group in an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - teamsAddOrUpdateProjectPermissionsInOrg: ( + enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise: ( { - org, - teamSlug, - projectId, - }: TeamsAddOrUpdateProjectPermissionsInOrgParams, - data: TeamsAddOrUpdateProjectPermissionsInOrgPayload, + enterprise, + runnerGroupId, + ...query + }: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => this.request< - TeamsAddOrUpdateProjectPermissionsInOrgData, - TeamsAddOrUpdateProjectPermissionsInOrgError + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsInOrg - * @summary Add or update team repository permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags enterprise-admin + * @name EnterpriseAdminListRunnerApplicationsForEnterprise + * @summary List runner applications for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/downloads */ - teamsAddOrUpdateRepoPermissionsInOrg: ( + enterpriseAdminListRunnerApplicationsForEnterprise: ( + { enterprise }: EnterpriseAdminListRunnerApplicationsForEnterpriseParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, + method: "GET", + format: "json", + ...params, + }, + ), + + /** + * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * + * @tags enterprise-admin + * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary List selected organizations enabled for GitHub Actions in an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/organizations + */ + enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise: ( { - org, - teamSlug, - owner, - repo, - }: TeamsAddOrUpdateRepoPermissionsInOrgParams, - data: TeamsAddOrUpdateRepoPermissionsInOrgPayload, + enterprise, + ...query + }: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request< + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCheckPermissionsForProjectInOrg - * @summary Check team permissions for a project - * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise + * @summary List self-hosted runner groups for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups */ - teamsCheckPermissionsForProjectInOrg: ( - { org, teamSlug, projectId }: TeamsCheckPermissionsForProjectInOrgParams, + enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + this.request< + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCheckPermissionsForRepoInOrg - * @summary Check team permissions for a repository - * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersForEnterprise + * @summary List self-hosted runners for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners */ - teamsCheckPermissionsForRepoInOrg: ( - { org, teamSlug, owner, repo }: TeamsCheckPermissionsForRepoInOrgParams, + enterpriseAdminListSelfHostedRunnersForEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListSelfHostedRunnersForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCreate - * @summary Create a team - * @request POST:/orgs/{org}/teams + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise + * @summary List self-hosted runners in a group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - teamsCreate: ( - { org }: TeamsCreateParams, - data: TeamsCreatePayload, + enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + ...query + }: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCreateDiscussionCommentInOrg - * @summary Create a discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags enterprise-admin + * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Remove organization access to a self-hosted runner group in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - teamsCreateDiscussionCommentInOrg: ( + enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( { - org, - teamSlug, - discussionNumber, - }: TeamsCreateDiscussionCommentInOrgParams, - data: TeamsCreateDiscussionCommentInOrgPayload, + enterprise, + runnerGroupId, + orgId, + }: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request< + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "DELETE", ...params, }), /** - * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. + * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCreateDiscussionInOrg - * @summary Create a discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions + * @tags enterprise-admin + * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise + * @summary Remove a self-hosted runner from a group for an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - teamsCreateDiscussionInOrg: ( - { org, teamSlug }: TeamsCreateDiscussionInOrgParams, - data: TeamsCreateDiscussionInOrgPayload, + enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + runnerId, + }: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request< + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg - * @summary Create or update IdP group connections - * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags enterprise-admin + * @name EnterpriseAdminSetAllowedActionsEnterprise + * @summary Set allowed actions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions */ - teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( - { org, teamSlug }: TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams, - data: TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload, + enterpriseAdminSetAllowedActionsEnterprise: ( + { enterprise }: EnterpriseAdminSetAllowedActionsEnterpriseParams, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "PATCH", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsDeleteDiscussionCommentInOrg - * @summary Delete a discussion comment - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags enterprise-admin + * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise + * @summary Set GitHub Actions permissions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions */ - teamsDeleteDiscussionCommentInOrg: ( + enterpriseAdminSetGithubActionsPermissionsEnterprise: ( { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsDeleteDiscussionCommentInOrgParams, + enterprise, + }: EnterpriseAdminSetGithubActionsPermissionsEnterpriseParams, + data: EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", + this.request< + EnterpriseAdminSetGithubActionsPermissionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsDeleteDiscussionInOrg - * @summary Delete a discussion - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags enterprise-admin + * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Set organization access for a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - teamsDeleteDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsDeleteDiscussionInOrgParams, + enterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, + data: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "DELETE", + this.request< + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. + * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsDeleteInOrg - * @summary Delete a team - * @request DELETE:/orgs/{org}/teams/{team_slug} + * @tags enterprise-admin + * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary Set selected organizations enabled for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations */ - teamsDeleteInOrg: ( - { org, teamSlug }: TeamsDeleteInOrgParams, + enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( + { + enterprise, + }: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseParams, + data: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "DELETE", + this.request< + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. + * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsGetByName - * @summary Get a team by name - * @request GET:/orgs/{org}/teams/{team_slug} + * @tags enterprise-admin + * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise + * @summary Set self-hosted runners in a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - teamsGetByName: ( - { org, teamSlug }: TeamsGetByNameParams, + enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseParams, + data: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "GET", - format: "json", + this.request< + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags teams - * @name TeamsGetDiscussionCommentInOrg - * @summary Get a discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags enterprise-admin + * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise + * @summary Update a self-hosted runner group for an enterprise + * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - teamsGetDiscussionCommentInOrg: ( + enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsGetDiscussionCommentInOrgParams, + enterprise, + runnerGroupId, + }: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseParams, + data: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "GET", + this.request< + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + events = { /** - * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. * - * @tags teams - * @name TeamsGetDiscussionInOrg - * @summary Get a discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags activity + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - teamsGetDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsGetDiscussionInOrgParams, + activityListPublicEvents: ( + query: ActivityListPublicEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + this.request< + ActivityListPublicEventsData, + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/events\`, method: "GET", + query: query, format: "json", ...params, }), - + }; + feeds = { /** - * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. * - * @tags teams - * @name TeamsGetMembershipForUserInOrg - * @summary Get team membership for a user - * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags activity + * @name ActivityGetFeeds + * @summary Get feeds + * @request GET:/feeds */ - teamsGetMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsGetMembershipForUserInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + activityGetFeeds: (params: RequestParams = {}) => + this.request({ + path: \`/feeds\`, method: "GET", format: "json", ...params, }), - + }; + gists = { /** - * @description Lists all teams in an organization that are visible to the authenticated user. + * No description * - * @tags teams - * @name TeamsList - * @summary List teams - * @request GET:/orgs/{org}/teams + * @tags gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - teamsList: ( - { org, ...query }: TeamsListParams, + gistsCheckIsStarred: ( + { gistId }: GistsCheckIsStarredParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, + this.request({ + path: \`/gists/\${gistId}/star\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. + * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. * - * @tags teams - * @name TeamsListChildInOrg - * @summary List child teams - * @request GET:/orgs/{org}/teams/{team_slug}/teams + * @tags gists + * @name GistsCreate + * @summary Create a gist + * @request POST:/gists */ - teamsListChildInOrg: ( - { org, teamSlug, ...query }: TeamsListChildInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, - method: "GET", - query: query, + gistsCreate: (data: GistsCreatePayload, params: RequestParams = {}) => + this.request({ + path: \`/gists\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * No description * - * @tags teams - * @name TeamsListDiscussionCommentsInOrg - * @summary List discussion comments - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments */ - teamsListDiscussionCommentsInOrg: ( - { - org, - teamSlug, - discussionNumber, - ...query - }: TeamsListDiscussionCommentsInOrgParams, + gistsCreateComment: ( + { gistId }: GistsCreateCommentParams, + data: GistsCreateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/gists/\${gistId}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. + * No description * - * @tags teams - * @name TeamsListDiscussionsInOrg - * @summary List discussions - * @request GET:/orgs/{org}/teams/{team_slug}/discussions + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} */ - teamsListDiscussionsInOrg: ( - { org, teamSlug, ...query }: TeamsListDiscussionsInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, - method: "GET", - query: query, - format: "json", + gistsDelete: ({ gistId }: GistsDeleteParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}\`, + method: "DELETE", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: + * No description * - * @tags teams - * @name TeamsListIdpGroupsForOrg - * @summary List IdP groups for an organization - * @request GET:/orgs/{org}/team-sync/groups + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} */ - teamsListIdpGroupsForOrg: ( - { org, ...query }: TeamsListIdpGroupsForOrgParams, + gistsDeleteComment: ( + { gistId, commentId }: GistsDeleteCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/team-sync/groups\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "DELETE", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @description **Note**: This was previously \`/gists/:gist_id/fork\`. * - * @tags teams - * @name TeamsListIdpGroupsInOrg - * @summary List IdP groups for a team - * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags gists + * @name GistsFork + * @summary Fork a gist + * @request POST:/gists/{gist_id}/forks */ - teamsListIdpGroupsInOrg: ( - { org, teamSlug }: TeamsListIdpGroupsInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "GET", + gistsFork: ({ gistId }: GistsForkParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/forks\`, + method: "POST", format: "json", ...params, }), /** - * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. + * No description * - * @tags teams - * @name TeamsListMembersInOrg - * @summary List team members - * @request GET:/orgs/{org}/teams/{team_slug}/members + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - teamsListMembersInOrg: ( - { org, teamSlug, ...query }: TeamsListMembersInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, + gistsGet: ({ gistId }: GistsGetParams, params: RequestParams = {}) => + this.request< + GistsGetData, + | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; + } + | BasicError + >({ + path: \`/gists/\${gistId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. + * No description * - * @tags teams - * @name TeamsListPendingInvitationsInOrg - * @summary List pending team invitations - * @request GET:/orgs/{org}/teams/{team_slug}/invitations + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} */ - teamsListPendingInvitationsInOrg: ( - { org, teamSlug, ...query }: TeamsListPendingInvitationsInOrgParams, + gistsGetComment: ( + { gistId, commentId }: GistsGetCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + this.request< + GistsGetCommentData, + | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; + } + | BasicError + >({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. + * No description * - * @tags teams - * @name TeamsListProjectsInOrg - * @summary List team projects - * @request GET:/orgs/{org}/teams/{team_slug}/projects + * @tags gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - teamsListProjectsInOrg: ( - { org, teamSlug, ...query }: TeamsListProjectsInOrgParams, + gistsGetRevision: ( + { gistId, sha }: GistsGetRevisionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, + this.request({ + path: \`/gists/\${gistId}/\${sha}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. + * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: * - * @tags teams - * @name TeamsListReposInOrg - * @summary List team repositories - * @request GET:/orgs/{org}/teams/{team_slug}/repos + * @tags gists + * @name GistsList + * @summary List gists for the authenticated user + * @request GET:/gists */ - teamsListReposInOrg: ( - { org, teamSlug, ...query }: TeamsListReposInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, + gistsList: (query: GistsListParams, params: RequestParams = {}) => + this.request({ + path: \`/gists\`, method: "GET", query: query, format: "json", @@ -55408,176 +54095,151 @@ export class Api< }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. + * No description * - * @tags teams - * @name TeamsRemoveMembershipForUserInOrg - * @summary Remove team membership for a user - * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - teamsRemoveMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsRemoveMembershipForUserInOrgParams, + gistsListComments: ( + { gistId, ...query }: GistsListCommentsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/comments\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * No description * - * @tags teams - * @name TeamsRemoveProjectInOrg - * @summary Remove a project from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - teamsRemoveProjectInOrg: ( - { org, teamSlug, projectId }: TeamsRemoveProjectInOrgParams, + gistsListCommits: ( + { gistId, ...query }: GistsListCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/commits\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * No description * - * @tags teams - * @name TeamsRemoveRepoInOrg - * @summary Remove a repository from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags gists + * @name GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - teamsRemoveRepoInOrg: ( - { org, teamSlug, owner, repo }: TeamsRemoveRepoInOrgParams, + gistsListForks: ( + { gistId, ...query }: GistsListForksParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/forks\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. * - * @tags teams - * @name TeamsUpdateDiscussionCommentInOrg - * @summary Update a discussion comment - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags gists + * @name GistsListPublic + * @summary List public gists + * @request GET:/gists/public */ - teamsUpdateDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsUpdateDiscussionCommentInOrgParams, - data: TeamsUpdateDiscussionCommentInOrgPayload, + gistsListPublic: ( + query: GistsListPublicParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/gists/public\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @description List the authenticated user's starred gists: * - * @tags teams - * @name TeamsUpdateDiscussionInOrg - * @summary Update a discussion - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred */ - teamsUpdateDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsUpdateDiscussionInOrgParams, - data: TeamsUpdateDiscussionInOrgPayload, + gistsListStarred: ( + query: GistsListStarredParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/gists/starred\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags teams - * @name TeamsUpdateInOrg - * @summary Update a team - * @request PATCH:/orgs/{org}/teams/{team_slug} + * @tags gists + * @name GistsStar + * @summary Star a gist + * @request PUT:/gists/{gist_id}/star */ - teamsUpdateInOrg: ( - { org, teamSlug }: TeamsUpdateInOrgParams, - data: TeamsUpdateInOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + gistsStar: ({ gistId }: GistsStarParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "PUT", ...params, }), - }; - projects = { + /** - * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. + * No description * - * @tags projects - * @name ProjectsAddCollaborator - * @summary Add project collaborator - * @request PUT:/projects/{project_id}/collaborators/{username} + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - projectsAddCollaborator: ( - { projectId, username }: ProjectsAddCollaboratorParams, - data: ProjectsAddCollaboratorPayload, - params: RequestParams = {}, - ) => - this.request< - ProjectsAddCollaboratorData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + gistsUnstar: ({ gistId }: GistsUnstarParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "DELETE", ...params, }), /** - * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. * - * @tags projects - * @name ProjectsCreateCard - * @summary Create a project card - * @request POST:/projects/columns/{column_id}/cards + * @tags gists + * @name GistsUpdate + * @summary Update a gist + * @request PATCH:/gists/{gist_id} */ - projectsCreateCard: ( - { columnId }: ProjectsCreateCardParams, - data: ProjectsCreateCardPayload, + gistsUpdate: ( + { gistId }: GistsUpdateParams, + data: GistsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, - method: "POST", + this.request({ + path: \`/gists/\${gistId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -55587,956 +54249,907 @@ export class Api< /** * No description * - * @tags projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} */ - projectsCreateColumn: ( - { projectId }: ProjectsCreateColumnParams, - data: ProjectsCreateColumnPayload, + gistsUpdateComment: ( + { gistId, commentId }: GistsUpdateCommentParams, + data: GistsUpdateCommentPayload, params: RequestParams = {}, ) => - this.request< - ProjectsCreateColumnData, - BasicError | ValidationErrorSimple - >({ - path: \`/projects/\${projectId}/columns\`, - method: "POST", + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", ...params, }), - - /** - * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. - * - * @tags projects - * @name ProjectsDelete - * @summary Delete a project - * @request DELETE:/projects/{project_id} - */ - projectsDelete: ( - { projectId }: ProjectsDeleteParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/\${projectId}\`, - method: "DELETE", - ...params, - }), - - /** - * No description - * - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} - */ - projectsDeleteCard: ( - { cardId }: ProjectsDeleteCardParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "DELETE", - ...params, - }), - + }; + gitignore = { /** - * No description + * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). * - * @tags projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @tags gitignore + * @name GitignoreGetAllTemplates + * @summary Get all gitignore templates + * @request GET:/gitignore/templates */ - projectsDeleteColumn: ( - { columnId }: ProjectsDeleteColumnParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "DELETE", + gitignoreGetAllTemplates: (params: RequestParams = {}) => + this.request({ + path: \`/gitignore/templates\`, + method: "GET", + format: "json", ...params, }), /** - * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. * - * @tags projects - * @name ProjectsGet - * @summary Get a project - * @request GET:/projects/{project_id} + * @tags gitignore + * @name GitignoreGetTemplate + * @summary Get a gitignore template + * @request GET:/gitignore/templates/{name} */ - projectsGet: ( - { projectId }: ProjectsGetParams, + gitignoreGetTemplate: ( + { name }: GitignoreGetTemplateParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}\`, + this.request({ + path: \`/gitignore/templates/\${name}\`, method: "GET", format: "json", ...params, }), - + }; + installation = { /** - * No description + * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} + * @tags apps + * @name AppsListReposAccessibleToInstallation + * @summary List repositories accessible to the app installation + * @request GET:/installation/repositories */ - projectsGetCard: ( - { cardId }: ProjectsGetCardParams, + appsListReposAccessibleToInstallation: ( + query: AppsListReposAccessibleToInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, + this.request({ + path: \`/installation/repositories\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} + * @tags apps + * @name AppsRevokeInstallationAccessToken + * @summary Revoke an installation access token + * @request DELETE:/installation/token */ - projectsGetColumn: ( - { columnId }: ProjectsGetColumnParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "GET", - format: "json", + appsRevokeInstallationAccessToken: (params: RequestParams = {}) => + this.request({ + path: \`/installation/token\`, + method: "DELETE", ...params, }), - + }; + issues = { /** - * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. + * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags projects - * @name ProjectsGetPermissionForUser - * @summary Get project permission for a user - * @request GET:/projects/{project_id}/collaborators/{username}/permission + * @tags issues + * @name IssuesList + * @summary List issues assigned to the authenticated user + * @request GET:/issues */ - projectsGetPermissionForUser: ( - { projectId, username }: ProjectsGetPermissionForUserParams, - params: RequestParams = {}, - ) => - this.request< - ProjectsGetPermissionForUserData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, + issuesList: (query: IssuesListParams, params: RequestParams = {}) => + this.request({ + path: \`/issues\`, method: "GET", + query: query, format: "json", ...params, }), - + }; + licenses = { /** * No description * - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @tags licenses + * @name LicensesGet + * @summary Get a license + * @request GET:/licenses/{license} */ - projectsListCards: ( - { columnId, ...query }: ProjectsListCardsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, + licensesGet: ({ license }: LicensesGetParams, params: RequestParams = {}) => + this.request({ + path: \`/licenses/\${license}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. + * No description * - * @tags projects - * @name ProjectsListCollaborators - * @summary List project collaborators - * @request GET:/projects/{project_id}/collaborators + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - projectsListCollaborators: ( - { projectId, ...query }: ProjectsListCollaboratorsParams, + licensesGetAllCommonlyUsed: ( + query: LicensesGetAllCommonlyUsedParams, params: RequestParams = {}, ) => - this.request< - ProjectsListCollaboratorsData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators\`, + this.request({ + path: \`/licenses\`, method: "GET", query: query, format: "json", ...params, }), - + }; + markdown = { /** * No description * - * @tags projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @tags markdown + * @name MarkdownRender + * @summary Render a Markdown document + * @request POST:/markdown */ - projectsListColumns: ( - { projectId, ...query }: ProjectsListColumnsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/\${projectId}/columns\`, - method: "GET", - query: query, - format: "json", + markdownRender: (data: MarkdownRenderPayload, params: RequestParams = {}) => + this.request({ + path: \`/markdown\`, + method: "POST", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. * - * @tags projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @tags markdown + * @name MarkdownRenderRaw + * @summary Render a Markdown document in raw mode + * @request POST:/markdown/raw */ - projectsMoveCard: ( - { cardId }: ProjectsMoveCardParams, - data: ProjectsMoveCardPayload, + markdownRenderRaw: ( + data: MarkdownRenderRawPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}/moves\`, + this.request({ + path: \`/markdown/raw\`, method: "POST", body: data, - type: ContentType.Json, - format: "json", + type: ContentType.Text, ...params, }), - + }; + marketplaceListing = { /** - * No description + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @tags apps + * @name AppsGetSubscriptionPlanForAccount + * @summary Get a subscription plan for an account + * @request GET:/marketplace_listing/accounts/{account_id} */ - projectsMoveColumn: ( - { columnId }: ProjectsMoveColumnParams, - data: ProjectsMoveColumnPayload, + appsGetSubscriptionPlanForAccount: ( + { accountId }: AppsGetSubscriptionPlanForAccountParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/moves\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + AppsGetSubscriptionPlanForAccountData, + AppsGetSubscriptionPlanForAccountError + >({ + path: \`/marketplace_listing/accounts/\${accountId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags projects - * @name ProjectsRemoveCollaborator - * @summary Remove user as a collaborator - * @request DELETE:/projects/{project_id}/collaborators/{username} + * @tags apps + * @name AppsGetSubscriptionPlanForAccountStubbed + * @summary Get a subscription plan for an account (stubbed) + * @request GET:/marketplace_listing/stubbed/accounts/{account_id} */ - projectsRemoveCollaborator: ( - { projectId, username }: ProjectsRemoveCollaboratorParams, + appsGetSubscriptionPlanForAccountStubbed: ( + { accountId }: AppsGetSubscriptionPlanForAccountStubbedParams, params: RequestParams = {}, ) => this.request< - ProjectsRemoveCollaboratorData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError + AppsGetSubscriptionPlanForAccountStubbedData, + BasicError | void >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "DELETE", + path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags projects - * @name ProjectsUpdate - * @summary Update a project - * @request PATCH:/projects/{project_id} + * @tags apps + * @name AppsListAccountsForPlan + * @summary List accounts for a plan + * @request GET:/marketplace_listing/plans/{plan_id}/accounts */ - projectsUpdate: ( - { projectId }: ProjectsUpdateParams, - data: ProjectsUpdatePayload, + appsListAccountsForPlan: ( + { planId, ...query }: AppsListAccountsForPlanParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/plans/\${planId}/accounts\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @tags apps + * @name AppsListAccountsForPlanStubbed + * @summary List accounts for a plan (stubbed) + * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts */ - projectsUpdateCard: ( - { cardId }: ProjectsUpdateCardParams, - data: ProjectsUpdateCardPayload, + appsListAccountsForPlanStubbed: ( + { planId, ...query }: AppsListAccountsForPlanStubbedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_id} + * @tags apps + * @name AppsListPlans + * @summary List plans + * @request GET:/marketplace_listing/plans */ - projectsUpdateColumn: ( - { columnId }: ProjectsUpdateColumnParams, - data: ProjectsUpdateColumnPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + appsListPlans: (query: AppsListPlansParams, params: RequestParams = {}) => + this.request({ + path: \`/marketplace_listing/plans\`, + method: "GET", + query: query, format: "json", ...params, }), - }; - rateLimit = { + /** - * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags rate-limit - * @name RateLimitGet - * @summary Get rate limit status for the authenticated user - * @request GET:/rate_limit + * @tags apps + * @name AppsListPlansStubbed + * @summary List plans (stubbed) + * @request GET:/marketplace_listing/stubbed/plans */ - rateLimitGet: (params: RequestParams = {}) => - this.request({ - path: \`/rate_limit\`, + appsListPlansStubbed: ( + query: AppsListPlansStubbedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/marketplace_listing/stubbed/plans\`, method: "GET", + query: query, format: "json", ...params, }), }; - reactions = { + meta = { /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. * - * @tags reactions - * @name ReactionsDeleteLegacy - * @summary Delete a reaction (Legacy) - * @request DELETE:/reactions/{reaction_id} - * @deprecated + * @tags meta + * @name MetaGet + * @summary Get GitHub meta information + * @request GET:/meta */ - reactionsDeleteLegacy: ( - { reactionId }: ReactionsDeleteLegacyParams, - params: RequestParams = {}, - ) => - this.request< - ReactionsDeleteLegacyData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/reactions/\${reactionId}\`, - method: "DELETE", + metaGet: (params: RequestParams = {}) => + this.request({ + path: \`/meta\`, + method: "GET", + format: "json", ...params, }), }; - repos = { + networks = { /** - * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * No description * - * @tags actions - * @name ActionsCancelWorkflowRun - * @summary Cancel a workflow run - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + * @tags activity + * @name ActivityListPublicEventsForRepoNetwork + * @summary List public events for a network of repositories + * @request GET:/networks/{owner}/{repo}/events */ - actionsCancelWorkflowRun: ( - { owner, repo, runId }: ActionsCancelWorkflowRunParams, + activityListPublicEventsForRepoNetwork: ( + { owner, repo, ...query }: ActivityListPublicEventsForRepoNetworkParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, - method: "POST", + this.request({ + path: \`/networks/\${owner}/\${repo}/events\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + notifications = { /** - * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` + * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. * - * @tags actions - * @name ActionsCreateOrUpdateRepoSecret - * @summary Create or update a repository secret - * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags activity + * @name ActivityDeleteThreadSubscription + * @summary Delete a thread subscription + * @request DELETE:/notifications/threads/{thread_id}/subscription */ - actionsCreateOrUpdateRepoSecret: ( - { owner, repo, secretName }: ActionsCreateOrUpdateRepoSecretParams, - data: ActionsCreateOrUpdateRepoSecretPayload, + activityDeleteThreadSubscription: ( + { threadId }: ActivityDeleteThreadSubscriptionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "DELETE", ...params, }), /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` + * No description * - * @tags actions - * @name ActionsCreateRegistrationTokenForRepo - * @summary Create a registration token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - actionsCreateRegistrationTokenForRepo: ( - { owner, repo }: ActionsCreateRegistrationTokenForRepoParams, + activityGetThread: ( + { threadId }: ActivityGetThreadParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, - method: "POST", + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. * - * @tags actions - * @name ActionsCreateRemoveTokenForRepo - * @summary Create a remove token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + * @tags activity + * @name ActivityGetThreadSubscriptionForAuthenticatedUser + * @summary Get a thread subscription for the authenticated user + * @request GET:/notifications/threads/{thread_id}/subscription */ - actionsCreateRemoveTokenForRepo: ( - { owner, repo }: ActionsCreateRemoveTokenForRepoParams, + activityGetThreadSubscriptionForAuthenticatedUser: ( + { threadId }: ActivityGetThreadSubscriptionForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, - method: "POST", + this.request< + ActivityGetThreadSubscriptionForAuthenticatedUserData, + BasicError + >({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "GET", format: "json", ...params, }), /** - * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + * @description List all notifications for the current user, sorted by most recently updated. * - * @tags actions - * @name ActionsCreateWorkflowDispatch - * @summary Create a workflow dispatch event - * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + * @tags activity + * @name ActivityListNotificationsForAuthenticatedUser + * @summary List notifications for the authenticated user + * @request GET:/notifications */ - actionsCreateWorkflowDispatch: ( - { owner, repo, workflowId }: ActionsCreateWorkflowDispatchParams, - data: ActionsCreateWorkflowDispatchPayload, + activityListNotificationsForAuthenticatedUser: ( + query: ActivityListNotificationsForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + ActivityListNotificationsForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/notifications\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. * - * @tags actions - * @name ActionsDeleteArtifact - * @summary Delete an artifact - * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @tags activity + * @name ActivityMarkNotificationsAsRead + * @summary Mark notifications as read + * @request PUT:/notifications */ - actionsDeleteArtifact: ( - { owner, repo, artifactId }: ActionsDeleteArtifactParams, + activityMarkNotificationsAsRead: ( + data: ActivityMarkNotificationsAsReadPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "DELETE", + this.request({ + path: \`/notifications\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * No description * - * @tags actions - * @name ActionsDeleteRepoSecret - * @summary Delete a repository secret - * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} */ - actionsDeleteRepoSecret: ( - { owner, repo, secretName }: ActionsDeleteRepoSecretParams, + activityMarkThreadAsRead: ( + { threadId }: ActivityMarkThreadAsReadParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "DELETE", + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "PATCH", ...params, }), /** - * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromRepo - * @summary Delete a self-hosted runner from a repository - * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags activity + * @name ActivitySetThreadSubscription + * @summary Set a thread subscription + * @request PUT:/notifications/threads/{thread_id}/subscription */ - actionsDeleteSelfHostedRunnerFromRepo: ( - { owner, repo, runnerId }: ActionsDeleteSelfHostedRunnerFromRepoParams, + activitySetThreadSubscription: ( + { threadId }: ActivitySetThreadSubscriptionParams, + data: ActivitySetThreadSubscriptionPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "DELETE", + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - + }; + octocat = { /** - * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Get the octocat as ASCII art * - * @tags actions - * @name ActionsDeleteWorkflowRun - * @summary Delete a workflow run - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags meta + * @name MetaGetOctocat + * @summary Get Octocat + * @request GET:/octocat */ - actionsDeleteWorkflowRun: ( - { owner, repo, runId }: ActionsDeleteWorkflowRunParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "DELETE", + metaGetOctocat: (query: MetaGetOctocatParams, params: RequestParams = {}) => + this.request({ + path: \`/octocat\`, + method: "GET", + query: query, ...params, }), - + }; + organizations = { /** - * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. * - * @tags actions - * @name ActionsDeleteWorkflowRunLogs - * @summary Delete workflow run logs - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @tags orgs + * @name OrgsList + * @summary List organizations + * @request GET:/organizations */ - actionsDeleteWorkflowRunLogs: ( - { owner, repo, runId }: ActionsDeleteWorkflowRunLogsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, - method: "DELETE", + orgsList: (query: OrgsListParams, params: RequestParams = {}) => + this.request({ + path: \`/organizations\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + orgs = { /** - * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsDisableWorkflow - * @summary Disable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Add repository access to a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} */ - actionsDisableWorkflow: ( - { owner, repo, workflowId }: ActionsDisableWorkflowParams, + actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + repositoryId, + }: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, method: "PUT", ...params, }), /** - * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsDownloadArtifact - * @summary Download an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + * @name ActionsAddSelectedRepoToOrgSecret + * @summary Add selected repository to an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - actionsDownloadArtifact: ( - { owner, repo, artifactId, archiveFormat }: ActionsDownloadArtifactParams, + actionsAddSelectedRepoToOrgSecret: ( + { + org, + secretName, + repositoryId, + }: ActionsAddSelectedRepoToOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsDownloadJobLogsForWorkflowRun - * @summary Download job logs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs + * @name ActionsAddSelfHostedRunnerToGroupForOrg + * @summary Add a self-hosted runner to a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - actionsDownloadJobLogsForWorkflowRun: ( - { owner, repo, jobId }: ActionsDownloadJobLogsForWorkflowRunParams, + actionsAddSelfHostedRunnerToGroupForOrg: ( + { + org, + runnerGroupId, + runnerId, + }: ActionsAddSelfHostedRunnerToGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "PUT", ...params, }), /** - * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` * * @tags actions - * @name ActionsDownloadWorkflowRunLogs - * @summary Download workflow run logs - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @name ActionsCreateOrUpdateOrgSecret + * @summary Create or update an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name} */ - actionsDownloadWorkflowRunLogs: ( - { owner, repo, runId }: ActionsDownloadWorkflowRunLogsParams, + actionsCreateOrUpdateOrgSecret: ( + { org, secretName }: ActionsCreateOrUpdateOrgSecretParams, + data: ActionsCreateOrUpdateOrgSecretPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` * * @tags actions - * @name ActionsEnableWorkflow - * @summary Enable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + * @name ActionsCreateRegistrationTokenForOrg + * @summary Create a registration token for an organization + * @request POST:/orgs/{org}/actions/runners/registration-token */ - actionsEnableWorkflow: ( - { owner, repo, workflowId }: ActionsEnableWorkflowParams, + actionsCreateRegistrationTokenForOrg: ( + { org }: ActionsCreateRegistrationTokenForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/actions/runners/registration-token\`, + method: "POST", + format: "json", ...params, }), /** - * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * * @tags actions - * @name ActionsGetAllowedActionsRepository - * @summary Get allowed actions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @name ActionsCreateRemoveTokenForOrg + * @summary Create a remove token for an organization + * @request POST:/orgs/{org}/actions/runners/remove-token */ - actionsGetAllowedActionsRepository: ( - { owner, repo }: ActionsGetAllowedActionsRepositoryParams, + actionsCreateRemoveTokenForOrg: ( + { org }: ActionsCreateRemoveTokenForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/runners/remove-token\`, + method: "POST", format: "json", ...params, }), /** - * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsGetArtifact - * @summary Get an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @name ActionsCreateSelfHostedRunnerGroupForOrg + * @summary Create a self-hosted runner group for an organization + * @request POST:/orgs/{org}/actions/runner-groups */ - actionsGetArtifact: ( - { owner, repo, artifactId }: ActionsGetArtifactParams, + actionsCreateSelfHostedRunnerGroupForOrg: ( + { org }: ActionsCreateSelfHostedRunnerGroupForOrgParams, + data: ActionsCreateSelfHostedRunnerGroupForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsGetGithubActionsPermissionsRepository - * @summary Get GitHub Actions permissions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions + * @name ActionsDeleteOrgSecret + * @summary Delete an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} */ - actionsGetGithubActionsPermissionsRepository: ( - { owner, repo }: ActionsGetGithubActionsPermissionsRepositoryParams, + actionsDeleteOrgSecret: ( + { org, secretName }: ActionsDeleteOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "DELETE", ...params, }), /** - * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsGetJobForWorkflowRun - * @summary Get a job for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} + * @name ActionsDeleteSelfHostedRunnerFromOrg + * @summary Delete a self-hosted runner from an organization + * @request DELETE:/orgs/{org}/actions/runners/{runner_id} */ - actionsGetJobForWorkflowRun: ( - { owner, repo, jobId }: ActionsGetJobForWorkflowRunParams, + actionsDeleteSelfHostedRunnerFromOrg: ( + { org, runnerId }: ActionsDeleteSelfHostedRunnerFromOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsGetRepoPublicKey - * @summary Get a repository public key - * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key + * @name ActionsDeleteSelfHostedRunnerGroupFromOrg + * @summary Delete a self-hosted runner group from an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - actionsGetRepoPublicKey: ( - { owner, repo }: ActionsGetRepoPublicKeyParams, + actionsDeleteSelfHostedRunnerGroupFromOrg: ( + { org, runnerGroupId }: ActionsDeleteSelfHostedRunnerGroupFromOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + method: "DELETE", ...params, }), /** - * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * * @tags actions - * @name ActionsGetRepoSecret - * @summary Get a repository secret - * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @name ActionsDisableSelectedRepositoryGithubActionsOrganization + * @summary Disable a selected repository for GitHub Actions in an organization + * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - actionsGetRepoSecret: ( - { owner, repo, secretName }: ActionsGetRepoSecretParams, + actionsDisableSelectedRepositoryGithubActionsOrganization: ( + { + org, + repositoryId, + }: ActionsDisableSelectedRepositoryGithubActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "GET", - format: "json", + this.request< + ActionsDisableSelectedRepositoryGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * * @tags actions - * @name ActionsGetSelfHostedRunnerForRepo - * @summary Get a self-hosted runner for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @name ActionsEnableSelectedRepositoryGithubActionsOrganization + * @summary Enable a selected repository for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - actionsGetSelfHostedRunnerForRepo: ( - { owner, repo, runnerId }: ActionsGetSelfHostedRunnerForRepoParams, + actionsEnableSelectedRepositoryGithubActionsOrganization: ( + { + org, + repositoryId, + }: ActionsEnableSelectedRepositoryGithubActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "GET", - format: "json", + this.request< + ActionsEnableSelectedRepositoryGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * * @tags actions - * @name ActionsGetWorkflow - * @summary Get a workflow - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + * @name ActionsGetAllowedActionsOrganization + * @summary Get allowed actions for an organization + * @request GET:/orgs/{org}/actions/permissions/selected-actions */ - actionsGetWorkflow: ( - { owner, repo, workflowId }: ActionsGetWorkflowParams, + actionsGetAllowedActionsOrganization: ( + { org }: ActionsGetAllowedActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "GET", format: "json", ...params, }), /** - * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * * @tags actions - * @name ActionsGetWorkflowRun - * @summary Get a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} + * @name ActionsGetGithubActionsPermissionsOrganization + * @summary Get GitHub Actions permissions for an organization + * @request GET:/orgs/{org}/actions/permissions */ - actionsGetWorkflowRun: ( - { owner, repo, runId }: ActionsGetWorkflowRunParams, + actionsGetGithubActionsPermissionsOrganization: ( + { org }: ActionsGetGithubActionsPermissionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsGetWorkflowRunUsage - * @summary Get workflow run usage - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing + * @name ActionsGetOrgPublicKey + * @summary Get an organization public key + * @request GET:/orgs/{org}/actions/secrets/public-key */ - actionsGetWorkflowRunUsage: ( - { owner, repo, runId }: ActionsGetWorkflowRunUsageParams, + actionsGetOrgPublicKey: ( + { org }: ActionsGetOrgPublicKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/public-key\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsGetWorkflowUsage - * @summary Get workflow usage - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + * @name ActionsGetOrgSecret + * @summary Get an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name} */ - actionsGetWorkflowUsage: ( - { owner, repo, workflowId }: ActionsGetWorkflowUsageParams, + actionsGetOrgSecret: ( + { org, secretName }: ActionsGetOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "GET", format: "json", ...params, }), /** - * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListArtifactsForRepo - * @summary List artifacts for a repository - * @request GET:/repos/{owner}/{repo}/actions/artifacts + * @name ActionsGetSelfHostedRunnerForOrg + * @summary Get a self-hosted runner for an organization + * @request GET:/orgs/{org}/actions/runners/{runner_id} */ - actionsListArtifactsForRepo: ( - { owner, repo, ...query }: ActionsListArtifactsForRepoParams, + actionsGetSelfHostedRunnerForOrg: ( + { org, runnerId }: ActionsGetSelfHostedRunnerForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListJobsForWorkflowRun - * @summary List jobs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs + * @name ActionsGetSelfHostedRunnerGroupForOrg + * @summary Get a self-hosted runner group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - actionsListJobsForWorkflowRun: ( - { owner, repo, runId, ...query }: ActionsListJobsForWorkflowRunParams, + actionsGetSelfHostedRunnerGroupForOrg: ( + { org, runnerGroupId }: ActionsGetSelfHostedRunnerGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsListRepoSecrets - * @summary List repository secrets - * @request GET:/repos/{owner}/{repo}/actions/secrets + * @name ActionsListOrgSecrets + * @summary List organization secrets + * @request GET:/orgs/{org}/actions/secrets */ - actionsListRepoSecrets: ( - { owner, repo, ...query }: ActionsListRepoSecretsParams, + actionsListOrgSecrets: ( + { org, ...query }: ActionsListOrgSecretsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets\`, method: "GET", query: query, format: "json", @@ -56544,78 +55157,85 @@ export class Api< }), /** - * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListRepoWorkflows - * @summary List repository workflows - * @request GET:/repos/{owner}/{repo}/actions/workflows + * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg + * @summary List repository access to a self-hosted runner group in an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - actionsListRepoWorkflows: ( - { owner, repo, ...query }: ActionsListRepoWorkflowsParams, + actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + }: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListRunnerApplicationsForRepo - * @summary List runner applications for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/downloads + * @name ActionsListRunnerApplicationsForOrg + * @summary List runner applications for an organization + * @request GET:/orgs/{org}/actions/runners/downloads */ - actionsListRunnerApplicationsForRepo: ( - { owner, repo }: ActionsListRunnerApplicationsForRepoParams, + actionsListRunnerApplicationsForOrg: ( + { org }: ActionsListRunnerApplicationsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, + this.request({ + path: \`/orgs/\${org}/actions/runners/downloads\`, method: "GET", format: "json", ...params, }), /** - * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsListSelfHostedRunnersForRepo - * @summary List self-hosted runners for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners + * @name ActionsListSelectedReposForOrgSecret + * @summary List selected repositories for an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - actionsListSelfHostedRunnersForRepo: ( - { owner, repo, ...query }: ActionsListSelfHostedRunnersForRepoParams, + actionsListSelectedReposForOrgSecret: ( + { org, secretName }: ActionsListSelectedReposForOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * * @tags actions - * @name ActionsListWorkflowRunArtifacts - * @summary List workflow run artifacts - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization + * @summary List selected repositories enabled for GitHub Actions in an organization + * @request GET:/orgs/{org}/actions/permissions/repositories */ - actionsListWorkflowRunArtifacts: ( - { owner, repo, runId, ...query }: ActionsListWorkflowRunArtifactsParams, + actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( + { + org, + ...query + }: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, + this.request< + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "GET", query: query, format: "json", @@ -56623,19 +55243,19 @@ export class Api< }), /** - * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListWorkflowRuns - * @summary List workflow runs - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + * @name ActionsListSelfHostedRunnerGroupsForOrg + * @summary List self-hosted runner groups for an organization + * @request GET:/orgs/{org}/actions/runner-groups */ - actionsListWorkflowRuns: ( - { owner, repo, workflowId, ...query }: ActionsListWorkflowRunsParams, + actionsListSelfHostedRunnerGroupsForOrg: ( + { org, ...query }: ActionsListSelfHostedRunnerGroupsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, method: "GET", query: query, format: "json", @@ -56643,19 +55263,19 @@ export class Api< }), /** - * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsListWorkflowRunsForRepo - * @summary List workflow runs for a repository - * @request GET:/repos/{owner}/{repo}/actions/runs + * @name ActionsListSelfHostedRunnersForOrg + * @summary List self-hosted runners for an organization + * @request GET:/orgs/{org}/actions/runners */ - actionsListWorkflowRunsForRepo: ( - { owner, repo, ...query }: ActionsListWorkflowRunsForRepoParams, + actionsListSelfHostedRunnersForOrg: ( + { org, ...query }: ActionsListSelfHostedRunnersForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs\`, + this.request({ + path: \`/orgs/\${org}/actions/runners\`, method: "GET", query: query, format: "json", @@ -56663,201 +55283,226 @@ export class Api< }), /** - * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsReRunWorkflow - * @summary Re-run a workflow - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun + * @name ActionsListSelfHostedRunnersInGroupForOrg + * @summary List self-hosted runners in a group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners */ - actionsReRunWorkflow: ( - { owner, repo, runId }: ActionsReRunWorkflowParams, + actionsListSelfHostedRunnersInGroupForOrg: ( + { + org, + runnerGroupId, + ...query + }: ActionsListSelfHostedRunnersInGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * * @tags actions - * @name ActionsSetAllowedActionsRepository - * @summary Set allowed actions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Remove repository access to a self-hosted runner group in an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} */ - actionsSetAllowedActionsRepository: ( - { owner, repo }: ActionsSetAllowedActionsRepositoryParams, - data: SelectedActions, + actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + repositoryId, + }: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request< + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsSetGithubActionsPermissionsRepository - * @summary Set GitHub Actions permissions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions + * @name ActionsRemoveSelectedRepoFromOrgSecret + * @summary Remove selected repository from an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - actionsSetGithubActionsPermissionsRepository: ( - { owner, repo }: ActionsSetGithubActionsPermissionsRepositoryParams, - data: ActionsSetGithubActionsPermissionsRepositoryPayload, + actionsRemoveSelectedRepoFromOrgSecret: ( + { + org, + secretName, + repositoryId, + }: ActionsRemoveSelectedRepoFromOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags activity - * @name ActivityDeleteRepoSubscription - * @summary Delete a repository subscription - * @request DELETE:/repos/{owner}/{repo}/subscription + * @tags actions + * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg + * @summary Remove a self-hosted runner from a group for an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - activityDeleteRepoSubscription: ( - { owner, repo }: ActivityDeleteRepoSubscriptionParams, + actionsRemoveSelfHostedRunnerFromGroupForOrg: ( + { + org, + runnerGroupId, + runnerId, + }: ActionsRemoveSelfHostedRunnerFromGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...params, }), /** - * No description + * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @tags actions + * @name ActionsSetAllowedActionsOrganization + * @summary Set allowed actions for an organization + * @request PUT:/orgs/{org}/actions/permissions/selected-actions */ - activityGetRepoSubscription: ( - { owner, repo }: ActivityGetRepoSubscriptionParams, + actionsSetAllowedActionsOrganization: ( + { org }: ActionsSetAllowedActionsOrganizationParams, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @tags actions + * @name ActionsSetGithubActionsPermissionsOrganization + * @summary Set GitHub Actions permissions for an organization + * @request PUT:/orgs/{org}/actions/permissions */ - activityListRepoEvents: ( - { owner, repo, ...query }: ActivityListRepoEventsParams, + actionsSetGithubActionsPermissionsOrganization: ( + { org }: ActionsSetGithubActionsPermissionsOrganizationParams, + data: ActionsSetGithubActionsPermissionsOrganizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/events\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description List all notifications for the current user. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags activity - * @name ActivityListRepoNotificationsForAuthenticatedUser - * @summary List repository notifications for the authenticated user - * @request GET:/repos/{owner}/{repo}/notifications + * @tags actions + * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Set repository access for a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - activityListRepoNotificationsForAuthenticatedUser: ( + actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( { - owner, - repo, - ...query - }: ActivityListRepoNotificationsForAuthenticatedUserParams, + org, + runnerGroupId, + }: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams, + data: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * - * @tags activity - * @name ActivityListStargazersForRepo - * @summary List stargazers - * @request GET:/repos/{owner}/{repo}/stargazers + * @tags actions + * @name ActionsSetSelectedReposForOrgSecret + * @summary Set selected repositories for an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - activityListStargazersForRepo: ( - { owner, repo, ...query }: ActivityListStargazersForRepoParams, + actionsSetSelectedReposForOrgSecret: ( + { org, secretName }: ActionsSetSelectedReposForOrgSecretParams, + data: ActionsSetSelectedReposForOrgSecretPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stargazers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists the people watching the specified repository. + * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * @tags actions + * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization + * @summary Set selected repositories enabled for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories */ - activityListWatchersForRepo: ( - { owner, repo, ...query }: ActivityListWatchersForRepoParams, + actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( + { + org, + }: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams, + data: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscribers\`, - method: "GET", - query: query, - format: "json", + this.request< + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags activity - * @name ActivityMarkRepoNotificationsAsRead - * @summary Mark repository notifications as read - * @request PUT:/repos/{owner}/{repo}/notifications + * @tags actions + * @name ActionsSetSelfHostedRunnersInGroupForOrg + * @summary Set self-hosted runners in a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners */ - activityMarkRepoNotificationsAsRead: ( - { owner, repo }: ActivityMarkRepoNotificationsAsReadParams, - data: ActivityMarkRepoNotificationsAsReadPayload, + actionsSetSelfHostedRunnersInGroupForOrg: ( + { org, runnerGroupId }: ActionsSetSelfHostedRunnersInGroupForOrgParams, + data: ActionsSetSelfHostedRunnersInGroupForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "PUT", body: data, type: ContentType.Json, @@ -56865,21 +55510,21 @@ export class Api< }), /** - * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags activity - * @name ActivitySetRepoSubscription - * @summary Set a repository subscription - * @request PUT:/repos/{owner}/{repo}/subscription + * @tags actions + * @name ActionsUpdateSelfHostedRunnerGroupForOrg + * @summary Update a self-hosted runner group for an organization + * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - activitySetRepoSubscription: ( - { owner, repo }: ActivitySetRepoSubscriptionParams, - data: ActivitySetRepoSubscriptionPayload, + actionsUpdateSelfHostedRunnerGroupForOrg: ( + { org, runnerGroupId }: ActionsUpdateSelfHostedRunnerGroupForOrgParams, + data: ActionsUpdateSelfHostedRunnerGroupForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -56887,180 +55532,174 @@ export class Api< }), /** - * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * No description * - * @tags apps - * @name AppsGetRepoInstallation - * @summary Get a repository installation for the authenticated app - * @request GET:/repos/{owner}/{repo}/installation + * @tags activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - appsGetRepoInstallation: ( - { owner, repo }: AppsGetRepoInstallationParams, + activityListPublicOrgEvents: ( + { org, ...query }: ActivityListPublicOrgEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/installation\`, + this.request({ + path: \`/orgs/\${org}/events\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. + * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags checks - * @name ChecksCreate - * @summary Create a check run - * @request POST:/repos/{owner}/{repo}/check-runs + * @tags apps + * @name AppsGetOrgInstallation + * @summary Get an organization installation for the authenticated app + * @request GET:/orgs/{org}/installation */ - checksCreate: ( - { owner, repo }: ChecksCreateParams, - data: ChecksCreatePayload, + appsGetOrgInstallation: ( + { org }: AppsGetOrgInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/installation\`, + method: "GET", format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags checks - * @name ChecksCreateSuite - * @summary Create a check suite - * @request POST:/repos/{owner}/{repo}/check-suites + * @tags billing + * @name BillingGetGithubActionsBillingOrg + * @summary Get GitHub Actions billing for an organization + * @request GET:/orgs/{org}/settings/billing/actions */ - checksCreateSuite: ( - { owner, repo }: ChecksCreateSuiteParams, - data: ChecksCreateSuitePayload, + billingGetGithubActionsBillingOrg: ( + { org }: BillingGetGithubActionsBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/settings/billing/actions\`, + method: "GET", format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags checks - * @name ChecksGet - * @summary Get a check run - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags billing + * @name BillingGetGithubPackagesBillingOrg + * @summary Get GitHub Packages billing for an organization + * @request GET:/orgs/{org}/settings/billing/packages */ - checksGet: ( - { owner, repo, checkRunId }: ChecksGetParams, + billingGetGithubPackagesBillingOrg: ( + { org }: BillingGetGithubPackagesBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + this.request({ + path: \`/orgs/\${org}/settings/billing/packages\`, method: "GET", format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags checks - * @name ChecksGetSuite - * @summary Get a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} + * @tags billing + * @name BillingGetSharedStorageBillingOrg + * @summary Get shared storage billing for an organization + * @request GET:/orgs/{org}/settings/billing/shared-storage */ - checksGetSuite: ( - { owner, repo, checkSuiteId }: ChecksGetSuiteParams, + billingGetSharedStorageBillingOrg: ( + { org }: BillingGetSharedStorageBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, + this.request({ + path: \`/orgs/\${org}/settings/billing/shared-storage\`, method: "GET", format: "json", ...params, }), /** - * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. + * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. * - * @tags checks - * @name ChecksListAnnotations - * @summary List check run annotations - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + * @tags interactions + * @name InteractionsGetRestrictionsForOrg + * @summary Get interaction restrictions for an organization + * @request GET:/orgs/{org}/interaction-limits */ - checksListAnnotations: ( - { owner, repo, checkRunId, ...query }: ChecksListAnnotationsParams, + interactionsGetRestrictionsForOrg: ( + { org }: InteractionsGetRestrictionsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. * - * @tags checks - * @name ChecksListForRef - * @summary List check runs for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs + * @tags interactions + * @name InteractionsRemoveRestrictionsForOrg + * @summary Remove interaction restrictions for an organization + * @request DELETE:/orgs/{org}/interaction-limits */ - checksListForRef: ( - { owner, repo, ref, ...query }: ChecksListForRefParams, + interactionsRemoveRestrictionsForOrg: ( + { org }: InteractionsRemoveRestrictionsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "DELETE", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. * - * @tags checks - * @name ChecksListForSuite - * @summary List check runs in a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + * @tags interactions + * @name InteractionsSetRestrictionsForOrg + * @summary Set interaction restrictions for an organization + * @request PUT:/orgs/{org}/interaction-limits */ - checksListForSuite: ( - { owner, repo, checkSuiteId, ...query }: ChecksListForSuiteParams, + interactionsSetRestrictionsForOrg: ( + { org }: InteractionsSetRestrictionsForOrgParams, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags checks - * @name ChecksListSuitesForRef - * @summary List check suites for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites + * @tags issues + * @name IssuesListForOrg + * @summary List organization issues assigned to the authenticated user + * @request GET:/orgs/{org}/issues */ - checksListSuitesForRef: ( - { owner, repo, ref, ...query }: ChecksListSuitesForRefParams, + issuesListForOrg: ( + { org, ...query }: IssuesListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, + this.request({ + path: \`/orgs/\${org}/issues\`, method: "GET", query: query, format: "json", @@ -57068,116 +55707,94 @@ export class Api< }), /** - * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. + * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. * - * @tags checks - * @name ChecksRerequestSuite - * @summary Rerequest a check suite - * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + * @tags migrations + * @name MigrationsDeleteArchiveForOrg + * @summary Delete an organization migration archive + * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive */ - checksRerequestSuite: ( - { owner, repo, checkSuiteId }: ChecksRerequestSuiteParams, + migrationsDeleteArchiveForOrg: ( + { org, migrationId }: MigrationsDeleteArchiveForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + method: "DELETE", ...params, }), /** - * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. + * @description Fetches the URL to a migration archive. * - * @tags checks - * @name ChecksSetSuitesPreferences - * @summary Update repository preferences for check suites - * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences + * @tags migrations + * @name MigrationsDownloadArchiveForOrg + * @summary Download an organization migration archive + * @request GET:/orgs/{org}/migrations/{migration_id}/archive */ - checksSetSuitesPreferences: ( - { owner, repo }: ChecksSetSuitesPreferencesParams, - data: ChecksSetSuitesPreferencesPayload, + migrationsDownloadArchiveForOrg: ( + { org, migrationId }: MigrationsDownloadArchiveForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + method: "GET", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. + * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. * - * @tags checks - * @name ChecksUpdate - * @summary Update a check run - * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags migrations + * @name MigrationsGetStatusForOrg + * @summary Get an organization migration status + * @request GET:/orgs/{org}/migrations/{migration_id} */ - checksUpdate: ( - { owner, repo, checkRunId }: ChecksUpdateParams, - data: ChecksUpdatePayload, + migrationsGetStatusForOrg: ( + { org, migrationId }: MigrationsGetStatusForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. + * @description Lists the most recent migrations. * - * @tags code-scanning - * @name CodeScanningGetAlert - * @summary Get a code scanning alert - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - codeScanningGetAlert: ( - { owner, repo, alertNumber }: CodeScanningGetAlertParams, + migrationsListForOrg: ( + { org, ...query }: MigrationsListForOrgParams, params: RequestParams = {}, ) => - this.request< - CodeScanningGetAlertData, - | void - | BasicError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + this.request({ + path: \`/orgs/\${org}/migrations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @description List all the repositories for this organization migration. * - * @tags code-scanning - * @name CodeScanningListAlertsForRepo - * @summary List code scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts + * @tags migrations + * @name MigrationsListReposForOrg + * @summary List repositories in an organization migration + * @request GET:/orgs/{org}/migrations/{migration_id}/repositories */ - codeScanningListAlertsForRepo: ( - { owner, repo, ...query }: CodeScanningListAlertsForRepoParams, + migrationsListReposForOrg: ( + { org, migrationId, ...query }: MigrationsListReposForOrgParams, params: RequestParams = {}, ) => - this.request< - CodeScanningListAlertsForRepoData, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, method: "GET", query: query, format: "json", @@ -57185,168 +55802,171 @@ export class Api< }), /** - * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @description Initiates the generation of a migration archive. * - * @tags code-scanning - * @name CodeScanningListRecentAnalyses - * @summary List recent code scanning analyses for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/analyses + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - codeScanningListRecentAnalyses: ( - { owner, repo, ...query }: CodeScanningListRecentAnalysesParams, + migrationsStartForOrg: ( + { org }: MigrationsStartForOrgParams, + data: MigrationsStartForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/migrations\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. * - * @tags code-scanning - * @name CodeScanningUpdateAlert - * @summary Update a code scanning alert - * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags migrations + * @name MigrationsUnlockRepoForOrg + * @summary Unlock an organization repository + * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock */ - codeScanningUpdateAlert: ( - { owner, repo, alertNumber }: CodeScanningUpdateAlertParams, - data: CodeScanningUpdateAlertPayload, + migrationsUnlockRepoForOrg: ( + { org, migrationId, repoName }: MigrationsUnlockRepoForOrgParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, + method: "DELETE", + ...params, + }), + + /** + * No description + * + * @tags orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} + */ + orgsBlockUser: ( + { org, username }: OrgsBlockUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "PUT", ...params, }), /** - * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). * - * @tags code-scanning - * @name CodeScanningUploadSarif - * @summary Upload a SARIF file - * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs + * @tags orgs + * @name OrgsCancelInvitation + * @summary Cancel an organization invitation + * @request DELETE:/orgs/{org}/invitations/{invitation_id} */ - codeScanningUploadSarif: ( - { owner, repo }: CodeScanningUploadSarifParams, - data: CodeScanningUploadSarifPayload, + orgsCancelInvitation: ( + { org, invitationId }: OrgsCancelInvitationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}\`, + method: "DELETE", ...params, }), /** - * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. + * No description * - * @tags codes-of-conduct - * @name CodesOfConductGetForRepo - * @summary Get the code of conduct for a repository - * @request GET:/repos/{owner}/{repo}/community/code_of_conduct + * @tags orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - codesOfConductGetForRepo: ( - { owner, repo }: CodesOfConductGetForRepoParams, + orgsCheckBlockedUser: ( + { org, username }: OrgsCheckBlockedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, method: "GET", - format: "json", ...params, }), /** - * No description + * @description Check if a user is, publicly or privately, a member of the organization. * - * @tags git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @tags orgs + * @name OrgsCheckMembershipForUser + * @summary Check organization membership for a user + * @request GET:/orgs/{org}/members/{username} */ - gitCreateBlob: ( - { owner, repo }: GitCreateBlobParams, - data: GitCreateBlobPayload, + orgsCheckMembershipForUser: ( + { org, username }: OrgsCheckMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "GET", ...params, }), /** - * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * No description * - * @tags git - * @name GitCreateCommit - * @summary Create a commit - * @request POST:/repos/{owner}/{repo}/git/commits + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - gitCreateCommit: ( - { owner, repo }: GitCreateCommitParams, - data: GitCreateCommitPayload, + orgsCheckPublicMembershipForUser: ( + { org, username }: OrgsCheckPublicMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "GET", ...params, }), /** - * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. + * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". * - * @tags git - * @name GitCreateRef - * @summary Create a reference - * @request POST:/repos/{owner}/{repo}/git/refs + * @tags orgs + * @name OrgsConvertMemberToOutsideCollaborator + * @summary Convert an organization member to outside collaborator + * @request PUT:/orgs/{org}/outside_collaborators/{username} */ - gitCreateRef: ( - { owner, repo }: GitCreateRefParams, - data: GitCreateRefPayload, + orgsConvertMemberToOutsideCollaborator: ( + { org, username }: OrgsConvertMemberToOutsideCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request< + OrgsConvertMemberToOutsideCollaboratorData, + OrgsConvertMemberToOutsideCollaboratorError + >({ + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + method: "PUT", ...params, }), /** - * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags git - * @name GitCreateTag - * @summary Create a tag object - * @request POST:/repos/{owner}/{repo}/git/tags + * @tags orgs + * @name OrgsCreateInvitation + * @summary Create an organization invitation + * @request POST:/orgs/{org}/invitations */ - gitCreateTag: ( - { owner, repo }: GitCreateTagParams, - data: GitCreateTagPayload, + orgsCreateInvitation: ( + { org }: OrgsCreateInvitationParams, + data: OrgsCreateInvitationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags\`, + this.request({ + path: \`/orgs/\${org}/invitations\`, method: "POST", body: data, type: ContentType.Json, @@ -57355,20 +55975,20 @@ export class Api< }), /** - * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." + * @description Here's how you can create a hook that posts payloads in JSON format: * - * @tags git - * @name GitCreateTree - * @summary Create a tree - * @request POST:/repos/{owner}/{repo}/git/trees + * @tags orgs + * @name OrgsCreateWebhook + * @summary Create an organization webhook + * @request POST:/orgs/{org}/hooks */ - gitCreateTree: ( - { owner, repo }: GitCreateTreeParams, - data: GitCreateTreePayload, + orgsCreateWebhook: ( + { org }: OrgsCreateWebhookParams, + data: OrgsCreateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees\`, + this.request({ + path: \`/orgs/\${org}/hooks\`, method: "POST", body: data, type: ContentType.Json, @@ -57379,131 +55999,128 @@ export class Api< /** * No description * - * @tags git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + * @tags orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - gitDeleteRef: ( - { owner, repo, ref }: GitDeleteRefParams, + orgsDeleteWebhook: ( + { org, hookId }: OrgsDeleteWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "DELETE", ...params, }), /** - * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. + * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." * - * @tags git - * @name GitGetBlob - * @summary Get a blob - * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} + * @tags orgs + * @name OrgsGet + * @summary Get an organization + * @request GET:/orgs/{org} */ - gitGetBlob: ( - { owner, repo, fileSha }: GitGetBlobParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, + orgsGet: ({ org }: OrgsGetParams, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}\`, method: "GET", format: "json", ...params, }), /** - * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. * - * @tags git - * @name GitGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} + * @tags orgs + * @name OrgsGetAuditLog + * @summary Get the audit log for an organization + * @request GET:/orgs/{org}/audit-log */ - gitGetCommit: ( - { owner, repo, commitSha }: GitGetCommitParams, + orgsGetAuditLog: ( + { org, ...query }: OrgsGetAuditLogParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, + this.request({ + path: \`/orgs/\${org}/audit-log\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. * - * @tags git - * @name GitGetRef - * @summary Get a reference - * @request GET:/repos/{owner}/{repo}/git/ref/{ref} + * @tags orgs + * @name OrgsGetMembershipForUser + * @summary Get organization membership for a user + * @request GET:/orgs/{org}/memberships/{username} */ - gitGetRef: ( - { owner, repo, ref }: GitGetRefParams, + orgsGetMembershipForUser: ( + { org, username }: OrgsGetMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, method: "GET", format: "json", ...params, }), /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." * - * @tags git - * @name GitGetTag - * @summary Get a tag - * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} + * @tags orgs + * @name OrgsGetWebhook + * @summary Get an organization webhook + * @request GET:/orgs/{org}/hooks/{hook_id} */ - gitGetTag: ( - { owner, repo, tagSha }: GitGetTagParams, + orgsGetWebhook: ( + { org, hookId }: OrgsGetWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "GET", format: "json", ...params, }), /** - * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. + * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. * - * @tags git - * @name GitGetTree - * @summary Get a tree - * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} + * @tags orgs + * @name OrgsGetWebhookConfigForOrg + * @summary Get a webhook configuration for an organization + * @request GET:/orgs/{org}/hooks/{hook_id}/config */ - gitGetTree: ( - { owner, repo, treeSha, ...query }: GitGetTreeParams, + orgsGetWebhookConfigForOrg: ( + { org, hookId }: OrgsGetWebhookConfigForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. + * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. * - * @tags git - * @name GitListMatchingRefs - * @summary List matching references - * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + * @tags orgs + * @name OrgsListAppInstallations + * @summary List app installations for an organization + * @request GET:/orgs/{org}/installations */ - gitListMatchingRefs: ( - { owner, repo, ref, ...query }: GitListMatchingRefsParams, + orgsListAppInstallations: ( + { org, ...query }: OrgsListAppInstallationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, + this.request({ + path: \`/orgs/\${org}/installations\`, method: "GET", query: query, format: "json", @@ -57511,280 +56128,260 @@ export class Api< }), /** - * No description + * @description List the users blocked by an organization. * - * @tags git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @tags orgs + * @name OrgsListBlockedUsers + * @summary List users blocked by an organization + * @request GET:/orgs/{org}/blocks */ - gitUpdateRef: ( - { owner, repo, ref }: GitUpdateRefParams, - data: GitUpdateRefPayload, + orgsListBlockedUsers: ( + { org }: OrgsListBlockedUsersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + OrgsListBlockedUsersData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/orgs/\${org}/blocks\`, + method: "GET", format: "json", ...params, }), /** - * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. + * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. * - * @tags interactions - * @name InteractionsGetRestrictionsForRepo - * @summary Get interaction restrictions for a repository - * @request GET:/repos/{owner}/{repo}/interaction-limits + * @tags orgs + * @name OrgsListFailedInvitations + * @summary List failed organization invitations + * @request GET:/orgs/{org}/failed_invitations */ - interactionsGetRestrictionsForRepo: ( - { owner, repo }: InteractionsGetRestrictionsForRepoParams, + orgsListFailedInvitations: ( + { org, ...query }: OrgsListFailedInvitationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/orgs/\${org}/failed_invitations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. * - * @tags interactions - * @name InteractionsRemoveRestrictionsForRepo - * @summary Remove interaction restrictions for a repository - * @request DELETE:/repos/{owner}/{repo}/interaction-limits + * @tags orgs + * @name OrgsListInvitationTeams + * @summary List organization invitation teams + * @request GET:/orgs/{org}/invitations/{invitation_id}/teams */ - interactionsRemoveRestrictionsForRepo: ( - { owner, repo }: InteractionsRemoveRestrictionsForRepoParams, + orgsListInvitationTeams: ( + { org, invitationId, ...query }: OrgsListInvitationTeamsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. * - * @tags interactions - * @name InteractionsSetRestrictionsForRepo - * @summary Set interaction restrictions for a repository - * @request PUT:/repos/{owner}/{repo}/interaction-limits + * @tags orgs + * @name OrgsListMembers + * @summary List organization members + * @request GET:/orgs/{org}/members */ - interactionsSetRestrictionsForRepo: ( - { owner, repo }: InteractionsSetRestrictionsForRepoParams, - data: InteractionLimit, + orgsListMembers: ( + { org, ...query }: OrgsListMembersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/members\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + * @description List all users who are outside collaborators of an organization. * - * @tags issues - * @name IssuesAddAssignees - * @summary Add assignees to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags orgs + * @name OrgsListOutsideCollaborators + * @summary List outside collaborators for an organization + * @request GET:/orgs/{org}/outside_collaborators */ - issuesAddAssignees: ( - { owner, repo, issueNumber }: IssuesAddAssigneesParams, - data: IssuesAddAssigneesPayload, + orgsListOutsideCollaborators: ( + { org, ...query }: OrgsListOutsideCollaboratorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/outside_collaborators\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. * - * @tags issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags orgs + * @name OrgsListPendingInvitations + * @summary List pending organization invitations + * @request GET:/orgs/{org}/invitations */ - issuesAddLabels: ( - { owner, repo, issueNumber }: IssuesAddLabelsParams, - data: IssuesAddLabelsPayload, + orgsListPendingInvitations: ( + { org, ...query }: OrgsListPendingInvitationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/invitations\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. + * @description Members of an organization can choose to have their membership publicized or not. * - * @tags issues - * @name IssuesCheckUserCanBeAssigned - * @summary Check if a user can be assigned - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @tags orgs + * @name OrgsListPublicMembers + * @summary List public organization members + * @request GET:/orgs/{org}/public_members */ - issuesCheckUserCanBeAssigned: ( - { owner, repo, assignee }: IssuesCheckUserCanBeAssignedParams, + orgsListPublicMembers: ( + { org, ...query }: OrgsListPublicMembersParams, params: RequestParams = {}, ) => - this.request< - IssuesCheckUserCanBeAssignedData, - IssuesCheckUserCanBeAssignedError - >({ - path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + this.request({ + path: \`/orgs/\${org}/public_members\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). * - * @tags issues - * @name IssuesCreate - * @summary Create an issue - * @request POST:/repos/{owner}/{repo}/issues + * @tags orgs + * @name OrgsListSamlSsoAuthorizations + * @summary List SAML SSO authorizations for an organization + * @request GET:/orgs/{org}/credential-authorizations */ - issuesCreate: ( - { owner, repo }: IssuesCreateParams, - data: IssuesCreatePayload, + orgsListSamlSsoAuthorizations: ( + { org }: OrgsListSamlSsoAuthorizationsParams, params: RequestParams = {}, ) => - this.request< - IssuesCreateData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/credential-authorizations\`, + method: "GET", format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * No description * - * @tags issues - * @name IssuesCreateComment - * @summary Create an issue comment - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - issuesCreateComment: ( - { owner, repo, issueNumber }: IssuesCreateCommentParams, - data: IssuesCreateCommentPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + orgsListWebhooks: ( + { org, ...query }: OrgsListWebhooksParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/hooks\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @tags orgs + * @name OrgsPingWebhook + * @summary Ping an organization webhook + * @request POST:/orgs/{org}/hooks/{hook_id}/pings */ - issuesCreateLabel: ( - { owner, repo }: IssuesCreateLabelParams, - data: IssuesCreateLabelPayload, + orgsPingWebhook: ( + { org, hookId }: OrgsPingWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, method: "POST", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description 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. * - * @tags issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @tags orgs + * @name OrgsRemoveMember + * @summary Remove an organization member + * @request DELETE:/orgs/{org}/members/{username} */ - issuesCreateMilestone: ( - { owner, repo }: IssuesCreateMilestoneParams, - data: IssuesCreateMilestonePayload, + orgsRemoveMember: ( + { org, username }: OrgsRemoveMemberParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. * - * @tags issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags orgs + * @name OrgsRemoveMembershipForUser + * @summary Remove organization membership for a user + * @request DELETE:/orgs/{org}/memberships/{username} */ - issuesDeleteComment: ( - { owner, repo, commentId }: IssuesDeleteCommentParams, + orgsRemoveMembershipForUser: ( + { org, username }: OrgsRemoveMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, method: "DELETE", ...params, }), /** - * No description + * @description Removing a user from this list will remove them from all the organization's repositories. * - * @tags issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @tags orgs + * @name OrgsRemoveOutsideCollaborator + * @summary Remove outside collaborator from an organization + * @request DELETE:/orgs/{org}/outside_collaborators/{username} */ - issuesDeleteLabel: ( - { owner, repo, name }: IssuesDeleteLabelParams, + orgsRemoveOutsideCollaborator: ( + { org, username }: OrgsRemoveOutsideCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + this.request< + OrgsRemoveOutsideCollaboratorData, + OrgsRemoveOutsideCollaboratorError + >({ + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, method: "DELETE", ...params, }), @@ -57792,212 +56389,204 @@ export class Api< /** * No description * - * @tags issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} */ - issuesDeleteMilestone: ( - { owner, repo, milestoneNumber }: IssuesDeleteMilestoneParams, + orgsRemovePublicMembershipForAuthenticatedUser: ( + { org, username }: OrgsRemovePublicMembershipForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", ...params, }), /** - * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. * - * @tags issues - * @name IssuesGet - * @summary Get an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + * @tags orgs + * @name OrgsRemoveSamlSsoAuthorization + * @summary Remove a SAML SSO authorization for an organization + * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} */ - issuesGet: ( - { owner, repo, issueNumber }: IssuesGetParams, + orgsRemoveSamlSsoAuthorization: ( + { org, credentialId }: OrgsRemoveSamlSsoAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. * - * @tags issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags orgs + * @name OrgsSetMembershipForUser + * @summary Set organization membership for a user + * @request PUT:/orgs/{org}/memberships/{username} */ - issuesGetComment: ( - { owner, repo, commentId }: IssuesGetCommentParams, + orgsSetMembershipForUser: ( + { org, username }: OrgsSetMembershipForUserParams, + data: OrgsSetMembershipForUserPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + * @tags orgs + * @name OrgsSetPublicMembershipForAuthenticatedUser + * @summary Set public organization membership for the authenticated user + * @request PUT:/orgs/{org}/public_members/{username} */ - issuesGetEvent: ( - { owner, repo, eventId }: IssuesGetEventParams, + orgsSetPublicMembershipForAuthenticatedUser: ( + { org, username }: OrgsSetPublicMembershipForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, - method: "GET", - format: "json", - ...params, - }), + this.request( + { + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "PUT", + ...params, + }, + ), /** * No description * - * @tags issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @tags orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - issuesGetLabel: ( - { owner, repo, name }: IssuesGetLabelParams, + orgsUnblockUser: ( + { org, username }: OrgsUnblockUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. * - * @tags issues - * @name IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags orgs + * @name OrgsUpdate + * @summary Update an organization + * @request PATCH:/orgs/{org} */ - issuesGetMilestone: ( - { owner, repo, milestoneNumber }: IssuesGetMilestoneParams, + orgsUpdate: ( + { org }: OrgsUpdateParams, + data: OrgsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. + * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." * - * @tags issues - * @name IssuesListAssignees - * @summary List assignees - * @request GET:/repos/{owner}/{repo}/assignees + * @tags orgs + * @name OrgsUpdateWebhook + * @summary Update an organization webhook + * @request PATCH:/orgs/{org}/hooks/{hook_id} */ - issuesListAssignees: ( - { owner, repo, ...query }: IssuesListAssigneesParams, + orgsUpdateWebhook: ( + { org, hookId }: OrgsUpdateWebhookParams, + data: OrgsUpdateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Issue Comments are ordered by ascending ID. + * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. * - * @tags issues - * @name IssuesListComments - * @summary List issue comments - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags orgs + * @name OrgsUpdateWebhookConfigForOrg + * @summary Update a webhook configuration for an organization + * @request PATCH:/orgs/{org}/hooks/{hook_id}/config */ - issuesListComments: ( - { owner, repo, issueNumber, ...query }: IssuesListCommentsParams, + orgsUpdateWebhookConfigForOrg: ( + { org, hookId }: OrgsUpdateWebhookConfigForOrgParams, + data: OrgsUpdateWebhookConfigForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description By default, Issue Comments are ordered by ascending ID. - * - * @tags issues - * @name IssuesListCommentsForRepo - * @summary List issue comments for a repository - * @request GET:/repos/{owner}/{repo}/issues/comments - */ - issuesListCommentsForRepo: ( - { owner, repo, ...query }: IssuesListCommentsForRepoParams, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/repos/\${owner}/\${repo}/issues/comments\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), - - /** - * No description + * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @tags projects + * @name ProjectsCreateForOrg + * @summary Create an organization project + * @request POST:/orgs/{org}/projects */ - issuesListEvents: ( - { owner, repo, issueNumber, ...query }: IssuesListEventsParams, + projectsCreateForOrg: ( + { org }: ProjectsCreateForOrgParams, + data: ProjectsCreateForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, - method: "GET", - query: query, + this.request< + ProjectsCreateForOrgData, + BasicError | ValidationErrorSimple + >({ + path: \`/orgs/\${org}/projects\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @tags projects + * @name ProjectsListForOrg + * @summary List organization projects + * @request GET:/orgs/{org}/projects */ - issuesListEventsForRepo: ( - { owner, repo, ...query }: IssuesListEventsForRepoParams, + projectsListForOrg: ( + { org, ...query }: ProjectsListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events\`, + this.request({ + path: \`/orgs/\${org}/projects\`, method: "GET", query: query, format: "json", @@ -58005,111 +56594,125 @@ export class Api< }), /** - * No description + * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * - * @tags issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @tags reactions + * @name ReactionsCreateForTeamDiscussionCommentInOrg + * @summary Create reaction for a team discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - issuesListEventsForTimeline: ( - { owner, repo, issueNumber, ...query }: IssuesListEventsForTimelineParams, + reactionsCreateForTeamDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: ReactionsCreateForTeamDiscussionCommentInOrgParams, + data: ReactionsCreateForTeamDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request< - IssuesListEventsForTimelineData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * - * @tags issues - * @name IssuesListForRepo - * @summary List repository issues - * @request GET:/repos/{owner}/{repo}/issues + * @tags reactions + * @name ReactionsCreateForTeamDiscussionInOrg + * @summary Create reaction for a team discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - issuesListForRepo: ( - { owner, repo, ...query }: IssuesListForRepoParams, + reactionsCreateForTeamDiscussionInOrg: ( + { + org, + teamSlug, + discussionNumber, + }: ReactionsCreateForTeamDiscussionInOrgParams, + data: ReactionsCreateForTeamDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @tags reactions + * @name ReactionsDeleteForTeamDiscussion + * @summary Delete team discussion reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} */ - issuesListLabelsForMilestone: ( + reactionsDeleteForTeamDiscussion: ( { - owner, - repo, - milestoneNumber, - ...query - }: IssuesListLabelsForMilestoneParams, + org, + teamSlug, + discussionNumber, + reactionId, + }: ReactionsDeleteForTeamDiscussionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags issues - * @name IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @tags reactions + * @name ReactionsDeleteForTeamDiscussionComment + * @summary Delete team discussion comment reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} */ - issuesListLabelsForRepo: ( - { owner, repo, ...query }: IssuesListLabelsForRepoParams, + reactionsDeleteForTeamDiscussionComment: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + reactionId, + }: ReactionsDeleteForTeamDiscussionCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * - * @tags issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags reactions + * @name ReactionsListForTeamDiscussionCommentInOrg + * @summary List reactions for a team discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - issuesListLabelsOnIssue: ( - { owner, repo, issueNumber, ...query }: IssuesListLabelsOnIssueParams, + reactionsListForTeamDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + ...query + }: ReactionsListForTeamDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -58117,19 +56720,24 @@ export class Api< }), /** - * No description + * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * - * @tags issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @tags reactions + * @name ReactionsListForTeamDiscussionInOrg + * @summary List reactions for a team discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - issuesListMilestones: ( - { owner, repo, ...query }: IssuesListMilestonesParams, + reactionsListForTeamDiscussionInOrg: ( + { + org, + teamSlug, + discussionNumber, + ...query + }: ReactionsListForTeamDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -58137,60 +56745,66 @@ export class Api< }), /** - * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * - * @tags issues - * @name IssuesLock - * @summary Lock an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * + * @tags repos + * @name ReposCreateInOrg + * @summary Create an organization repository + * @request POST:/orgs/{org}/repos */ - issuesLock: ( - { owner, repo, issueNumber }: IssuesLockParams, - data: IssuesLockPayload, + reposCreateInOrg: ( + { org }: ReposCreateInOrgParams, + data: ReposCreateInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/repos\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @description Lists repositories for the specified organization. * - * @tags issues - * @name IssuesRemoveAllLabels - * @summary Remove all labels from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags repos + * @name ReposListForOrg + * @summary List organization repositories + * @request GET:/orgs/{org}/repos */ - issuesRemoveAllLabels: ( - { owner, repo, issueNumber }: IssuesRemoveAllLabelsParams, + reposListForOrg: ( + { org, ...query }: ReposListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/repos\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Removes one or more assignees from an issue. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. * - * @tags issues - * @name IssuesRemoveAssignees - * @summary Remove assignees from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserInOrg + * @summary Add or update team membership for a user + * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - issuesRemoveAssignees: ( - { owner, repo, issueNumber }: IssuesRemoveAssigneesParams, - data: IssuesRemoveAssigneesPayload, + teamsAddOrUpdateMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsAddOrUpdateMembershipForUserInOrgParams, + data: TeamsAddOrUpdateMembershipForUserInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, - method: "DELETE", + this.request< + TeamsAddOrUpdateMembershipForUserInOrgData, + TeamsAddOrUpdateMembershipForUserInOrgError + >({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -58198,111 +56812,113 @@ export class Api< }), /** - * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. + * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. * - * @tags issues - * @name IssuesRemoveLabel - * @summary Remove a label from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsInOrg + * @summary Add or update team project permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - issuesRemoveLabel: ( - { owner, repo, issueNumber, name }: IssuesRemoveLabelParams, + teamsAddOrUpdateProjectPermissionsInOrg: ( + { + org, + teamSlug, + projectId, + }: TeamsAddOrUpdateProjectPermissionsInOrgParams, + data: TeamsAddOrUpdateProjectPermissionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, - method: "DELETE", - format: "json", + this.request< + TeamsAddOrUpdateProjectPermissionsInOrgData, + TeamsAddOrUpdateProjectPermissionsInOrgError + >({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Removes any previous labels and sets the new labels for an issue. + * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". * - * @tags issues - * @name IssuesSetLabels - * @summary Set labels for an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsInOrg + * @summary Add or update team repository permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - issuesSetLabels: ( - { owner, repo, issueNumber }: IssuesSetLabelsParams, - data: IssuesSetLabelsPayload, + teamsAddOrUpdateRepoPermissionsInOrg: ( + { + org, + teamSlug, + owner, + repo, + }: TeamsAddOrUpdateRepoPermissionsInOrgParams, + data: TeamsAddOrUpdateRepoPermissionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Users with push access can unlock an issue's conversation. + * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. * - * @tags issues - * @name IssuesUnlock - * @summary Unlock an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags teams + * @name TeamsCheckPermissionsForProjectInOrg + * @summary Check team permissions for a project + * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - issuesUnlock: ( - { owner, repo, issueNumber }: IssuesUnlockParams, + teamsCheckPermissionsForProjectInOrg: ( + { org, teamSlug, projectId }: TeamsCheckPermissionsForProjectInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Issue owners and users with push access can edit an issue. + * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. * - * @tags issues - * @name IssuesUpdate - * @summary Update an issue - * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} + * @tags teams + * @name TeamsCheckPermissionsForRepoInOrg + * @summary Check team permissions for a repository + * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - issuesUpdate: ( - { owner, repo, issueNumber }: IssuesUpdateParams, - data: IssuesUpdatePayload, + teamsCheckPermissionsForRepoInOrg: ( + { org, teamSlug, owner, repo }: TeamsCheckPermissionsForRepoInOrgParams, params: RequestParams = {}, ) => - this.request< - IssuesUpdateData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". * - * @tags issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags teams + * @name TeamsCreate + * @summary Create a team + * @request POST:/orgs/{org}/teams */ - issuesUpdateComment: ( - { owner, repo, commentId }: IssuesUpdateCommentParams, - data: IssuesUpdateCommentPayload, + teamsCreate: ( + { org }: TeamsCreateParams, + data: TeamsCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/teams\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58310,21 +56926,25 @@ export class Api< }), /** - * No description + * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. * - * @tags issues - * @name IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} + * @tags teams + * @name TeamsCreateDiscussionCommentInOrg + * @summary Create a discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - issuesUpdateLabel: ( - { owner, repo, name }: IssuesUpdateLabelParams, - data: IssuesUpdateLabelPayload, + teamsCreateDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + }: TeamsCreateDiscussionCommentInOrgParams, + data: TeamsCreateDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58332,21 +56952,21 @@ export class Api< }), /** - * No description + * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. * - * @tags issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags teams + * @name TeamsCreateDiscussionInOrg + * @summary Create a discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions */ - issuesUpdateMilestone: ( - { owner, repo, milestoneNumber }: IssuesUpdateMilestoneParams, - data: IssuesUpdateMilestonePayload, + teamsCreateDiscussionInOrg: ( + { org, teamSlug }: TeamsCreateDiscussionInOrgParams, + data: TeamsCreateDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58354,694 +56974,642 @@ export class Api< }), /** - * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. * - * @tags licenses - * @name LicensesGetForRepo - * @summary Get the license for a repository - * @request GET:/repos/{owner}/{repo}/license + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg + * @summary Create or update IdP group connections + * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - licensesGetForRepo: ( - { owner, repo }: LicensesGetForRepoParams, + teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + { org, teamSlug }: TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams, + data: TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/license\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Stop an import for a repository. + * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @tags teams + * @name TeamsDeleteDiscussionCommentInOrg + * @summary Delete a discussion comment + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - migrationsCancelImport: ( - { owner, repo }: MigrationsCancelImportParams, + teamsDeleteDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsDeleteDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, method: "DELETE", ...params, }), /** - * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags migrations - * @name MigrationsGetCommitAuthors - * @summary Get commit authors - * @request GET:/repos/{owner}/{repo}/import/authors + * @tags teams + * @name TeamsDeleteDiscussionInOrg + * @summary Delete a discussion + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - migrationsGetCommitAuthors: ( - { owner, repo, ...query }: MigrationsGetCommitAuthorsParams, + teamsDeleteDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsDeleteDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "DELETE", ...params, }), /** - * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. + * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. * - * @tags migrations - * @name MigrationsGetImportStatus - * @summary Get an import status - * @request GET:/repos/{owner}/{repo}/import + * @tags teams + * @name TeamsDeleteInOrg + * @summary Delete a team + * @request DELETE:/orgs/{org}/teams/{team_slug} */ - migrationsGetImportStatus: ( - { owner, repo }: MigrationsGetImportStatusParams, + teamsDeleteInOrg: ( + { org, teamSlug }: TeamsDeleteInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "DELETE", ...params, }), /** - * @description List files larger than 100MB found during the import + * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. * - * @tags migrations - * @name MigrationsGetLargeFiles - * @summary Get large files - * @request GET:/repos/{owner}/{repo}/import/large_files + * @tags teams + * @name TeamsGetByName + * @summary Get a team by name + * @request GET:/orgs/{org}/teams/{team_slug} */ - migrationsGetLargeFiles: ( - { owner, repo }: MigrationsGetLargeFilesParams, + teamsGetByName: ( + { org, teamSlug }: TeamsGetByNameParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/large_files\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "GET", format: "json", ...params, }), /** - * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. - * - * @tags migrations - * @name MigrationsMapCommitAuthor - * @summary Map a commit author - * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} - */ - migrationsMapCommitAuthor: ( - { owner, repo, authorId }: MigrationsMapCommitAuthorParams, - data: MigrationsMapCommitAuthorPayload, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }, - ), - - /** - * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). + * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags migrations - * @name MigrationsSetLfsPreference - * @summary Update Git LFS preference - * @request PATCH:/repos/{owner}/{repo}/import/lfs + * @tags teams + * @name TeamsGetDiscussionCommentInOrg + * @summary Get a discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - migrationsSetLfsPreference: ( - { owner, repo }: MigrationsSetLfsPreferenceParams, - data: MigrationsSetLfsPreferencePayload, + teamsGetDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsGetDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/lfs\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "GET", format: "json", ...params, }), /** - * @description Start a source import to a GitHub repository using GitHub Importer. + * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags migrations - * @name MigrationsStartImport - * @summary Start an import - * @request PUT:/repos/{owner}/{repo}/import + * @tags teams + * @name TeamsGetDiscussionInOrg + * @summary Get a discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - migrationsStartImport: ( - { owner, repo }: MigrationsStartImportParams, - data: MigrationsStartImportPayload, + teamsGetDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsGetDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "GET", format: "json", ...params, }), /** - * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. + * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). * - * @tags migrations - * @name MigrationsUpdateImport - * @summary Update an import - * @request PATCH:/repos/{owner}/{repo}/import + * @tags teams + * @name TeamsGetMembershipForUserInOrg + * @summary Get team membership for a user + * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - migrationsUpdateImport: ( - { owner, repo }: MigrationsUpdateImportParams, - data: MigrationsUpdateImportPayload, + teamsGetMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsGetMembershipForUserInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "GET", format: "json", ...params, }), /** - * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description Lists all teams in an organization that are visible to the authenticated user. * - * @tags projects - * @name ProjectsCreateForRepo - * @summary Create a repository project - * @request POST:/repos/{owner}/{repo}/projects + * @tags teams + * @name TeamsList + * @summary List teams + * @request GET:/orgs/{org}/teams */ - projectsCreateForRepo: ( - { owner, repo }: ProjectsCreateForRepoParams, - data: ProjectsCreateForRepoPayload, + teamsList: ( + { org, ...query }: TeamsListParams, params: RequestParams = {}, ) => - this.request< - ProjectsCreateForRepoData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/projects\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * - * @tags projects - * @name ProjectsListForRepo - * @summary List repository projects - * @request GET:/repos/{owner}/{repo}/projects - */ - projectsListForRepo: ( - { owner, repo, ...query }: ProjectsListForRepoParams, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/repos/\${owner}/\${repo}/projects\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), - - /** - * No description + * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. * - * @tags pulls - * @name PullsCheckIfMerged - * @summary Check if a pull request has been merged - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags teams + * @name TeamsListChildInOrg + * @summary List child teams + * @request GET:/orgs/{org}/teams/{team_slug}/teams */ - pullsCheckIfMerged: ( - { owner, repo, pullNumber }: PullsCheckIfMergedParams, + teamsListChildInOrg: ( + { org, teamSlug, ...query }: TeamsListChildInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. * - * @tags pulls - * @name PullsCreate - * @summary Create a pull request - * @request POST:/repos/{owner}/{repo}/pulls + * @tags teams + * @name TeamsListDiscussionCommentsInOrg + * @summary List discussion comments + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - pullsCreate: ( - { owner, repo }: PullsCreateParams, - data: PullsCreatePayload, + teamsListDiscussionCommentsInOrg: ( + { + org, + teamSlug, + discussionNumber, + ...query + }: TeamsListDiscussionCommentsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. * - * @tags pulls - * @name PullsCreateReplyForReviewComment - * @summary Create a reply for a review comment - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + * @tags teams + * @name TeamsListDiscussionsInOrg + * @summary List discussions + * @request GET:/orgs/{org}/teams/{team_slug}/discussions */ - pullsCreateReplyForReviewComment: ( - { - owner, - repo, - pullNumber, - commentId, - }: PullsCreateReplyForReviewCommentParams, - data: PullsCreateReplyForReviewCommentPayload, + teamsListDiscussionsInOrg: ( + { org, teamSlug, ...query }: TeamsListDiscussionsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: * - * @tags pulls - * @name PullsCreateReview - * @summary Create a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @tags teams + * @name TeamsListIdpGroupsForOrg + * @summary List IdP groups for an organization + * @request GET:/orgs/{org}/team-sync/groups */ - pullsCreateReview: ( - { owner, repo, pullNumber }: PullsCreateReviewParams, - data: PullsCreateReviewPayload, + teamsListIdpGroupsForOrg: ( + { org, ...query }: TeamsListIdpGroupsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/team-sync/groups\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. * - * @tags pulls - * @name PullsCreateReviewComment - * @summary Create a review comment for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags teams + * @name TeamsListIdpGroupsInOrg + * @summary List IdP groups for a team + * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - pullsCreateReviewComment: ( - { owner, repo, pullNumber }: PullsCreateReviewCommentParams, - data: PullsCreateReviewCommentPayload, + teamsListIdpGroupsInOrg: ( + { org, teamSlug }: TeamsListIdpGroupsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. * - * @tags pulls - * @name PullsDeletePendingReview - * @summary Delete a pending review for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags teams + * @name TeamsListMembersInOrg + * @summary List team members + * @request GET:/orgs/{org}/teams/{team_slug}/members */ - pullsDeletePendingReview: ( - { owner, repo, pullNumber, reviewId }: PullsDeletePendingReviewParams, + teamsListMembersInOrg: ( + { org, teamSlug, ...query }: TeamsListMembersInOrgParams, params: RequestParams = {}, ) => - this.request< - PullsDeletePendingReviewData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Deletes a review comment. + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. * - * @tags pulls - * @name PullsDeleteReviewComment - * @summary Delete a review comment for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags teams + * @name TeamsListPendingInvitationsInOrg + * @summary List pending team invitations + * @request GET:/orgs/{org}/teams/{team_slug}/invitations */ - pullsDeleteReviewComment: ( - { owner, repo, commentId }: PullsDeleteReviewCommentParams, + teamsListPendingInvitationsInOrg: ( + { org, teamSlug, ...query }: TeamsListPendingInvitationsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. + * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. * - * @tags pulls - * @name PullsDismissReview - * @summary Dismiss a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals + * @tags teams + * @name TeamsListProjectsInOrg + * @summary List team projects + * @request GET:/orgs/{org}/teams/{team_slug}/projects */ - pullsDismissReview: ( - { owner, repo, pullNumber, reviewId }: PullsDismissReviewParams, - data: PullsDismissReviewPayload, + teamsListProjectsInOrg: ( + { org, teamSlug, ...query }: TeamsListProjectsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. * - * @tags pulls - * @name PullsGet - * @summary Get a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags teams + * @name TeamsListReposInOrg + * @summary List team repositories + * @request GET:/orgs/{org}/teams/{team_slug}/repos */ - pullsGet: ( - { owner, repo, pullNumber }: PullsGetParams, + teamsListReposInOrg: ( + { org, teamSlug, ...query }: TeamsListReposInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. * - * @tags pulls - * @name PullsGetReview - * @summary Get a review for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags teams + * @name TeamsRemoveMembershipForUserInOrg + * @summary Remove team membership for a user + * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - pullsGetReview: ( - { owner, repo, pullNumber, reviewId }: PullsGetReviewParams, + teamsRemoveMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsRemoveMembershipForUserInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "DELETE", ...params, }), /** - * @description Provides details for a review comment. + * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. * - * @tags pulls - * @name PullsGetReviewComment - * @summary Get a review comment for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags teams + * @name TeamsRemoveProjectInOrg + * @summary Remove a project from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - pullsGetReviewComment: ( - { owner, repo, commentId }: PullsGetReviewCommentParams, + teamsRemoveProjectInOrg: ( + { org, teamSlug, projectId }: TeamsRemoveProjectInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "DELETE", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. * - * @tags pulls - * @name PullsList - * @summary List pull requests - * @request GET:/repos/{owner}/{repo}/pulls + * @tags teams + * @name TeamsRemoveRepoInOrg + * @summary Remove a repository from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - pullsList: ( - { owner, repo, ...query }: PullsListParams, + teamsRemoveRepoInOrg: ( + { org, teamSlug, owner, repo }: TeamsRemoveRepoInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "DELETE", ...params, }), /** - * @description List comments for a specific pull request review. + * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags pulls - * @name PullsListCommentsForReview - * @summary List comments for a pull request review - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + * @tags teams + * @name TeamsUpdateDiscussionCommentInOrg + * @summary Update a discussion comment + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - pullsListCommentsForReview: ( + teamsUpdateDiscussionCommentInOrg: ( { - owner, - repo, - pullNumber, - reviewId, - ...query - }: PullsListCommentsForReviewParams, + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsUpdateDiscussionCommentInOrgParams, + data: TeamsUpdateDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. + * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags pulls - * @name PullsListCommits - * @summary List commits on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits + * @tags teams + * @name TeamsUpdateDiscussionInOrg + * @summary Update a discussion + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - pullsListCommits: ( - { owner, repo, pullNumber, ...query }: PullsListCommitsParams, + teamsUpdateDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsUpdateDiscussionInOrgParams, + data: TeamsUpdateDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. + * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. * - * @tags pulls - * @name PullsListFiles - * @summary List pull requests files - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files + * @tags teams + * @name TeamsUpdateInOrg + * @summary Update a team + * @request PATCH:/orgs/{org}/teams/{team_slug} */ - pullsListFiles: ( - { owner, repo, pullNumber, ...query }: PullsListFilesParams, + teamsUpdateInOrg: ( + { org, teamSlug }: TeamsUpdateInOrgParams, + data: TeamsUpdateInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + projects = { /** - * No description + * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. * - * @tags pulls - * @name PullsListRequestedReviewers - * @summary List requested reviewers for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags projects + * @name ProjectsAddCollaborator + * @summary Add project collaborator + * @request PUT:/projects/{project_id}/collaborators/{username} */ - pullsListRequestedReviewers: ( - { owner, repo, pullNumber, ...query }: PullsListRequestedReviewersParams, + projectsAddCollaborator: ( + { projectId, username }: ProjectsAddCollaboratorParams, + data: ProjectsAddCollaboratorPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "GET", - query: query, - format: "json", + this.request< + ProjectsAddCollaboratorData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. + * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags pulls - * @name PullsListReviewComments - * @summary List review comments on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags projects + * @name ProjectsCreateCard + * @summary Create a project card + * @request POST:/projects/columns/{column_id}/cards */ - pullsListReviewComments: ( - { owner, repo, pullNumber, ...query }: PullsListReviewCommentsParams, + projectsCreateCard: ( + { columnId }: ProjectsCreateCardParams, + data: ProjectsCreateCardPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. + * No description * - * @tags pulls - * @name PullsListReviewCommentsForRepo - * @summary List review comments in a repository - * @request GET:/repos/{owner}/{repo}/pulls/comments + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - pullsListReviewCommentsForRepo: ( - { owner, repo, ...query }: PullsListReviewCommentsForRepoParams, + projectsCreateColumn: ( + { projectId }: ProjectsCreateColumnParams, + data: ProjectsCreateColumnPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments\`, - method: "GET", - query: query, + this.request< + ProjectsCreateColumnData, + BasicError | ValidationErrorSimple + >({ + path: \`/projects/\${projectId}/columns\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description The list of reviews returns in chronological order. + * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. * - * @tags pulls - * @name PullsListReviews - * @summary List reviews for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @tags projects + * @name ProjectsDelete + * @summary Delete a project + * @request DELETE:/projects/{project_id} */ - pullsListReviews: ( - { owner, repo, pullNumber, ...query }: PullsListReviewsParams, + projectsDelete: ( + { projectId }: ProjectsDeleteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/projects/\${projectId}\`, + method: "DELETE", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * No description * - * @tags pulls - * @name PullsMerge - * @summary Merge a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - pullsMerge: ( - { owner, repo, pullNumber }: PullsMergeParams, - data: PullsMergePayload, + projectsDeleteCard: ( + { cardId }: ProjectsDeleteCardParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + method: "DELETE", ...params, }), /** * No description * - * @tags pulls - * @name PullsRemoveRequestedReviewers - * @summary Remove requested reviewers from a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - pullsRemoveRequestedReviewers: ( - { owner, repo, pullNumber }: PullsRemoveRequestedReviewersParams, - data: PullsRemoveRequestedReviewersPayload, + projectsDeleteColumn: ( + { columnId }: ProjectsDeleteColumnParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + this.request({ + path: \`/projects/columns/\${columnId}\`, method: "DELETE", - body: data, - type: ContentType.Json, ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags pulls - * @name PullsRequestReviewers - * @summary Request reviewers for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags projects + * @name ProjectsGet + * @summary Get a project + * @request GET:/projects/{project_id} */ - pullsRequestReviewers: ( - { owner, repo, pullNumber }: PullsRequestReviewersParams, - data: PullsRequestReviewersPayload, + projectsGet: ( + { projectId }: ProjectsGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/\${projectId}\`, + method: "GET", format: "json", ...params, }), @@ -59049,62 +57617,55 @@ export class Api< /** * No description * - * @tags pulls - * @name PullsSubmitReview - * @summary Submit a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + * @tags projects + * @name ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - pullsSubmitReview: ( - { owner, repo, pullNumber, reviewId }: PullsSubmitReviewParams, - data: PullsSubmitReviewPayload, + projectsGetCard: ( + { cardId }: ProjectsGetCardParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + * No description * - * @tags pulls - * @name PullsUpdate - * @summary Update a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags projects + * @name ProjectsGetColumn + * @summary Get a project column + * @request GET:/projects/columns/{column_id} */ - pullsUpdate: ( - { owner, repo, pullNumber }: PullsUpdateParams, - data: PullsUpdatePayload, + projectsGetColumn: ( + { columnId }: ProjectsGetColumnParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/columns/\${columnId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. * - * @tags pulls - * @name PullsUpdateBranch - * @summary Update a pull request branch - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch + * @tags projects + * @name ProjectsGetPermissionForUser + * @summary Get project permission for a user + * @request GET:/projects/{project_id}/collaborators/{username}/permission */ - pullsUpdateBranch: ( - { owner, repo, pullNumber }: PullsUpdateBranchParams, - data: PullsUpdateBranchPayload, + projectsGetPermissionForUser: ( + { projectId, username }: ProjectsGetPermissionForUserParams, params: RequestParams = {}, ) => this.request< - PullsUpdateBranchData, + ProjectsGetPermissionForUserData, | BasicError | { documentation_url: string; @@ -59112,109 +57673,95 @@ export class Api< } | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, + method: "GET", format: "json", ...params, }), /** - * @description Update the review summary comment with new text. + * No description * - * @tags pulls - * @name PullsUpdateReview - * @summary Update a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - pullsUpdateReview: ( - { owner, repo, pullNumber, reviewId }: PullsUpdateReviewParams, - data: PullsUpdateReviewPayload, + projectsListCards: ( + { columnId, ...query }: ProjectsListCardsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Enables you to edit a review comment. + * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. * - * @tags pulls - * @name PullsUpdateReviewComment - * @summary Update a review comment for a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags projects + * @name ProjectsListCollaborators + * @summary List project collaborators + * @request GET:/projects/{project_id}/collaborators */ - pullsUpdateReviewComment: ( - { owner, repo, commentId }: PullsUpdateReviewCommentParams, - data: PullsUpdateReviewCommentPayload, + projectsListCollaborators: ( + { projectId, ...query }: ProjectsListCollaboratorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + ProjectsListCollaboratorsData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. + * No description * - * @tags reactions - * @name ReactionsCreateForCommitComment - * @summary Create reaction for a commit comment - * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - reactionsCreateForCommitComment: ( - { owner, repo, commentId }: ReactionsCreateForCommitCommentParams, - data: ReactionsCreateForCommitCommentPayload, + projectsListColumns: ( + { projectId, ...query }: ProjectsListColumnsParams, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForCommitCommentData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/\${projectId}/columns\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. + * No description * - * @tags reactions - * @name ReactionsCreateForIssue - * @summary Create reaction for an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - reactionsCreateForIssue: ( - { owner, repo, issueNumber }: ReactionsCreateForIssueParams, - data: ReactionsCreateForIssuePayload, + projectsMoveCard: ( + { cardId }: ProjectsMoveCardParams, + data: ProjectsMoveCardPayload, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForIssueData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/projects/columns/cards/\${cardId}/moves\`, method: "POST", body: data, type: ContentType.Json, @@ -59223,27 +57770,20 @@ export class Api< }), /** - * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. + * No description * - * @tags reactions - * @name ReactionsCreateForIssueComment - * @summary Create reaction for an issue comment - * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - reactionsCreateForIssueComment: ( - { owner, repo, commentId }: ReactionsCreateForIssueCommentParams, - data: ReactionsCreateForIssueCommentPayload, + projectsMoveColumn: ( + { columnId }: ProjectsMoveColumnParams, + data: ProjectsMoveColumnPayload, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForIssueCommentData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + this.request({ + path: \`/projects/columns/\${columnId}/moves\`, method: "POST", body: data, type: ContentType.Json, @@ -59252,971 +57792,882 @@ export class Api< }), /** - * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. + * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. * - * @tags reactions - * @name ReactionsCreateForPullRequestReviewComment - * @summary Create reaction for a pull request review comment - * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags projects + * @name ProjectsRemoveCollaborator + * @summary Remove user as a collaborator + * @request DELETE:/projects/{project_id}/collaborators/{username} */ - reactionsCreateForPullRequestReviewComment: ( - { - owner, - repo, - commentId, - }: ReactionsCreateForPullRequestReviewCommentParams, - data: ReactionsCreateForPullRequestReviewCommentPayload, + projectsRemoveCollaborator: ( + { projectId, username }: ProjectsRemoveCollaboratorParams, params: RequestParams = {}, ) => this.request< - ReactionsCreateForPullRequestReviewCommentData, + ProjectsRemoveCollaboratorData, + | BasicError | { documentation_url: string; message: string; } | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + path: \`/projects/\${projectId}/collaborators/\${username}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags reactions - * @name ReactionsDeleteForCommitComment - * @summary Delete a commit comment reaction - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + * @tags projects + * @name ProjectsUpdate + * @summary Update a project + * @request PATCH:/projects/{project_id} */ - reactionsDeleteForCommitComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForCommitCommentParams, + projectsUpdate: ( + { projectId }: ProjectsUpdateParams, + data: ProjectsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/projects/\${projectId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + * No description * - * @tags reactions - * @name ReactionsDeleteForIssue - * @summary Delete an issue reaction - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + * @tags projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - reactionsDeleteForIssue: ( - { owner, repo, issueNumber, reactionId }: ReactionsDeleteForIssueParams, + projectsUpdateCard: ( + { cardId }: ProjectsUpdateCardParams, + data: ProjectsUpdateCardPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * No description * - * @tags reactions - * @name ReactionsDeleteForIssueComment - * @summary Delete an issue comment reaction - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - reactionsDeleteForIssueComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForIssueCommentParams, + projectsUpdateColumn: ( + { columnId }: ProjectsUpdateColumnParams, + data: ProjectsUpdateColumnPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/projects/columns/\${columnId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - + }; + rateLimit = { /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. * - * @tags reactions - * @name ReactionsDeleteForPullRequestComment - * @summary Delete a pull request comment reaction - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + * @tags rate-limit + * @name RateLimitGet + * @summary Get rate limit status for the authenticated user + * @request GET:/rate_limit */ - reactionsDeleteForPullRequestComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForPullRequestCommentParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + rateLimitGet: (params: RequestParams = {}) => + this.request({ + path: \`/rate_limit\`, + method: "GET", + format: "json", ...params, }), - + }; + reactions = { /** - * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). * * @tags reactions - * @name ReactionsListForCommitComment - * @summary List reactions for a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @name ReactionsDeleteLegacy + * @summary Delete a reaction (Legacy) + * @request DELETE:/reactions/{reaction_id} + * @deprecated */ - reactionsListForCommitComment: ( - { owner, repo, commentId, ...query }: ReactionsListForCommitCommentParams, + reactionsDeleteLegacy: ( + { reactionId }: ReactionsDeleteLegacyParams, params: RequestParams = {}, ) => this.request< - ReactionsListForCommitCommentData, + ReactionsDeleteLegacyData, | BasicError | { documentation_url: string; message: string; } >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, - method: "GET", - query: query, - format: "json", + path: \`/reactions/\${reactionId}\`, + method: "DELETE", + ...params, + }), + }; + repos = { + /** + * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * + * @tags actions + * @name ActionsCancelWorkflowRun + * @summary Cancel a workflow run + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + */ + actionsCancelWorkflowRun: ( + { owner, repo, runId }: ActionsCancelWorkflowRunParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, + method: "POST", ...params, }), /** - * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` * - * @tags reactions - * @name ReactionsListForIssue - * @summary List reactions for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags actions + * @name ActionsCreateOrUpdateRepoSecret + * @summary Create or update a repository secret + * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reactionsListForIssue: ( - { owner, repo, issueNumber, ...query }: ReactionsListForIssueParams, + actionsCreateOrUpdateRepoSecret: ( + { owner, repo, secretName }: ActionsCreateOrUpdateRepoSecretParams, + data: ActionsCreateOrUpdateRepoSecretPayload, params: RequestParams = {}, ) => - this.request< - ReactionsListForIssueData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` * - * @tags reactions - * @name ReactionsListForIssueComment - * @summary List reactions for an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags actions + * @name ActionsCreateRegistrationTokenForRepo + * @summary Create a registration token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token */ - reactionsListForIssueComment: ( - { owner, repo, commentId, ...query }: ReactionsListForIssueCommentParams, + actionsCreateRegistrationTokenForRepo: ( + { owner, repo }: ActionsCreateRegistrationTokenForRepoParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForIssueCommentData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, + method: "POST", format: "json", ...params, }), /** - * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * - * @tags reactions - * @name ReactionsListForPullRequestReviewComment - * @summary List reactions for a pull request review comment - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags actions + * @name ActionsCreateRemoveTokenForRepo + * @summary Create a remove token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token */ - reactionsListForPullRequestReviewComment: ( - { - owner, - repo, - commentId, - ...query - }: ReactionsListForPullRequestReviewCommentParams, + actionsCreateRemoveTokenForRepo: ( + { owner, repo }: ActionsCreateRemoveTokenForRepoParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForPullRequestReviewCommentData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, + method: "POST", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." * - * @tags repos - * @name ReposAddAppAccessRestrictions - * @summary Add app access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags actions + * @name ActionsCreateWorkflowDispatch + * @summary Create a workflow dispatch event + * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches */ - reposAddAppAccessRestrictions: ( - { owner, repo, branch }: ReposAddAppAccessRestrictionsParams, - data: ReposAddAppAccessRestrictionsPayload, + actionsCreateWorkflowDispatch: ( + { owner, repo, workflowId }: ActionsCreateWorkflowDispatchParams, + data: ActionsCreateWorkflowDispatchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposAddCollaborator - * @summary Add a repository collaborator - * @request PUT:/repos/{owner}/{repo}/collaborators/{username} + * @tags actions + * @name ActionsDeleteArtifact + * @summary Delete an artifact + * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposAddCollaborator: ( - { owner, repo, username }: ReposAddCollaboratorParams, - data: ReposAddCollaboratorPayload, + actionsDeleteArtifact: ( + { owner, repo, artifactId }: ActionsDeleteArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags repos - * @name ReposAddStatusCheckContexts - * @summary Add status check contexts - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags actions + * @name ActionsDeleteRepoSecret + * @summary Delete a repository secret + * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reposAddStatusCheckContexts: ( - { owner, repo, branch }: ReposAddStatusCheckContextsParams, - data: ReposAddStatusCheckContextsPayload, + actionsDeleteRepoSecret: ( + { owner, repo, secretName }: ActionsDeleteRepoSecretParams, params: RequestParams = {}, ) => - this.request< - ReposAddStatusCheckContextsData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposAddTeamAccessRestrictions - * @summary Add team access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromRepo + * @summary Delete a self-hosted runner from a repository + * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - reposAddTeamAccessRestrictions: ( - { owner, repo, branch }: ReposAddTeamAccessRestrictionsParams, - data: ReposAddTeamAccessRestrictionsPayload, + actionsDeleteSelfHostedRunnerFromRepo: ( + { owner, repo, runnerId }: ActionsDeleteSelfHostedRunnerFromRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposAddUserAccessRestrictions - * @summary Add user access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags actions + * @name ActionsDeleteWorkflowRun + * @summary Delete a workflow run + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} */ - reposAddUserAccessRestrictions: ( - { owner, repo, branch }: ReposAddUserAccessRestrictionsParams, - data: ReposAddUserAccessRestrictionsPayload, + actionsDeleteWorkflowRun: ( + { owner, repo, runId }: ActionsDeleteWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + method: "DELETE", ...params, }), /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposCheckCollaborator - * @summary Check if a user is a repository collaborator - * @request GET:/repos/{owner}/{repo}/collaborators/{username} + * @tags actions + * @name ActionsDeleteWorkflowRunLogs + * @summary Delete workflow run logs + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - reposCheckCollaborator: ( - { owner, repo, username }: ReposCheckCollaboratorParams, + actionsDeleteWorkflowRunLogs: ( + { owner, repo, runId }: ActionsDeleteWorkflowRunLogsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + method: "DELETE", ...params, }), /** - * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposCheckVulnerabilityAlerts - * @summary Check if vulnerability alerts are enabled for a repository - * @request GET:/repos/{owner}/{repo}/vulnerability-alerts + * @tags actions + * @name ActionsDisableWorkflow + * @summary Disable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable */ - reposCheckVulnerabilityAlerts: ( - { owner, repo }: ReposCheckVulnerabilityAlertsParams, + actionsDisableWorkflow: ( + { owner, repo, workflowId }: ActionsDisableWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, + method: "PUT", ...params, }), /** - * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCompareCommits - * @summary Compare two commits - * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} + * @tags actions + * @name ActionsDownloadArtifact + * @summary Download an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} */ - reposCompareCommits: ( - { owner, repo, base, head }: ReposCompareCommitsParams, + actionsDownloadArtifact: ( + { owner, repo, artifactId, archiveFormat }: ActionsDownloadArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, method: "GET", - format: "json", ...params, }), /** - * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateCommitComment - * @summary Create a commit comment - * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @tags actions + * @name ActionsDownloadJobLogsForWorkflowRun + * @summary Download job logs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs */ - reposCreateCommitComment: ( - { owner, repo, commitSha }: ReposCreateCommitCommentParams, - data: ReposCreateCommitCommentPayload, + actionsDownloadJobLogsForWorkflowRun: ( + { owner, repo, jobId }: ActionsDownloadJobLogsForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, + method: "GET", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. + * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateCommitSignatureProtection - * @summary Create commit signature protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags actions + * @name ActionsDownloadWorkflowRunLogs + * @summary Download workflow run logs + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - reposCreateCommitSignatureProtection: ( - { owner, repo, branch }: ReposCreateCommitSignatureProtectionParams, + actionsDownloadWorkflowRunLogs: ( + { owner, repo, runId }: ActionsDownloadWorkflowRunLogsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "POST", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + method: "GET", ...params, }), /** - * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. + * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateCommitStatus - * @summary Create a commit status - * @request POST:/repos/{owner}/{repo}/statuses/{sha} + * @tags actions + * @name ActionsEnableWorkflow + * @summary Enable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable */ - reposCreateCommitStatus: ( - { owner, repo, sha }: ReposCreateCommitStatusParams, - data: ReposCreateCommitStatusPayload, + actionsEnableWorkflow: ( + { owner, repo, workflowId }: ActionsEnableWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, + method: "PUT", ...params, }), /** - * @description You can create a read-only deploy key. + * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposCreateDeployKey - * @summary Create a deploy key - * @request POST:/repos/{owner}/{repo}/keys + * @tags actions + * @name ActionsGetAllowedActionsRepository + * @summary Get allowed actions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - reposCreateDeployKey: ( - { owner, repo }: ReposCreateDeployKeyParams, - data: ReposCreateDeployKeyPayload, + actionsGetAllowedActionsRepository: ( + { owner, repo }: ActionsGetAllowedActionsRepositoryParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "GET", format: "json", ...params, }), /** - * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. + * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateDeployment - * @summary Create a deployment - * @request POST:/repos/{owner}/{repo}/deployments + * @tags actions + * @name ActionsGetArtifact + * @summary Get an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposCreateDeployment: ( - { owner, repo }: ReposCreateDeploymentParams, - data: ReposCreateDeploymentPayload, + actionsGetArtifact: ( + { owner, repo, artifactId }: ActionsGetArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. + * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposCreateDeploymentStatus - * @summary Create a deployment status - * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @tags actions + * @name ActionsGetGithubActionsPermissionsRepository + * @summary Get GitHub Actions permissions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions */ - reposCreateDeploymentStatus: ( - { owner, repo, deploymentId }: ReposCreateDeploymentStatusParams, - data: ReposCreateDeploymentStatusPayload, + actionsGetGithubActionsPermissionsRepository: ( + { owner, repo }: ActionsGetGithubActionsPermissionsRepositoryParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + method: "GET", format: "json", ...params, }), /** - * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. + * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateDispatchEvent - * @summary Create a repository dispatch event - * @request POST:/repos/{owner}/{repo}/dispatches + * @tags actions + * @name ActionsGetJobForWorkflowRun + * @summary Get a job for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} */ - reposCreateDispatchEvent: ( - { owner, repo }: ReposCreateDispatchEventParams, - data: ReposCreateDispatchEventPayload, + actionsGetJobForWorkflowRun: ( + { owner, repo, jobId }: ActionsGetJobForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/dispatches\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags repos - * @name ReposCreateFork - * @summary Create a fork - * @request POST:/repos/{owner}/{repo}/forks + * @tags actions + * @name ActionsGetRepoPublicKey + * @summary Get a repository public key + * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key */ - reposCreateFork: ( - { owner, repo }: ReposCreateForkParams, - data: ReposCreateForkPayload, + actionsGetRepoPublicKey: ( + { owner, repo }: ActionsGetRepoPublicKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, + method: "GET", format: "json", ...params, }), /** - * @description Creates a new file or replaces an existing file in a repository. + * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags repos - * @name ReposCreateOrUpdateFileContents - * @summary Create or update file contents - * @request PUT:/repos/{owner}/{repo}/contents/{path} + * @tags actions + * @name ActionsGetRepoSecret + * @summary Get a repository secret + * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reposCreateOrUpdateFileContents: ( - { owner, repo, path }: ReposCreateOrUpdateFileContentsParams, - data: ReposCreateOrUpdateFileContentsPayload, + actionsGetRepoSecret: ( + { owner, repo, secretName }: ActionsGetRepoSecretParams, params: RequestParams = {}, ) => - this.request< - ReposCreateOrUpdateFileContentsData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "GET", format: "json", ...params, }), /** - * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." + * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposCreatePagesSite - * @summary Create a GitHub Pages site - * @request POST:/repos/{owner}/{repo}/pages + * @tags actions + * @name ActionsGetSelfHostedRunnerForRepo + * @summary Get a self-hosted runner for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - reposCreatePagesSite: ( - { owner, repo }: ReposCreatePagesSiteParams, - data: ReposCreatePagesSitePayload, + actionsGetSelfHostedRunnerForRepo: ( + { owner, repo, runnerId }: ActionsGetSelfHostedRunnerForRepoParams, params: RequestParams = {}, ) => - this.request< - ReposCreatePagesSiteData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateRelease - * @summary Create a release - * @request POST:/repos/{owner}/{repo}/releases + * @tags actions + * @name ActionsGetWorkflow + * @summary Get a workflow + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} */ - reposCreateRelease: ( - { owner, repo }: ReposCreateReleaseParams, - data: ReposCreateReleasePayload, + actionsGetWorkflow: ( + { owner, repo, workflowId }: ActionsGetWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateUsingTemplate - * @summary Create a repository using a template - * @request POST:/repos/{template_owner}/{template_repo}/generate + * @tags actions + * @name ActionsGetWorkflowRun + * @summary Get a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} */ - reposCreateUsingTemplate: ( - { templateOwner, templateRepo }: ReposCreateUsingTemplateParams, - data: ReposCreateUsingTemplatePayload, + actionsGetWorkflowRun: ( + { owner, repo, runId }: ActionsGetWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. + * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateWebhook - * @summary Create a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks + * @tags actions + * @name ActionsGetWorkflowRunUsage + * @summary Get workflow run usage + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing */ - reposCreateWebhook: ( - { owner, repo }: ReposCreateWebhookParams, - data: ReposCreateWebhookPayload, + actionsGetWorkflowRunUsage: ( + { owner, repo, runId }: ActionsGetWorkflowRunUsageParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, + method: "GET", format: "json", ...params, }), /** - * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. + * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDelete - * @summary Delete a repository - * @request DELETE:/repos/{owner}/{repo} + * @tags actions + * @name ActionsGetWorkflowUsage + * @summary Get workflow usage + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing */ - reposDelete: ( - { owner, repo }: ReposDeleteParams, + actionsGetWorkflowUsage: ( + { owner, repo, workflowId }: ActionsGetWorkflowUsageParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, + method: "GET", + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. + * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDeleteAccessRestrictions - * @summary Delete access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags actions + * @name ActionsListArtifactsForRepo + * @summary List artifacts for a repository + * @request GET:/repos/{owner}/{repo}/actions/artifacts */ - reposDeleteAccessRestrictions: ( - { owner, repo, branch }: ReposDeleteAccessRestrictionsParams, + actionsListArtifactsForRepo: ( + { owner, repo, ...query }: ActionsListArtifactsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * - * @tags repos - * @name ReposDeleteAdminBranchProtection - * @summary Delete admin branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags actions + * @name ActionsListJobsForWorkflowRun + * @summary List jobs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs */ - reposDeleteAdminBranchProtection: ( - { owner, repo, branch }: ReposDeleteAdminBranchProtectionParams, + actionsListJobsForWorkflowRun: ( + { owner, repo, runId, ...query }: ActionsListJobsForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags repos - * @name ReposDeleteBranchProtection - * @summary Delete branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags actions + * @name ActionsListRepoSecrets + * @summary List repository secrets + * @request GET:/repos/{owner}/{repo}/actions/secrets */ - reposDeleteBranchProtection: ( - { owner, repo, branch }: ReposDeleteBranchProtectionParams, + actionsListRepoSecrets: ( + { owner, repo, ...query }: ActionsListRepoSecretsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @tags actions + * @name ActionsListRepoWorkflows + * @summary List repository workflows + * @request GET:/repos/{owner}/{repo}/actions/workflows */ - reposDeleteCommitComment: ( - { owner, repo, commentId }: ReposDeleteCommitCommentParams, + actionsListRepoWorkflows: ( + { owner, repo, ...query }: ActionsListRepoWorkflowsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposDeleteCommitSignatureProtection - * @summary Delete commit signature protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags actions + * @name ActionsListRunnerApplicationsForRepo + * @summary List runner applications for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/downloads */ - reposDeleteCommitSignatureProtection: ( - { owner, repo, branch }: ReposDeleteCommitSignatureProtectionParams, + actionsListRunnerApplicationsForRepo: ( + { owner, repo }: ActionsListRunnerApplicationsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, + method: "GET", + format: "json", ...params, }), /** - * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. + * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposDeleteDeployKey - * @summary Delete a deploy key - * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + * @tags actions + * @name ActionsListSelfHostedRunnersForRepo + * @summary List self-hosted runners for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners */ - reposDeleteDeployKey: ( - { owner, repo, keyId }: ReposDeleteDeployKeyParams, + actionsListSelfHostedRunnersForRepo: ( + { owner, repo, ...query }: ActionsListSelfHostedRunnersForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." + * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDeleteDeployment - * @summary Delete a deployment - * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags actions + * @name ActionsListWorkflowRunArtifacts + * @summary List workflow run artifacts + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts */ - reposDeleteDeployment: ( - { owner, repo, deploymentId }: ReposDeleteDeploymentParams, + actionsListWorkflowRunArtifacts: ( + { owner, repo, runId, ...query }: ActionsListWorkflowRunArtifactsParams, params: RequestParams = {}, ) => - this.request< - ReposDeleteDeploymentData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. + * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. * - * @tags repos - * @name ReposDeleteFile - * @summary Delete a file - * @request DELETE:/repos/{owner}/{repo}/contents/{path} + * @tags actions + * @name ActionsListWorkflowRuns + * @summary List workflow runs + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs */ - reposDeleteFile: ( - { owner, repo, path }: ReposDeleteFileParams, - data: ReposDeleteFilePayload, + actionsListWorkflowRuns: ( + { owner, repo, workflowId, ...query }: ActionsListWorkflowRunsParams, params: RequestParams = {}, ) => - this.request< - ReposDeleteFileData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @tags actions + * @name ActionsListWorkflowRunsForRepo + * @summary List workflow runs for a repository + * @request GET:/repos/{owner}/{repo}/actions/runs */ - reposDeleteInvitation: ( - { owner, repo, invitationId }: ReposDeleteInvitationParams, + actionsListWorkflowRunsForRepo: ( + { owner, repo, ...query }: ActionsListWorkflowRunsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @tags actions + * @name ActionsReRunWorkflow + * @summary Re-run a workflow + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun */ - reposDeletePagesSite: ( - { owner, repo }: ReposDeletePagesSiteParams, + actionsReRunWorkflow: ( + { owner, repo, runId }: ActionsReRunWorkflowParams, params: RequestParams = {}, ) => - this.request< - ReposDeletePagesSiteData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, + method: "POST", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposDeletePullRequestReviewProtection - * @summary Delete pull request review protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags actions + * @name ActionsSetAllowedActionsRepository + * @summary Set allowed actions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - reposDeletePullRequestReviewProtection: ( - { owner, repo, branch }: ReposDeletePullRequestReviewProtectionParams, + actionsSetAllowedActionsRepository: ( + { owner, repo }: ActionsSetAllowedActionsRepositoryParams, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Users with push access to the repository can delete a release. + * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposDeleteRelease - * @summary Delete a release - * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} + * @tags actions + * @name ActionsSetGithubActionsPermissionsRepository + * @summary Set GitHub Actions permissions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions */ - reposDeleteRelease: ( - { owner, repo, releaseId }: ReposDeleteReleaseParams, + actionsSetGithubActionsPermissionsRepository: ( + { owner, repo }: ActionsSetGithubActionsPermissionsRepositoryParams, + data: ActionsSetGithubActionsPermissionsRepositoryPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). * - * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags activity + * @name ActivityDeleteRepoSubscription + * @summary Delete a repository subscription + * @request DELETE:/repos/{owner}/{repo}/subscription */ - reposDeleteReleaseAsset: ( - { owner, repo, assetId }: ReposDeleteReleaseAssetParams, + activityDeleteRepoSubscription: ( + { owner, repo }: ActivityDeleteRepoSubscriptionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", ...params, }), @@ -60224,306 +58675,304 @@ export class Api< /** * No description * - * @tags repos - * @name ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription */ - reposDeleteWebhook: ( - { owner, repo, hookId }: ReposDeleteWebhookParams, + activityGetRepoSubscription: ( + { owner, repo }: ActivityGetRepoSubscriptionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + method: "GET", + format: "json", ...params, }), /** - * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * No description * - * @tags repos - * @name ReposDisableAutomatedSecurityFixes - * @summary Disable automated security fixes - * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events */ - reposDisableAutomatedSecurityFixes: ( - { owner, repo }: ReposDisableAutomatedSecurityFixesParams, + activityListRepoEvents: ( + { owner, repo, ...query }: ActivityListRepoEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/events\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @description List all notifications for the current user. * - * @tags repos - * @name ReposDisableVulnerabilityAlerts - * @summary Disable vulnerability alerts - * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts + * @tags activity + * @name ActivityListRepoNotificationsForAuthenticatedUser + * @summary List repository notifications for the authenticated user + * @request GET:/repos/{owner}/{repo}/notifications */ - reposDisableVulnerabilityAlerts: ( - { owner, repo }: ReposDisableVulnerabilityAlertsParams, + activityListRepoNotificationsForAuthenticatedUser: ( + { + owner, + repo, + ...query + }: ActivityListRepoNotificationsForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: * - * @tags repos - * @name ReposDownloadTarballArchive - * @summary Download a repository archive (tar) - * @request GET:/repos/{owner}/{repo}/tarball/{ref} + * @tags activity + * @name ActivityListStargazersForRepo + * @summary List stargazers + * @request GET:/repos/{owner}/{repo}/stargazers */ - reposDownloadTarballArchive: ( - { owner, repo, ref }: ReposDownloadTarballArchiveParams, + activityListStargazersForRepo: ( + { owner, repo, ...query }: ActivityListStargazersForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stargazers\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * @description Lists the people watching the specified repository. * - * @tags repos - * @name ReposDownloadZipballArchive - * @summary Download a repository archive (zip) - * @request GET:/repos/{owner}/{repo}/zipball/{ref} + * @tags activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - reposDownloadZipballArchive: ( - { owner, repo, ref }: ReposDownloadZipballArchiveParams, + activityListWatchersForRepo: ( + { owner, repo, ...query }: ActivityListWatchersForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. * - * @tags repos - * @name ReposEnableAutomatedSecurityFixes - * @summary Enable automated security fixes - * @request PUT:/repos/{owner}/{repo}/automated-security-fixes + * @tags activity + * @name ActivityMarkRepoNotificationsAsRead + * @summary Mark repository notifications as read + * @request PUT:/repos/{owner}/{repo}/notifications */ - reposEnableAutomatedSecurityFixes: ( - { owner, repo }: ReposEnableAutomatedSecurityFixesParams, + activityMarkRepoNotificationsAsRead: ( + { owner, repo }: ActivityMarkRepoNotificationsAsReadParams, + data: ActivityMarkRepoNotificationsAsReadPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. * - * @tags repos - * @name ReposEnableVulnerabilityAlerts - * @summary Enable vulnerability alerts - * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts + * @tags activity + * @name ActivitySetRepoSubscription + * @summary Set a repository subscription + * @request PUT:/repos/{owner}/{repo}/subscription */ - reposEnableVulnerabilityAlerts: ( - { owner, repo }: ReposEnableVulnerabilityAlertsParams, + activitySetRepoSubscription: ( + { owner, repo }: ActivitySetRepoSubscriptionParams, + data: ActivitySetRepoSubscriptionPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, method: "PUT", - ...params, - }), - - /** - * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. - * - * @tags repos - * @name ReposGet - * @summary Get a repository - * @request GET:/repos/{owner}/{repo} - */ - reposGet: ({ owner, repo }: ReposGetParams, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "GET", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. + * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags repos - * @name ReposGetAccessRestrictions - * @summary Get access restrictions - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags apps + * @name AppsGetRepoInstallation + * @summary Get a repository installation for the authenticated app + * @request GET:/repos/{owner}/{repo}/installation */ - reposGetAccessRestrictions: ( - { owner, repo, branch }: ReposGetAccessRestrictionsParams, + appsGetRepoInstallation: ( + { owner, repo }: AppsGetRepoInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/installation\`, method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. * - * @tags repos - * @name ReposGetAdminBranchProtection - * @summary Get admin branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags checks + * @name ChecksCreate + * @summary Create a check run + * @request POST:/repos/{owner}/{repo}/check-runs */ - reposGetAdminBranchProtection: ( - { owner, repo, branch }: ReposGetAdminBranchProtectionParams, + checksCreate: ( + { owner, repo }: ChecksCreateParams, + data: ChecksCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. * - * @tags repos - * @name ReposGetAllStatusCheckContexts - * @summary Get all status check contexts - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags checks + * @name ChecksCreateSuite + * @summary Create a check suite + * @request POST:/repos/{owner}/{repo}/check-suites */ - reposGetAllStatusCheckContexts: ( - { owner, repo, branch }: ReposGetAllStatusCheckContextsParams, + checksCreateSuite: ( + { owner, repo }: ChecksCreateSuiteParams, + data: ChecksCreateSuitePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. * - * @tags repos - * @name ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @tags checks + * @name ChecksGet + * @summary Get a check run + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - reposGetAllTopics: ( - { owner, repo }: ReposGetAllTopicsParams, + checksGet: ( + { owner, repo, checkRunId }: ChecksGetParams, params: RequestParams = {}, ) => - this.request< - ReposGetAllTopicsData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/topics\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. * - * @tags repos - * @name ReposGetAppsWithAccessToProtectedBranch - * @summary Get apps with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags checks + * @name ChecksGetSuite + * @summary Get a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} */ - reposGetAppsWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetAppsWithAccessToProtectedBranchParams, + checksGetSuite: ( + { owner, repo, checkSuiteId }: ChecksGetSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. * - * @tags repos - * @name ReposGetBranch - * @summary Get a branch - * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @tags checks + * @name ChecksListAnnotations + * @summary List check run annotations + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations */ - reposGetBranch: ( - { owner, repo, branch }: ReposGetBranchParams, + checksListAnnotations: ( + { owner, repo, checkRunId, ...query }: ChecksListAnnotationsParams, params: RequestParams = {}, ) => - this.request< - ReposGetBranchData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. * - * @tags repos - * @name ReposGetBranchProtection - * @summary Get branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags checks + * @name ChecksListForRef + * @summary List check runs for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs */ - reposGetBranchProtection: ( - { owner, repo, branch }: ReposGetBranchProtectionParams, + checksListForRef: ( + { owner, repo, ref, ...query }: ChecksListForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. * - * @tags repos - * @name ReposGetClones - * @summary Get repository clones - * @request GET:/repos/{owner}/{repo}/traffic/clones + * @tags checks + * @name ChecksListForSuite + * @summary List check runs in a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs */ - reposGetClones: ( - { owner, repo, ...query }: ReposGetClonesParams, + checksListForSuite: ( + { owner, repo, checkSuiteId, ...query }: ChecksListForSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/clones\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, method: "GET", query: query, format: "json", @@ -60531,191 +58980,219 @@ export class Api< }), /** - * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. * - * @tags repos - * @name ReposGetCodeFrequencyStats - * @summary Get the weekly commit activity - * @request GET:/repos/{owner}/{repo}/stats/code_frequency + * @tags checks + * @name ChecksListSuitesForRef + * @summary List check suites for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites */ - reposGetCodeFrequencyStats: ( - { owner, repo }: ReposGetCodeFrequencyStatsParams, + checksListSuitesForRef: ( + { owner, repo, ref, ...query }: ChecksListSuitesForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. + * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. * - * @tags repos - * @name ReposGetCollaboratorPermissionLevel - * @summary Get repository permissions for a user - * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission + * @tags checks + * @name ChecksRerequestSuite + * @summary Rerequest a check suite + * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest */ - reposGetCollaboratorPermissionLevel: ( - { owner, repo, username }: ReposGetCollaboratorPermissionLevelParams, + checksRerequestSuite: ( + { owner, repo, checkSuiteId }: ChecksRerequestSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, + method: "POST", ...params, }), /** - * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` + * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. * - * @tags repos - * @name ReposGetCombinedStatusForRef - * @summary Get the combined status for a specific reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + * @tags checks + * @name ChecksSetSuitesPreferences + * @summary Update repository preferences for check suites + * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences */ - reposGetCombinedStatusForRef: ( - { owner, repo, ref }: ReposGetCombinedStatusForRefParams, + checksSetSuitesPreferences: ( + { owner, repo }: ChecksSetSuitesPreferencesParams, + data: ChecksSetSuitesPreferencesPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. * - * @tags repos - * @name ReposGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/commits/{ref} + * @tags checks + * @name ChecksUpdate + * @summary Update a check run + * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - reposGetCommit: ( - { owner, repo, ref }: ReposGetCommitParams, + checksUpdate: ( + { owner, repo, checkRunId }: ChecksUpdateParams, + data: ChecksUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. + * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. * - * @tags repos - * @name ReposGetCommitActivityStats - * @summary Get the last year of commit activity - * @request GET:/repos/{owner}/{repo}/stats/commit_activity + * @tags code-scanning + * @name CodeScanningGetAlert + * @summary Get a code scanning alert + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - reposGetCommitActivityStats: ( - { owner, repo }: ReposGetCommitActivityStatsParams, + codeScanningGetAlert: ( + { owner, repo, alertNumber }: CodeScanningGetAlertParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + this.request< + CodeScanningGetAlertData, + | void + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. * - * @tags repos - * @name ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @tags code-scanning + * @name CodeScanningListAlertsForRepo + * @summary List code scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts */ - reposGetCommitComment: ( - { owner, repo, commentId }: ReposGetCommitCommentParams, + codeScanningListAlertsForRepo: ( + { owner, repo, ...query }: CodeScanningListAlertsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + this.request< + CodeScanningListAlertsForRepoData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. + * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. * - * @tags repos - * @name ReposGetCommitSignatureProtection - * @summary Get commit signature protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags code-scanning + * @name CodeScanningListRecentAnalyses + * @summary List recent code scanning analyses for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/analyses */ - reposGetCommitSignatureProtection: ( - { owner, repo, branch }: ReposGetCommitSignatureProtectionParams, + codeScanningListRecentAnalyses: ( + { owner, repo, ...query }: CodeScanningListRecentAnalysesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. + * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. * - * @tags repos - * @name ReposGetCommunityProfileMetrics - * @summary Get community profile metrics - * @request GET:/repos/{owner}/{repo}/community/profile + * @tags code-scanning + * @name CodeScanningUpdateAlert + * @summary Update a code scanning alert + * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - reposGetCommunityProfileMetrics: ( - { owner, repo }: ReposGetCommunityProfileMetricsParams, + codeScanningUpdateAlert: ( + { owner, repo, alertNumber }: CodeScanningUpdateAlertParams, + data: CodeScanningUpdateAlertPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/profile\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. + * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. * - * @tags repos - * @name ReposGetContent - * @summary Get repository content - * @request GET:/repos/{owner}/{repo}/contents/{path} + * @tags code-scanning + * @name CodeScanningUploadSarif + * @summary Upload a SARIF file + * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs */ - reposGetContent: ( - { owner, repo, path, ...query }: ReposGetContentParams, + codeScanningUploadSarif: ( + { owner, repo }: CodeScanningUploadSarifParams, + data: CodeScanningUploadSarifPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, + method: "POST", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits + * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. * - * @tags repos - * @name ReposGetContributorsStats - * @summary Get all contributor commit activity - * @request GET:/repos/{owner}/{repo}/stats/contributors + * @tags codes-of-conduct + * @name CodesOfConductGetForRepo + * @summary Get the code of conduct for a repository + * @request GET:/repos/{owner}/{repo}/community/code_of_conduct */ - reposGetContributorsStats: ( - { owner, repo }: ReposGetContributorsStatsParams, + codesOfConductGetForRepo: ( + { owner, repo }: CodesOfConductGetForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/contributors\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, method: "GET", format: "json", ...params, @@ -60724,101 +59201,109 @@ export class Api< /** * No description * - * @tags repos - * @name ReposGetDeployKey - * @summary Get a deploy key - * @request GET:/repos/{owner}/{repo}/keys/{key_id} + * @tags git + * @name GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - reposGetDeployKey: ( - { owner, repo, keyId }: ReposGetDeployKeyParams, + gitCreateBlob: ( + { owner, repo }: GitCreateBlobParams, + data: GitCreateBlobPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags repos - * @name ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags git + * @name GitCreateCommit + * @summary Create a commit + * @request POST:/repos/{owner}/{repo}/git/commits */ - reposGetDeployment: ( - { owner, repo, deploymentId }: ReposGetDeploymentParams, + gitCreateCommit: ( + { owner, repo }: GitCreateCommitParams, + data: GitCreateCommitPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Users with pull access can view a deployment status for a deployment: + * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. * - * @tags repos - * @name ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @tags git + * @name GitCreateRef + * @summary Create a reference + * @request POST:/repos/{owner}/{repo}/git/refs */ - reposGetDeploymentStatus: ( - { owner, repo, deploymentId, statusId }: ReposGetDeploymentStatusParams, + gitCreateRef: ( + { owner, repo }: GitCreateRefParams, + data: GitCreateRefPayload, params: RequestParams = {}, ) => - this.request< - ReposGetDeploymentStatusData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags repos - * @name ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @tags git + * @name GitCreateTag + * @summary Create a tag object + * @request POST:/repos/{owner}/{repo}/git/tags */ - reposGetLatestPagesBuild: ( - { owner, repo }: ReposGetLatestPagesBuildParams, + gitCreateTag: ( + { owner, repo }: GitCreateTagParams, + data: GitCreateTagPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. + * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." * - * @tags repos - * @name ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest + * @tags git + * @name GitCreateTree + * @summary Create a tree + * @request POST:/repos/{owner}/{repo}/git/trees */ - reposGetLatestRelease: ( - { owner, repo }: ReposGetLatestReleaseParams, + gitCreateTree: ( + { owner, repo }: GitCreateTreeParams, + data: GitCreateTreePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/latest\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -60826,112 +59311,111 @@ export class Api< /** * No description * - * @tags repos - * @name ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages + * @tags git + * @name GitDeleteRef + * @summary Delete a reference + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - reposGetPages: ( - { owner, repo }: ReposGetPagesParams, + gitDeleteRef: ( + { owner, repo, ref }: GitDeleteRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "DELETE", ...params, }), /** - * No description + * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. * - * @tags repos - * @name ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} + * @tags git + * @name GitGetBlob + * @summary Get a blob + * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} */ - reposGetPagesBuild: ( - { owner, repo, buildId }: ReposGetPagesBuildParams, + gitGetBlob: ( + { owner, repo, fileSha }: GitGetBlobParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, method: "GET", format: "json", ...params, }), /** - * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. + * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags repos - * @name ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @tags git + * @name GitGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} */ - reposGetParticipationStats: ( - { owner, repo }: ReposGetParticipationStatsParams, + gitGetCommit: ( + { owner, repo, commitSha }: GitGetCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/participation\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. - * - * @tags repos - * @name ReposGetPullRequestReviewProtection - * @summary Get pull request review protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * + * @tags git + * @name GitGetRef + * @summary Get a reference + * @request GET:/repos/{owner}/{repo}/git/ref/{ref} */ - reposGetPullRequestReviewProtection: ( - { owner, repo, branch }: ReposGetPullRequestReviewProtectionParams, + gitGetRef: ( + { owner, repo, ref }: GitGetRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", format: "json", ...params, }), /** - * @description 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. + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags repos - * @name ReposGetPunchCardStats - * @summary Get the hourly commit count for each day - * @request GET:/repos/{owner}/{repo}/stats/punch_card + * @tags git + * @name GitGetTag + * @summary Get a tag + * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} */ - reposGetPunchCardStats: ( - { owner, repo }: ReposGetPunchCardStatsParams, + gitGetTag: ( + { owner, repo, tagSha }: GitGetTagParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. * - * @tags repos - * @name ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @tags git + * @name GitGetTree + * @summary Get a tree + * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} */ - reposGetReadme: ( - { owner, repo, ...query }: ReposGetReadmeParams, + gitGetTree: ( + { owner, repo, treeSha, ...query }: GitGetTreeParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/readme\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, method: "GET", query: query, format: "json", @@ -60939,218 +59423,242 @@ export class Api< }), /** - * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). + * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. * - * @tags repos - * @name ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @tags git + * @name GitListMatchingRefs + * @summary List matching references + * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} */ - reposGetRelease: ( - { owner, repo, releaseId }: ReposGetReleaseParams, + gitListMatchingRefs: ( + { owner, repo, ref, ...query }: GitListMatchingRefsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. + * No description * - * @tags repos - * @name ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - reposGetReleaseAsset: ( - { owner, repo, assetId }: ReposGetReleaseAssetParams, + gitUpdateRef: ( + { owner, repo, ref }: GitUpdateRefParams, + data: GitUpdateRefPayload, params: RequestParams = {}, ) => - this.request< - ReposGetReleaseAssetData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get a published release with the specified tag. + * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. * - * @tags repos - * @name ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @tags interactions + * @name InteractionsGetRestrictionsForRepo + * @summary Get interaction restrictions for a repository + * @request GET:/repos/{owner}/{repo}/interaction-limits */ - reposGetReleaseByTag: ( - { owner, repo, tag }: ReposGetReleaseByTagParams, + interactionsGetRestrictionsForRepo: ( + { owner, repo }: InteractionsGetRestrictionsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. * - * @tags repos - * @name ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags interactions + * @name InteractionsRemoveRestrictionsForRepo + * @summary Remove interaction restrictions for a repository + * @request DELETE:/repos/{owner}/{repo}/interaction-limits */ - reposGetStatusChecksProtection: ( - { owner, repo, branch }: ReposGetStatusChecksProtectionParams, + interactionsRemoveRestrictionsForRepo: ( + { owner, repo }: InteractionsRemoveRestrictionsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. + * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. * - * @tags repos - * @name ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags interactions + * @name InteractionsSetRestrictionsForRepo + * @summary Set interaction restrictions for a repository + * @request PUT:/repos/{owner}/{repo}/interaction-limits */ - reposGetTeamsWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetTeamsWithAccessToProtectedBranchParams, + interactionsSetRestrictionsForRepo: ( + { owner, repo }: InteractionsSetRestrictionsForRepoParams, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the top 10 popular contents over the last 14 days. + * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. * - * @tags repos - * @name ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + * @tags issues + * @name IssuesAddAssignees + * @summary Add assignees to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - reposGetTopPaths: ( - { owner, repo }: ReposGetTopPathsParams, + issuesAddAssignees: ( + { owner, repo, issueNumber }: IssuesAddAssigneesParams, + data: IssuesAddAssigneesPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the top 10 referrers over the last 14 days. + * No description * - * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @tags issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposGetTopReferrers: ( - { owner, repo }: ReposGetTopReferrersParams, + issuesAddLabels: ( + { owner, repo, issueNumber }: IssuesAddLabelsParams, + data: IssuesAddLabelsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. + * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. * - * @tags repos - * @name ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags issues + * @name IssuesCheckUserCanBeAssigned + * @summary Check if a user can be assigned + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - reposGetUsersWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetUsersWithAccessToProtectedBranchParams, + issuesCheckUserCanBeAssigned: ( + { owner, repo, assignee }: IssuesCheckUserCanBeAssignedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + this.request< + IssuesCheckUserCanBeAssignedData, + IssuesCheckUserCanBeAssignedError + >({ + path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", - format: "json", ...params, }), /** - * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags repos - * @name ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @tags issues + * @name IssuesCreate + * @summary Create an issue + * @request POST:/repos/{owner}/{repo}/issues */ - reposGetViews: ( - { owner, repo, ...query }: ReposGetViewsParams, + issuesCreate: ( + { owner, repo }: IssuesCreateParams, + data: IssuesCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/views\`, - method: "GET", - query: query, + this.request< + IssuesCreateData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags repos - * @name ReposGetWebhook - * @summary Get a repository webhook - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags issues + * @name IssuesCreateComment + * @summary Create an issue comment + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reposGetWebhook: ( - { owner, repo, hookId }: ReposGetWebhookParams, + issuesCreateComment: ( + { owner, repo, issueNumber }: IssuesCreateCommentParams, + data: IssuesCreateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. + * No description * - * @tags repos - * @name ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @tags issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - reposGetWebhookConfigForRepo: ( - { owner, repo, hookId }: ReposGetWebhookConfigForRepoParams, + issuesCreateLabel: ( + { owner, repo }: IssuesCreateLabelParams, + data: IssuesCreateLabelPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -61158,165 +59666,151 @@ export class Api< /** * No description * - * @tags repos - * @name ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches + * @tags issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - reposListBranches: ( - { owner, repo, ...query }: ReposListBranchesParams, + issuesCreateMilestone: ( + { owner, repo }: IssuesCreateMilestoneParams, + data: IssuesCreateMilestonePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + * No description * - * @tags repos - * @name ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @tags issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reposListBranchesForHeadCommit: ( - { owner, repo, commitSha }: ReposListBranchesForHeadCommitParams, + issuesDeleteComment: ( + { owner, repo, commentId }: IssuesDeleteCommentParams, params: RequestParams = {}, ) => - this.request< - ReposListBranchesForHeadCommitData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + method: "DELETE", ...params, }), /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * No description * - * @tags repos - * @name ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @tags issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - reposListCollaborators: ( - { owner, repo, ...query }: ReposListCollaboratorsParams, + issuesDeleteLabel: ( + { owner, repo, name }: IssuesDeleteLabelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "DELETE", ...params, }), /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * No description * - * @tags repos - * @name ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @tags issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - reposListCommentsForCommit: ( - { owner, repo, commitSha, ...query }: ReposListCommentsForCommitParams, + issuesDeleteMilestone: ( + { owner, repo, milestoneNumber }: IssuesDeleteMilestoneParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "DELETE", ...params, }), /** - * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. + * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags repos - * @name ReposListCommitCommentsForRepo - * @summary List commit comments for a repository - * @request GET:/repos/{owner}/{repo}/comments + * @tags issues + * @name IssuesGet + * @summary Get an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number} */ - reposListCommitCommentsForRepo: ( - { owner, repo, ...query }: ReposListCommitCommentsForRepoParams, + issuesGet: ( + { owner, repo, issueNumber }: IssuesGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * No description * - * @tags repos - * @name ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @tags issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reposListCommits: ( - { owner, repo, ...query }: ReposListCommitsParams, + issuesGetComment: ( + { owner, repo, commentId }: IssuesGetCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. + * No description * - * @tags repos - * @name ReposListCommitStatusesForRef - * @summary List commit statuses for a reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + * @tags issues + * @name IssuesGetEvent + * @summary Get an issue event + * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} */ - reposListCommitStatusesForRef: ( - { owner, repo, ref, ...query }: ReposListCommitStatusesForRefParams, + issuesGetEvent: ( + { owner, repo, eventId }: IssuesGetEventParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. + * No description * - * @tags repos - * @name ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - reposListContributors: ( - { owner, repo, ...query }: ReposListContributorsParams, + issuesGetLabel: ( + { owner, repo, name }: IssuesGetLabelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contributors\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", - query: query, format: "json", ...params, }), @@ -61324,37 +59818,36 @@ export class Api< /** * No description * - * @tags repos - * @name ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} */ - reposListDeployKeys: ( - { owner, repo, ...query }: ReposListDeployKeysParams, + issuesGetMilestone: ( + { owner, repo, milestoneNumber }: IssuesGetMilestoneParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Simple filtering of deployments is available via query parameters: + * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. * - * @tags repos - * @name ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @tags issues + * @name IssuesListAssignees + * @summary List assignees + * @request GET:/repos/{owner}/{repo}/assignees */ - reposListDeployments: ( - { owner, repo, ...query }: ReposListDeploymentsParams, + issuesListAssignees: ( + { owner, repo, ...query }: IssuesListAssigneesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/assignees\`, method: "GET", query: query, format: "json", @@ -61362,44 +59855,61 @@ export class Api< }), /** - * @description Users with pull access can view deployment statuses for a deployment: + * @description Issue Comments are ordered by ascending ID. * - * @tags repos - * @name ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @tags issues + * @name IssuesListComments + * @summary List issue comments + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reposListDeploymentStatuses: ( - { - owner, - repo, - deploymentId, - ...query - }: ReposListDeploymentStatusesParams, + issuesListComments: ( + { owner, repo, issueNumber, ...query }: IssuesListCommentsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "GET", query: query, format: "json", ...params, }), + /** + * @description By default, Issue Comments are ordered by ascending ID. + * + * @tags issues + * @name IssuesListCommentsForRepo + * @summary List issue comments for a repository + * @request GET:/repos/{owner}/{repo}/issues/comments + */ + issuesListCommentsForRepo: ( + { owner, repo, ...query }: IssuesListCommentsForRepoParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/repos/\${owner}/\${repo}/issues/comments\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), + /** * No description * - * @tags repos - * @name ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @tags issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events */ - reposListForks: ( - { owner, repo, ...query }: ReposListForksParams, + issuesListEvents: ( + { owner, repo, issueNumber, ...query }: IssuesListEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, method: "GET", query: query, format: "json", @@ -61407,19 +59917,19 @@ export class Api< }), /** - * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. + * No description * - * @tags repos - * @name ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @tags issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events */ - reposListInvitations: ( - { owner, repo, ...query }: ReposListInvitationsParams, + issuesListEventsForRepo: ( + { owner, repo, ...query }: IssuesListEventsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events\`, method: "GET", query: query, format: "json", @@ -61427,38 +59937,46 @@ export class Api< }), /** - * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. + * No description * - * @tags repos - * @name ReposListLanguages - * @summary List repository languages - * @request GET:/repos/{owner}/{repo}/languages + * @tags issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - reposListLanguages: ( - { owner, repo }: ReposListLanguagesParams, + issuesListEventsForTimeline: ( + { owner, repo, issueNumber, ...query }: IssuesListEventsForTimelineParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/languages\`, + this.request< + IssuesListEventsForTimelineData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags repos - * @name ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @tags issues + * @name IssuesListForRepo + * @summary List repository issues + * @request GET:/repos/{owner}/{repo}/issues */ - reposListPagesBuilds: ( - { owner, repo, ...query }: ReposListPagesBuildsParams, + issuesListForRepo: ( + { owner, repo, ...query }: IssuesListForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues\`, method: "GET", query: query, format: "json", @@ -61466,30 +59984,24 @@ export class Api< }), /** - * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. + * No description * - * @tags repos - * @name ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + * @tags issues + * @name IssuesListLabelsForMilestone + * @summary List labels for issues in a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels */ - reposListPullRequestsAssociatedWithCommit: ( + issuesListLabelsForMilestone: ( { owner, repo, - commitSha, + milestoneNumber, ...query - }: ReposListPullRequestsAssociatedWithCommitParams, + }: IssuesListLabelsForMilestoneParams, params: RequestParams = {}, ) => - this.request< - ReposListPullRequestsAssociatedWithCommitData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, method: "GET", query: query, format: "json", @@ -61499,17 +60011,17 @@ export class Api< /** * No description * - * @tags repos - * @name ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags issues + * @name IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - reposListReleaseAssets: ( - { owner, repo, releaseId, ...query }: ReposListReleaseAssetsParams, + issuesListLabelsForRepo: ( + { owner, repo, ...query }: IssuesListLabelsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "GET", query: query, format: "json", @@ -61517,19 +60029,19 @@ export class Api< }), /** - * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + * No description * - * @tags repos - * @name ReposListReleases - * @summary List releases - * @request GET:/repos/{owner}/{repo}/releases + * @tags issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposListReleases: ( - { owner, repo, ...query }: ReposListReleasesParams, + issuesListLabelsOnIssue: ( + { owner, repo, issueNumber, ...query }: IssuesListLabelsOnIssueParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, method: "GET", query: query, format: "json", @@ -61539,17 +60051,17 @@ export class Api< /** * No description * - * @tags repos - * @name ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - reposListTags: ( - { owner, repo, ...query }: ReposListTagsParams, + issuesListMilestones: ( + { owner, repo, ...query }: IssuesListMilestonesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tags\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "GET", query: query, format: "json", @@ -61557,61 +60069,60 @@ export class Api< }), /** - * No description + * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags repos - * @name ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @tags issues + * @name IssuesLock + * @summary Lock an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - reposListTeams: ( - { owner, repo, ...query }: ReposListTeamsParams, + issuesLock: ( + { owner, repo, issueNumber }: IssuesLockParams, + data: IssuesLockPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/teams\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** * No description * - * @tags repos - * @name ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @tags issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposListWebhooks: ( - { owner, repo, ...query }: ReposListWebhooksParams, + issuesRemoveAllLabels: ( + { owner, repo, issueNumber }: IssuesRemoveAllLabelsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "DELETE", ...params, }), /** - * No description + * @description Removes one or more assignees from an issue. * - * @tags repos - * @name ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @tags issues + * @name IssuesRemoveAssignees + * @summary Remove assignees from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - reposMerge: ( - { owner, repo }: ReposMergeParams, - data: ReposMergePayload, + issuesRemoveAssignees: ( + { owner, repo, issueNumber }: IssuesRemoveAssigneesParams, + data: IssuesRemoveAssigneesPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/merges\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -61619,39 +60130,40 @@ export class Api< }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. * - * @tags repos - * @name ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @tags issues + * @name IssuesRemoveLabel + * @summary Remove a label from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} */ - reposPingWebhook: ( - { owner, repo, hookId }: ReposPingWebhookParams, + issuesRemoveLabel: ( + { owner, repo, issueNumber, name }: IssuesRemoveLabelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, + method: "DELETE", + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Removes any previous labels and sets the new labels for an issue. * - * @tags repos - * @name ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags issues + * @name IssuesSetLabels + * @summary Set labels for an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposRemoveAppAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveAppAccessRestrictionsParams, - data: ReposRemoveAppAccessRestrictionsPayload, + issuesSetLabels: ( + { owner, repo, issueNumber }: IssuesSetLabelsParams, + data: IssuesSetLabelsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -61659,42 +60171,48 @@ export class Api< }), /** - * No description + * @description Users with push access can unlock an issue's conversation. * - * @tags repos - * @name ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @tags issues + * @name IssuesUnlock + * @summary Unlock an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - reposRemoveCollaborator: ( - { owner, repo, username }: ReposRemoveCollaboratorParams, + issuesUnlock: ( + { owner, repo, issueNumber }: IssuesUnlockParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Issue owners and users with push access can edit an issue. * - * @tags repos - * @name ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags issues + * @name IssuesUpdate + * @summary Update an issue + * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} */ - reposRemoveStatusCheckContexts: ( - { owner, repo, branch }: ReposRemoveStatusCheckContextsParams, - data: ReposRemoveStatusCheckContextsPayload, + issuesUpdate: ( + { owner, repo, issueNumber }: IssuesUpdateParams, + data: IssuesUpdatePayload, params: RequestParams = {}, ) => this.request< - ReposRemoveStatusCheckContextsData, - BasicError | ValidationError + IssuesUpdateData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "DELETE", + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -61702,39 +60220,43 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * No description * - * @tags repos - * @name ReposRemoveStatusCheckProtection - * @summary Remove status check protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reposRemoveStatusCheckProtection: ( - { owner, repo, branch }: ReposRemoveStatusCheckProtectionParams, + issuesUpdateComment: ( + { owner, repo, commentId }: IssuesUpdateCommentParams, + data: IssuesUpdateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * No description * - * @tags repos - * @name ReposRemoveTeamAccessRestrictions - * @summary Remove team access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - reposRemoveTeamAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveTeamAccessRestrictionsParams, - data: ReposRemoveTeamAccessRestrictionsPayload, + issuesUpdateLabel: ( + { owner, repo, name }: IssuesUpdateLabelParams, + data: IssuesUpdateLabelPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -61742,21 +60264,21 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * No description * - * @tags repos - * @name ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags issues + * @name IssuesUpdateMilestone + * @summary Update a milestone + * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} */ - reposRemoveUserAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveUserAccessRestrictionsParams, - data: ReposRemoveUserAccessRestrictionsPayload, + issuesUpdateMilestone: ( + { owner, repo, milestoneNumber }: IssuesUpdateMilestoneParams, + data: IssuesUpdateMilestonePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -61764,111 +60286,140 @@ export class Api< }), /** - * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. + * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. * - * @tags repos - * @name ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @tags licenses + * @name LicensesGetForRepo + * @summary Get the license for a repository + * @request GET:/repos/{owner}/{repo}/license */ - reposRenameBranch: ( - { owner, repo, branch }: ReposRenameBranchParams, - data: ReposRenameBranchPayload, + licensesGetForRepo: ( + { owner, repo }: LicensesGetForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/license\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Stop an import for a repository. * - * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - reposReplaceAllTopics: ( - { owner, repo }: ReposReplaceAllTopicsParams, - data: ReposReplaceAllTopicsPayload, + migrationsCancelImport: ( + { owner, repo }: MigrationsCancelImportParams, params: RequestParams = {}, ) => - this.request< - ReposReplaceAllTopicsData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/topics\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "DELETE", + ...params, + }), + + /** + * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + * + * @tags migrations + * @name MigrationsGetCommitAuthors + * @summary Get commit authors + * @request GET:/repos/{owner}/{repo}/import/authors + */ + migrationsGetCommitAuthors: ( + { owner, repo, ...query }: MigrationsGetCommitAuthorsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. + * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. * - * @tags repos - * @name ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds + * @tags migrations + * @name MigrationsGetImportStatus + * @summary Get an import status + * @request GET:/repos/{owner}/{repo}/import */ - reposRequestPagesBuild: ( - { owner, repo }: ReposRequestPagesBuildParams, + migrationsGetImportStatus: ( + { owner, repo }: MigrationsGetImportStatusParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @description List files larger than 100MB found during the import * - * @tags repos - * @name ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags migrations + * @name MigrationsGetLargeFiles + * @summary Get large files + * @request GET:/repos/{owner}/{repo}/import/large_files */ - reposSetAdminBranchProtection: ( - { owner, repo, branch }: ReposSetAdminBranchProtectionParams, + migrationsGetLargeFiles: ( + { owner, repo }: MigrationsGetLargeFilesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/import/large_files\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. * - * @tags repos - * @name ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags migrations + * @name MigrationsMapCommitAuthor + * @summary Map a commit author + * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} */ - reposSetAppAccessRestrictions: ( - { owner, repo, branch }: ReposSetAppAccessRestrictionsParams, - data: ReposSetAppAccessRestrictionsPayload, + migrationsMapCommitAuthor: ( + { owner, repo, authorId }: MigrationsMapCommitAuthorParams, + data: MigrationsMapCommitAuthorPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "PUT", + this.request( + { + path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), + + /** + * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). + * + * @tags migrations + * @name MigrationsSetLfsPreference + * @summary Update Git LFS preference + * @request PATCH:/repos/{owner}/{repo}/import/lfs + */ + migrationsSetLfsPreference: ( + { owner, repo }: MigrationsSetLfsPreferenceParams, + data: MigrationsSetLfsPreferencePayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/import/lfs\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -61876,23 +60427,20 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Start a source import to a GitHub repository using GitHub Importer. * - * @tags repos - * @name ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags migrations + * @name MigrationsStartImport + * @summary Start an import + * @request PUT:/repos/{owner}/{repo}/import */ - reposSetStatusCheckContexts: ( - { owner, repo, branch }: ReposSetStatusCheckContextsParams, - data: ReposSetStatusCheckContextsPayload, + migrationsStartImport: ( + { owner, repo }: MigrationsStartImportParams, + data: MigrationsStartImportPayload, params: RequestParams = {}, ) => - this.request< - ReposSetStatusCheckContextsData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, method: "PUT", body: data, type: ContentType.Json, @@ -61901,21 +60449,21 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. * - * @tags repos - * @name ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags migrations + * @name MigrationsUpdateImport + * @summary Update an import + * @request PATCH:/repos/{owner}/{repo}/import */ - reposSetTeamAccessRestrictions: ( - { owner, repo, branch }: ReposSetTeamAccessRestrictionsParams, - data: ReposSetTeamAccessRestrictionsPayload, + migrationsUpdateImport: ( + { owner, repo }: MigrationsUpdateImportParams, + data: MigrationsUpdateImportPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -61923,21 +60471,24 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags repos - * @name ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags projects + * @name ProjectsCreateForRepo + * @summary Create a repository project + * @request POST:/repos/{owner}/{repo}/projects */ - reposSetUserAccessRestrictions: ( - { owner, repo, branch }: ReposSetUserAccessRestrictionsParams, - data: ReposSetUserAccessRestrictionsPayload, + projectsCreateForRepo: ( + { owner, repo }: ProjectsCreateForRepoParams, + data: ProjectsCreateForRepoPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "PUT", + this.request< + ProjectsCreateForRepoData, + BasicError | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/projects\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -61945,38 +60496,60 @@ export class Api< }), /** - * @description 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/:hook_id/test\` + * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags repos - * @name ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @tags projects + * @name ProjectsListForRepo + * @summary List repository projects + * @request GET:/repos/{owner}/{repo}/projects */ - reposTestPushWebhook: ( - { owner, repo, hookId }: ReposTestPushWebhookParams, + projectsListForRepo: ( + { owner, repo, ...query }: ProjectsListForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, - method: "POST", + this.request( + { + path: \`/repos/\${owner}/\${repo}/projects\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), + + /** + * No description + * + * @tags pulls + * @name PullsCheckIfMerged + * @summary Check if a pull request has been merged + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge + */ + pullsCheckIfMerged: ( + { owner, repo, pullNumber }: PullsCheckIfMergedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + method: "GET", ...params, }), /** - * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags repos - * @name ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @tags pulls + * @name PullsCreate + * @summary Create a pull request + * @request POST:/repos/{owner}/{repo}/pulls */ - reposTransfer: ( - { owner, repo }: ReposTransferParams, - data: ReposTransferPayload, + pullsCreate: ( + { owner, repo }: PullsCreateParams, + data: PullsCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/transfer\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, method: "POST", body: data, type: ContentType.Json, @@ -61985,21 +60558,26 @@ export class Api< }), /** - * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. + * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags repos - * @name ReposUpdate - * @summary Update a repository - * @request PATCH:/repos/{owner}/{repo} + * @tags pulls + * @name PullsCreateReplyForReviewComment + * @summary Create a reply for a review comment + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies */ - reposUpdate: ( - { owner, repo }: ReposUpdateParams, - data: ReposUpdatePayload, + pullsCreateReplyForReviewComment: ( + { + owner, + repo, + pullNumber, + commentId, + }: PullsCreateReplyForReviewCommentParams, + data: PullsCreateReplyForReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62007,29 +60585,21 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * - * @tags repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags pulls + * @name PullsCreateReview + * @summary Create a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - reposUpdateBranchProtection: ( - { owner, repo, branch }: ReposUpdateBranchProtectionParams, - data: ReposUpdateBranchProtectionPayload, + pullsCreateReview: ( + { owner, repo, pullNumber }: PullsCreateReviewParams, + data: PullsCreateReviewPayload, params: RequestParams = {}, ) => - this.request< - ReposUpdateBranchProtectionData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62037,21 +60607,21 @@ export class Api< }), /** - * No description + * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags repos - * @name ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @tags pulls + * @name PullsCreateReviewComment + * @summary Create a review comment for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - reposUpdateCommitComment: ( - { owner, repo, commentId }: ReposUpdateCommitCommentParams, - data: ReposUpdateCommitCommentPayload, + pullsCreateReviewComment: ( + { owner, repo, pullNumber }: PullsCreateReviewCommentParams, + data: PullsCreateReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62059,257 +60629,224 @@ export class Api< }), /** - * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). + * No description * - * @tags repos - * @name ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * @tags pulls + * @name PullsDeletePendingReview + * @summary Delete a pending review for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - reposUpdateInformationAboutPagesSite: ( - { owner, repo }: ReposUpdateInformationAboutPagesSiteParams, - data: ReposUpdateInformationAboutPagesSitePayload, + pullsDeletePendingReview: ( + { owner, repo, pullNumber, reviewId }: PullsDeletePendingReviewParams, params: RequestParams = {}, ) => this.request< - ReposUpdateInformationAboutPagesSiteData, - BasicError | ValidationError + PullsDeletePendingReviewData, + BasicError | ValidationErrorSimple >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "DELETE", + format: "json", ...params, }), /** - * No description + * @description Deletes a review comment. * - * @tags repos - * @name ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @tags pulls + * @name PullsDeleteReviewComment + * @summary Delete a review comment for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposUpdateInvitation: ( - { owner, repo, invitationId }: ReposUpdateInvitationParams, - data: ReposUpdateInvitationPayload, + pullsDeleteReviewComment: ( + { owner, repo, commentId }: PullsDeleteReviewCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. + * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. * - * @tags repos - * @name ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags pulls + * @name PullsDismissReview + * @summary Dismiss a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals */ - reposUpdatePullRequestReviewProtection: ( - { owner, repo, branch }: ReposUpdatePullRequestReviewProtectionParams, - data: ReposUpdatePullRequestReviewProtectionPayload, + pullsDismissReview: ( + { owner, repo, pullNumber, reviewId }: PullsDismissReviewParams, + data: PullsDismissReviewPayload, params: RequestParams = {}, ) => - this.request( - { - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), /** - * @description Users with push access to the repository can edit a release. + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * - * @tags repos - * @name ReposUpdateRelease - * @summary Update a release - * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + * @tags pulls + * @name PullsGet + * @summary Get a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} */ - reposUpdateRelease: ( - { owner, repo, releaseId }: ReposUpdateReleaseParams, - data: ReposUpdateReleasePayload, + pullsGet: ( + { owner, repo, pullNumber }: PullsGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + method: "GET", format: "json", ...params, }), /** - * @description Users with push access to the repository can edit a release asset. + * No description * - * @tags repos - * @name ReposUpdateReleaseAsset - * @summary Update a release asset - * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags pulls + * @name PullsGetReview + * @summary Get a review for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - reposUpdateReleaseAsset: ( - { owner, repo, assetId }: ReposUpdateReleaseAssetParams, - data: ReposUpdateReleaseAssetPayload, + pullsGetReview: ( + { owner, repo, pullNumber, reviewId }: PullsGetReviewParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + * @description Provides details for a review comment. * - * @tags repos - * @name ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags pulls + * @name PullsGetReviewComment + * @summary Get a review comment for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposUpdateStatusCheckProtection: ( - { owner, repo, branch }: ReposUpdateStatusCheckProtectionParams, - data: ReposUpdateStatusCheckProtectionPayload, + pullsGetReviewComment: ( + { owner, repo, commentId }: PullsGetReviewCommentParams, params: RequestParams = {}, ) => - this.request< - ReposUpdateStatusCheckProtectionData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags repos - * @name ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags pulls + * @name PullsList + * @summary List pull requests + * @request GET:/repos/{owner}/{repo}/pulls */ - reposUpdateWebhook: ( - { owner, repo, hookId }: ReposUpdateWebhookParams, - data: ReposUpdateWebhookPayload, + pullsList: ( + { owner, repo, ...query }: PullsListParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. + * @description List comments for a specific pull request review. * - * @tags repos - * @name ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @tags pulls + * @name PullsListCommentsForReview + * @summary List comments for a pull request review + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments */ - reposUpdateWebhookConfigForRepo: ( - { owner, repo, hookId }: ReposUpdateWebhookConfigForRepoParams, - data: ReposUpdateWebhookConfigForRepoPayload, + pullsListCommentsForReview: ( + { + owner, + repo, + pullNumber, + reviewId, + ...query + }: PullsListCommentsForReviewParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. * - * @tags repos - * @name ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags pulls + * @name PullsListCommits + * @summary List commits on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits */ - reposUploadReleaseAsset: ( - { owner, repo, releaseId, ...query }: ReposUploadReleaseAssetParams, - data: ReposUploadReleaseAssetPayload, + pullsListCommits: ( + { owner, repo, pullNumber, ...query }: PullsListCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + method: "GET", query: query, - body: data, format: "json", ...params, }), /** - * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. * - * @tags secret-scanning - * @name SecretScanningGetAlert - * @summary Get a secret scanning alert - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags pulls + * @name PullsListFiles + * @summary List pull requests files + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files */ - secretScanningGetAlert: ( - { owner, repo, alertNumber }: SecretScanningGetAlertParams, + pullsListFiles: ( + { owner, repo, pullNumber, ...query }: PullsListFilesParams, params: RequestParams = {}, ) => - this.request< - SecretScanningGetAlertData, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * No description * - * @tags secret-scanning - * @name SecretScanningListAlertsForRepo - * @summary List secret scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + * @tags pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - secretScanningListAlertsForRepo: ( - { owner, repo, ...query }: SecretScanningListAlertsForRepoParams, + pullsListRequestedReviewers: ( + { owner, repo, pullNumber, ...query }: PullsListRequestedReviewersParams, params: RequestParams = {}, ) => - this.request< - SecretScanningListAlertsForRepoData, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, method: "GET", query: query, format: "json", @@ -62317,209 +60854,198 @@ export class Api< }), /** - * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. + * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. * - * @tags secret-scanning - * @name SecretScanningUpdateAlert - * @summary Update a secret scanning alert - * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags pulls + * @name PullsListReviewComments + * @summary List review comments on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - secretScanningUpdateAlert: ( - { owner, repo, alertNumber }: SecretScanningUpdateAlertParams, - data: SecretScanningUpdateAlertPayload, + pullsListReviewComments: ( + { owner, repo, pullNumber, ...query }: PullsListReviewCommentsParams, params: RequestParams = {}, ) => - this.request< - SecretScanningUpdateAlertData, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + method: "GET", + query: query, format: "json", ...params, }), - }; - repositories = { + /** - * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. * - * @tags repos - * @name ReposListPublic - * @summary List public repositories - * @request GET:/repositories + * @tags pulls + * @name PullsListReviewCommentsForRepo + * @summary List review comments in a repository + * @request GET:/repos/{owner}/{repo}/pulls/comments */ - reposListPublic: ( - query: ReposListPublicParams, + pullsListReviewCommentsForRepo: ( + { owner, repo, ...query }: PullsListReviewCommentsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repositories\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments\`, method: "GET", query: query, format: "json", ...params, }), - }; - scim = { + /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description The list of reviews returns in chronological order. * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteScimGroupFromEnterprise - * @summary Delete a SCIM group from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags pulls + * @name PullsListReviews + * @summary List reviews for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - enterpriseAdminDeleteScimGroupFromEnterprise: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminDeleteScimGroupFromEnterpriseParams, + pullsListReviews: ( + { owner, repo, pullNumber, ...query }: PullsListReviewsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteUserFromEnterprise - * @summary Delete a SCIM user from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags pulls + * @name PullsMerge + * @summary Merge a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - enterpriseAdminDeleteUserFromEnterprise: ( - { enterprise, scimUserId }: EnterpriseAdminDeleteUserFromEnterpriseParams, + pullsMerge: ( + { owner, repo, pullNumber }: PullsMergeParams, + data: PullsMergePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * No description * - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup - * @summary Get SCIM provisioning information for an enterprise group - * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags pulls + * @name PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams, + pullsRemoveRequestedReviewers: ( + { owner, repo, pullNumber }: PullsRemoveRequestedReviewersParams, + data: PullsRemoveRequestedReviewersPayload, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser - * @summary Get SCIM provisioning information for an enterprise user - * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags pulls + * @name PullsRequestReviewers + * @summary Request reviewers for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams, + pullsRequestReviewers: ( + { owner, repo, pullNumber }: PullsRequestReviewersParams, + data: PullsRequestReviewersPayload, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminGetProvisioningInformationForEnterpriseUserData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * No description * - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedGroupsEnterprise - * @summary List provisioned SCIM groups for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Groups + * @tags pulls + * @name PullsSubmitReview + * @summary Submit a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events */ - enterpriseAdminListProvisionedGroupsEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListProvisionedGroupsEnterpriseParams, + pullsSubmitReview: ( + { owner, repo, pullNumber, reviewId }: PullsSubmitReviewParams, + data: PullsSubmitReviewPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. * - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedIdentitiesEnterprise - * @summary List SCIM provisioned identities for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Users + * @tags pulls + * @name PullsUpdate + * @summary Update a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} */ - enterpriseAdminListProvisionedIdentitiesEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListProvisionedIdentitiesEnterpriseParams, + pullsUpdate: ( + { owner, repo, pullNumber }: PullsUpdateParams, + data: PullsUpdatePayload, params: RequestParams = {}, ) => - this.request( - { - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup - * @summary Provision a SCIM enterprise group and invite users - * @request POST:/scim/v2/enterprises/{enterprise}/Groups + * @tags pulls + * @name PullsUpdateBranch + * @summary Update a pull request branch + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch */ - enterpriseAdminProvisionAndInviteEnterpriseGroup: ( - { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseGroupParams, - data: EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload, + pullsUpdateBranch: ( + { owner, repo, pullNumber }: PullsUpdateBranchParams, + data: PullsUpdateBranchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "POST", + this.request< + PullsUpdateBranchData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -62527,21 +61053,21 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + * @description Update the review summary comment with new text. * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseUser - * @summary Provision and invite a SCIM enterprise user - * @request POST:/scim/v2/enterprises/{enterprise}/Users + * @tags pulls + * @name PullsUpdateReview + * @summary Update a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - enterpriseAdminProvisionAndInviteEnterpriseUser: ( - { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseUserParams, - data: EnterpriseAdminProvisionAndInviteEnterpriseUserPayload, + pullsUpdateReview: ( + { owner, repo, pullNumber, reviewId }: PullsUpdateReviewParams, + data: PullsUpdateReviewPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -62549,27 +61075,21 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + * @description Enables you to edit a review comment. * - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup - * @summary Set SCIM information for a provisioned enterprise group - * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags pulls + * @name PullsUpdateReviewComment + * @summary Update a review comment for a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams, - data: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload, + pullsUpdateReviewComment: ( + { owner, repo, commentId }: PullsUpdateReviewCommentParams, + data: PullsUpdateReviewCommentPayload, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -62577,27 +61097,28 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. * - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser - * @summary Set SCIM information for a provisioned enterprise user - * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsCreateForCommitComment + * @summary Create reaction for a commit comment + * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams, - data: EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload, + reactionsCreateForCommitComment: ( + { owner, repo, commentId }: ReactionsCreateForCommitCommentParams, + data: ReactionsCreateForCommitCommentPayload, params: RequestParams = {}, ) => this.request< - EnterpriseAdminSetInformationForProvisionedEnterpriseUserData, - any + ReactionsCreateForCommitCommentData, + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PUT", + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62605,24 +61126,28 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup - * @summary Update an attribute for a SCIM enterprise group - * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags reactions + * @name ReactionsCreateForIssue + * @summary Create reaction for an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - enterpriseAdminUpdateAttributeForEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminUpdateAttributeForEnterpriseGroupParams, - data: EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload, + reactionsCreateForIssue: ( + { owner, repo, issueNumber }: ReactionsCreateForIssueParams, + data: ReactionsCreateForIssuePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PATCH", + this.request< + ReactionsCreateForIssueData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62630,24 +61155,28 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseUser - * @summary Update an attribute for a SCIM enterprise user - * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsCreateForIssueComment + * @summary Create reaction for an issue comment + * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - enterpriseAdminUpdateAttributeForEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminUpdateAttributeForEnterpriseUserParams, - data: EnterpriseAdminUpdateAttributeForEnterpriseUserPayload, + reactionsCreateForIssueComment: ( + { owner, repo, commentId }: ReactionsCreateForIssueCommentParams, + data: ReactionsCreateForIssueCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PATCH", + this.request< + ReactionsCreateForIssueCommentData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -62655,152 +61184,173 @@ export class Api< }), /** - * No description + * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. * - * @tags scim - * @name ScimDeleteUserFromOrg - * @summary Delete a SCIM user from an organization - * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsCreateForPullRequestReviewComment + * @summary Create reaction for a pull request review comment + * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - scimDeleteUserFromOrg: ( - { org, scimUserId }: ScimDeleteUserFromOrgParams, + reactionsCreateForPullRequestReviewComment: ( + { + owner, + repo, + commentId, + }: ReactionsCreateForPullRequestReviewCommentParams, + data: ReactionsCreateForPullRequestReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "DELETE", + this.request< + ReactionsCreateForPullRequestReviewCommentData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). * - * @tags scim - * @name ScimGetProvisioningInformationForUser - * @summary Get SCIM provisioning information for a user - * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsDeleteForCommitComment + * @summary Delete a commit comment reaction + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} */ - scimGetProvisioningInformationForUser: ( - { org, scimUserId }: ScimGetProvisioningInformationForUserParams, + reactionsDeleteForCommitComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForCommitCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). * - * @tags scim - * @name ScimListProvisionedIdentities - * @summary List SCIM provisioned identities - * @request GET:/scim/v2/organizations/{org}/Users + * @tags reactions + * @name ReactionsDeleteForIssue + * @summary Delete an issue reaction + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} */ - scimListProvisionedIdentities: ( - { org, ...query }: ScimListProvisionedIdentitiesParams, + reactionsDeleteForIssue: ( + { owner, repo, issueNumber, reactionId }: ReactionsDeleteForIssueParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description Provision organization membership for a user, and send an activation email to the email address. + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). * - * @tags scim - * @name ScimProvisionAndInviteUser - * @summary Provision and invite a SCIM user - * @request POST:/scim/v2/organizations/{org}/Users + * @tags reactions + * @name ReactionsDeleteForIssueComment + * @summary Delete an issue comment reaction + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} */ - scimProvisionAndInviteUser: ( - { org }: ScimProvisionAndInviteUserParams, - data: ScimProvisionAndInviteUserPayload, + reactionsDeleteForIssueComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForIssueCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). * - * @tags scim - * @name ScimSetInformationForProvisionedUser - * @summary Update a provisioned organization membership - * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsDeleteForPullRequestComment + * @summary Delete a pull request comment reaction + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} */ - scimSetInformationForProvisionedUser: ( - { org, scimUserId }: ScimSetInformationForProvisionedUserParams, - data: ScimSetInformationForProvisionedUserPayload, + reactionsDeleteForPullRequestComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForPullRequestCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). * - * @tags scim - * @name ScimUpdateAttributeForUser - * @summary Update an attribute for a SCIM user - * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags reactions + * @name ReactionsListForCommitComment + * @summary List reactions for a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - scimUpdateAttributeForUser: ( - { org, scimUserId }: ScimUpdateAttributeForUserParams, - data: ScimUpdateAttributeForUserPayload, + reactionsListForCommitComment: ( + { owner, repo, commentId, ...query }: ReactionsListForCommitCommentParams, params: RequestParams = {}, ) => this.request< - ScimUpdateAttributeForUserData, - ScimUpdateAttributeForUserError + ReactionsListForCommitCommentData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + method: "GET", + query: query, format: "json", ...params, }), - }; - search = { + /** - * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). * - * @tags search - * @name SearchCode - * @summary Search code - * @request GET:/search/code + * @tags reactions + * @name ReactionsListForIssue + * @summary List reactions for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - searchCode: (query: SearchCodeParams, params: RequestParams = {}) => + reactionsListForIssue: ( + { owner, repo, issueNumber, ...query }: ReactionsListForIssueParams, + params: RequestParams = {}, + ) => this.request< - SearchCodeData, + ReactionsListForIssueData, | BasicError - | ValidationError | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } >({ - path: \`/search/code\`, + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -62808,22 +61358,26 @@ export class Api< }), /** - * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` + * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). * - * @tags search - * @name SearchCommits - * @summary Search commits - * @request GET:/search/commits + * @tags reactions + * @name ReactionsListForIssueComment + * @summary List reactions for an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - searchCommits: (query: SearchCommitsParams, params: RequestParams = {}) => + reactionsListForIssueComment: ( + { owner, repo, commentId, ...query }: ReactionsListForIssueCommentParams, + params: RequestParams = {}, + ) => this.request< - SearchCommitsData, - { - documentation_url: string; - message: string; - } + ReactionsListForIssueCommentData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/search/commits\`, + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -62831,28 +61385,31 @@ export class Api< }), /** - * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). * - * @tags search - * @name SearchIssuesAndPullRequests - * @summary Search issues and pull requests - * @request GET:/search/issues + * @tags reactions + * @name ReactionsListForPullRequestReviewComment + * @summary List reactions for a pull request review comment + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - searchIssuesAndPullRequests: ( - query: SearchIssuesAndPullRequestsParams, + reactionsListForPullRequestReviewComment: ( + { + owner, + repo, + commentId, + ...query + }: ReactionsListForPullRequestReviewCommentParams, params: RequestParams = {}, ) => this.request< - SearchIssuesAndPullRequestsData, + ReactionsListForPullRequestReviewCommentData, | BasicError - | ValidationError | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } >({ - path: \`/search/issues\`, + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -62860,116 +61417,111 @@ export class Api< }), /** - * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags search - * @name SearchLabels - * @summary Search labels - * @request GET:/search/labels + * @tags repos + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - searchLabels: (query: SearchLabelsParams, params: RequestParams = {}) => - this.request({ - path: \`/search/labels\`, - method: "GET", - query: query, + reposAddAppAccessRestrictions: ( + { owner, repo, branch }: ReposAddAppAccessRestrictionsParams, + data: ReposAddAppAccessRestrictionsPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. * - * @tags search - * @name SearchRepos - * @summary Search repositories - * @request GET:/search/repositories + * @tags repos + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - searchRepos: (query: SearchReposParams, params: RequestParams = {}) => - this.request< - SearchReposData, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/repositories\`, - method: "GET", - query: query, + reposAddCollaborator: ( + { owner, repo, username }: ReposAddCollaboratorParams, + data: ReposAddCollaboratorPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags search - * @name SearchTopics - * @summary Search topics - * @request GET:/search/topics + * @tags repos + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - searchTopics: (query: SearchTopicsParams, params: RequestParams = {}) => + reposAddStatusCheckContexts: ( + { owner, repo, branch }: ReposAddStatusCheckContextsParams, + data: ReposAddStatusCheckContextsPayload, + params: RequestParams = {}, + ) => this.request< - SearchTopicsData, - { - documentation_url: string; - message: string; - } + ReposAddStatusCheckContextsData, + BasicError | ValidationError >({ - path: \`/search/topics\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags search - * @name SearchUsers - * @summary Search users - * @request GET:/search/users + * @tags repos + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - searchUsers: (query: SearchUsersParams, params: RequestParams = {}) => - this.request< - SearchUsersData, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/users\`, - method: "GET", - query: query, + reposAddTeamAccessRestrictions: ( + { owner, repo, branch }: ReposAddTeamAccessRestrictionsParams, + data: ReposAddTeamAccessRestrictionsPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), - }; - teams = { + /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentLegacy - * @summary Create reaction for a team discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @tags repos + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - reactionsCreateForTeamDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: ReactionsCreateForTeamDiscussionCommentLegacyParams, - data: ReactionsCreateForTeamDiscussionCommentLegacyPayload, + reposAddUserAccessRestrictions: ( + { owner, repo, branch }: ReposAddUserAccessRestrictionsParams, + data: ReposAddUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, method: "POST", body: data, type: ContentType.Json, @@ -62978,262 +61530,225 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionLegacy - * @summary Create reaction for a team discussion (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @tags repos + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} */ - reactionsCreateForTeamDiscussionLegacy: ( - { - teamId, - discussionNumber, - }: ReactionsCreateForTeamDiscussionLegacyParams, - data: ReactionsCreateForTeamDiscussionLegacyPayload, + reposCheckCollaborator: ( + { owner, repo, username }: ReposCheckCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "GET", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentLegacy - * @summary List reactions for a team discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @tags repos + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - reactionsListForTeamDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - ...query - }: ReactionsListForTeamDiscussionCommentLegacyParams, + reposCheckVulnerabilityAlerts: ( + { owner, repo }: ReposCheckVulnerabilityAlertsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags reactions - * @name ReactionsListForTeamDiscussionLegacy - * @summary List reactions for a team discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @tags repos + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - reactionsListForTeamDiscussionLegacy: ( - { - teamId, - discussionNumber, - ...query - }: ReactionsListForTeamDiscussionLegacyParams, + reposCompareCommits: ( + { owner, repo, base, head }: ReposCompareCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags teams - * @name TeamsAddMemberLegacy - * @summary Add team member (Legacy) - * @request PUT:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - teamsAddMemberLegacy: ( - { teamId, username }: TeamsAddMemberLegacyParams, + reposCreateCommitComment: ( + { owner, repo, commitSha }: ReposCreateCommitCommentParams, + data: ReposCreateCommitCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. * - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserLegacy - * @summary Add or update team membership for a user (Legacy) - * @request PUT:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - teamsAddOrUpdateMembershipForUserLegacy: ( - { teamId, username }: TeamsAddOrUpdateMembershipForUserLegacyParams, - data: TeamsAddOrUpdateMembershipForUserLegacyPayload, + reposCreateCommitSignatureProtection: ( + { owner, repo, branch }: ReposCreateCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateMembershipForUserLegacyData, - TeamsAddOrUpdateMembershipForUserLegacyError - >({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "POST", format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. + * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsLegacy - * @summary Add or update team project permissions (Legacy) - * @request PUT:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - teamsAddOrUpdateProjectPermissionsLegacy: ( - { teamId, projectId }: TeamsAddOrUpdateProjectPermissionsLegacyParams, - data: TeamsAddOrUpdateProjectPermissionsLegacyPayload, + reposCreateCommitStatus: ( + { owner, repo, sha }: ReposCreateCommitStatusParams, + data: ReposCreateCommitStatusPayload, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateProjectPermissionsLegacyData, - TeamsAddOrUpdateProjectPermissionsLegacyError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsLegacy - * @summary Add or update team repository permissions (Legacy) - * @request PUT:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @description You can create a read-only deploy key. + * + * @tags repos + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys */ - teamsAddOrUpdateRepoPermissionsLegacy: ( - { teamId, owner, repo }: TeamsAddOrUpdateRepoPermissionsLegacyParams, - data: TeamsAddOrUpdateRepoPermissionsLegacyPayload, + reposCreateDeployKey: ( + { owner, repo }: ReposCreateDeployKeyParams, + data: ReposCreateDeployKeyPayload, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateRepoPermissionsLegacyData, - BasicError | ValidationError - >({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. + * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. * - * @tags teams - * @name TeamsCheckPermissionsForProjectLegacy - * @summary Check team permissions for a project (Legacy) - * @request GET:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - teamsCheckPermissionsForProjectLegacy: ( - { teamId, projectId }: TeamsCheckPermissionsForProjectLegacyParams, + reposCreateDeployment: ( + { owner, repo }: ReposCreateDeploymentParams, + data: ReposCreateDeploymentPayload, params: RequestParams = {}, ) => - this.request< - TeamsCheckPermissionsForProjectLegacyData, - void | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. * - * @tags teams - * @name TeamsCheckPermissionsForRepoLegacy - * @summary Check team permissions for a repository (Legacy) - * @request GET:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - teamsCheckPermissionsForRepoLegacy: ( - { teamId, owner, repo }: TeamsCheckPermissionsForRepoLegacyParams, + reposCreateDeploymentStatus: ( + { owner, repo, deploymentId }: ReposCreateDeploymentStatusParams, + data: ReposCreateDeploymentStatusPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. * - * @tags teams - * @name TeamsCreateDiscussionCommentLegacy - * @summary Create a discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags repos + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches */ - teamsCreateDiscussionCommentLegacy: ( - { teamId, discussionNumber }: TeamsCreateDiscussionCommentLegacyParams, - data: TeamsCreateDiscussionCommentLegacyPayload, + reposCreateDispatchEvent: ( + { owner, repo }: ReposCreateDispatchEventParams, + data: ReposCreateDispatchEventPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/dispatches\`, method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). * - * @tags teams - * @name TeamsCreateDiscussionLegacy - * @summary Create a discussion (Legacy) - * @request POST:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - teamsCreateDiscussionLegacy: ( - { teamId }: TeamsCreateDiscussionLegacyParams, - data: TeamsCreateDiscussionLegacyPayload, + reposCreateFork: ( + { owner, repo }: ReposCreateForkParams, + data: ReposCreateForkPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, method: "POST", body: data, type: ContentType.Json, @@ -63242,25 +61757,24 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. + * @description Creates a new file or replaces an existing file in a repository. * - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy - * @summary Create or update IdP group connections (Legacy) - * @request PATCH:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags repos + * @name ReposCreateOrUpdateFileContents + * @summary Create or update file contents + * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( - { teamId }: TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams, - data: TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload, + reposCreateOrUpdateFileContents: ( + { owner, repo, path }: ReposCreateOrUpdateFileContentsParams, + data: ReposCreateOrUpdateFileContentsPayload, params: RequestParams = {}, ) => this.request< - TeamsCreateOrUpdateIdpGroupConnectionsLegacyData, + ReposCreateOrUpdateFileContentsData, BasicError | ValidationError >({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "PATCH", + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -63268,715 +61782,680 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * - * @tags teams - * @name TeamsDeleteDiscussionCommentLegacy - * @summary Delete a discussion comment (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - teamsDeleteDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsDeleteDiscussionCommentLegacyParams, + reposCreatePagesSite: ( + { owner, repo }: ReposCreatePagesSiteParams, + data: ReposCreatePagesSitePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", + this.request< + ReposCreatePagesSiteData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags teams - * @name TeamsDeleteDiscussionLegacy - * @summary Delete a discussion (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - teamsDeleteDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsDeleteDiscussionLegacyParams, + reposCreateRelease: ( + { owner, repo }: ReposCreateReleaseParams, + data: ReposCreateReleasePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository * - * @tags teams - * @name TeamsDeleteLegacy - * @summary Delete a team (Legacy) - * @request DELETE:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - teamsDeleteLegacy: ( - { teamId }: TeamsDeleteLegacyParams, + reposCreateUsingTemplate: ( + { templateOwner, templateRepo }: ReposCreateUsingTemplateParams, + data: ReposCreateUsingTemplatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. * - * @tags teams - * @name TeamsGetDiscussionCommentLegacy - * @summary Get a discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - teamsGetDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsGetDiscussionCommentLegacyParams, + reposCreateWebhook: ( + { owner, repo }: ReposCreateWebhookParams, + data: ReposCreateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. * - * @tags teams - * @name TeamsGetDiscussionLegacy - * @summary Get a discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - teamsGetDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsGetDiscussionLegacyParams, + reposDelete: ( + { owner, repo }: ReposDeleteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. * - * @tags teams - * @name TeamsGetLegacy - * @summary Get a team (Legacy) - * @request GET:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposDeleteAccessRestrictions + * @summary Delete access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - teamsGetLegacy: ( - { teamId }: TeamsGetLegacyParams, + reposDeleteAccessRestrictions: ( + { owner, repo, branch }: ReposDeleteAccessRestrictionsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + method: "DELETE", ...params, }), /** - * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * - * @tags teams - * @name TeamsGetMemberLegacy - * @summary Get team member (Legacy) - * @request GET:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - teamsGetMemberLegacy: ( - { teamId, username }: TeamsGetMemberLegacyParams, + reposDeleteAdminBranchProtection: ( + { owner, repo, branch }: ReposDeleteAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags teams - * @name TeamsGetMembershipForUserLegacy - * @summary Get team membership for a user (Legacy) - * @request GET:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - teamsGetMembershipForUserLegacy: ( - { teamId, username }: TeamsGetMembershipForUserLegacyParams, + reposDeleteBranchProtection: ( + { owner, repo, branch }: ReposDeleteBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. + * No description * - * @tags teams - * @name TeamsListChildLegacy - * @summary List child teams (Legacy) - * @request GET:/teams/{team_id}/teams - * @deprecated + * @tags repos + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - teamsListChildLegacy: ( - { teamId, ...query }: TeamsListChildLegacyParams, + reposDeleteCommitComment: ( + { owner, repo, commentId }: ReposDeleteCommitCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/teams\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. * - * @tags teams - * @name TeamsListDiscussionCommentsLegacy - * @summary List discussion comments (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags repos + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - teamsListDiscussionCommentsLegacy: ( - { - teamId, - discussionNumber, - ...query - }: TeamsListDiscussionCommentsLegacyParams, + reposDeleteCommitSignatureProtection: ( + { owner, repo, branch }: ReposDeleteCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. * - * @tags teams - * @name TeamsListDiscussionsLegacy - * @summary List discussions (Legacy) - * @request GET:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} */ - teamsListDiscussionsLegacy: ( - { teamId, ...query }: TeamsListDiscussionsLegacyParams, + reposDeleteDeployKey: ( + { owner, repo, keyId }: ReposDeleteDeployKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. + * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." * - * @tags teams - * @name TeamsListIdpGroupsForLegacy - * @summary List IdP groups for a team (Legacy) - * @request GET:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags repos + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} */ - teamsListIdpGroupsForLegacy: ( - { teamId }: TeamsListIdpGroupsForLegacyParams, + reposDeleteDeployment: ( + { owner, repo, deploymentId }: ReposDeleteDeploymentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "GET", - format: "json", + this.request< + ReposDeleteDeploymentData, + BasicError | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. * - * @tags teams - * @name TeamsListMembersLegacy - * @summary List team members (Legacy) - * @request GET:/teams/{team_id}/members - * @deprecated + * @tags repos + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - teamsListMembersLegacy: ( - { teamId, ...query }: TeamsListMembersLegacyParams, + reposDeleteFile: ( + { owner, repo, path }: ReposDeleteFileParams, + data: ReposDeleteFilePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members\`, - method: "GET", - query: query, + this.request< + ReposDeleteFileData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * No description * - * @tags teams - * @name TeamsListPendingInvitationsLegacy - * @summary List pending team invitations (Legacy) - * @request GET:/teams/{team_id}/invitations - * @deprecated + * @tags repos + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - teamsListPendingInvitationsLegacy: ( - { teamId, ...query }: TeamsListPendingInvitationsLegacyParams, + reposDeleteInvitation: ( + { owner, repo, invitationId }: ReposDeleteInvitationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. + * No description * - * @tags teams - * @name TeamsListProjectsLegacy - * @summary List team projects (Legacy) - * @request GET:/teams/{team_id}/projects - * @deprecated + * @tags repos + * @name ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages */ - teamsListProjectsLegacy: ( - { teamId, ...query }: TeamsListProjectsLegacyParams, + reposDeletePagesSite: ( + { owner, repo }: ReposDeletePagesSiteParams, params: RequestParams = {}, ) => this.request< - TeamsListProjectsLegacyData, + ReposDeletePagesSiteData, | BasicError | { documentation_url: string; message: string; } + | ValidationError >({ - path: \`/teams/\${teamId}/projects\`, - method: "GET", - query: query, - format: "json", + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags teams - * @name TeamsListReposLegacy - * @summary List team repositories (Legacy) - * @request GET:/teams/{team_id}/repos - * @deprecated + * @tags repos + * @name ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - teamsListReposLegacy: ( - { teamId, ...query }: TeamsListReposLegacyParams, + reposDeletePullRequestReviewProtection: ( + { owner, repo, branch }: ReposDeletePullRequestReviewProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "DELETE", ...params, }), /** - * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * @description Users with push access to the repository can delete a release. * - * @tags teams - * @name TeamsRemoveMemberLegacy - * @summary Remove team member (Legacy) - * @request DELETE:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - teamsRemoveMemberLegacy: ( - { teamId, username }: TeamsRemoveMemberLegacyParams, + reposDeleteRelease: ( + { owner, repo, releaseId }: ReposDeleteReleaseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * No description * - * @tags teams - * @name TeamsRemoveMembershipForUserLegacy - * @summary Remove team membership for a user (Legacy) - * @request DELETE:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - teamsRemoveMembershipForUserLegacy: ( - { teamId, username }: TeamsRemoveMembershipForUserLegacyParams, + reposDeleteReleaseAsset: ( + { owner, repo, assetId }: ReposDeleteReleaseAssetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + * No description * - * @tags teams - * @name TeamsRemoveProjectLegacy - * @summary Remove a project from a team (Legacy) - * @request DELETE:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - teamsRemoveProjectLegacy: ( - { teamId, projectId }: TeamsRemoveProjectLegacyParams, + reposDeleteWebhook: ( + { owner, repo, hookId }: ReposDeleteWebhookParams, params: RequestParams = {}, ) => - this.request< - TeamsRemoveProjectLegacyData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". * - * @tags teams - * @name TeamsRemoveRepoLegacy - * @summary Remove a repository from a team (Legacy) - * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes */ - teamsRemoveRepoLegacy: ( - { teamId, owner, repo }: TeamsRemoveRepoLegacyParams, + reposDisableAutomatedSecurityFixes: ( + { owner, repo }: ReposDisableAutomatedSecurityFixesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags teams - * @name TeamsUpdateDiscussionCommentLegacy - * @summary Update a discussion comment (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - teamsUpdateDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsUpdateDiscussionCommentLegacyParams, - data: TeamsUpdateDiscussionCommentLegacyPayload, + reposDisableVulnerabilityAlerts: ( + { owner, repo }: ReposDisableVulnerabilityAlertsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. * - * @tags teams - * @name TeamsUpdateDiscussionLegacy - * @summary Update a discussion (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - teamsUpdateDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsUpdateDiscussionLegacyParams, - data: TeamsUpdateDiscussionLegacyPayload, + reposDownloadTarballArchive: ( + { owner, repo, ref }: ReposDownloadTarballArchiveParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, + method: "GET", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. + * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. * - * @tags teams - * @name TeamsUpdateLegacy - * @summary Update a team (Legacy) - * @request PATCH:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - teamsUpdateLegacy: ( - { teamId }: TeamsUpdateLegacyParams, - data: TeamsUpdateLegacyPayload, + reposDownloadZipballArchive: ( + { owner, repo, ref }: ReposDownloadZipballArchiveParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + method: "GET", ...params, }), - }; - user = { + /** - * No description + * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". * - * @tags activity - * @name ActivityCheckRepoIsStarredByAuthenticatedUser - * @summary Check if a repository is starred by the authenticated user - * @request GET:/user/starred/{owner}/{repo} + * @tags repos + * @name ReposEnableAutomatedSecurityFixes + * @summary Enable automated security fixes + * @request PUT:/repos/{owner}/{repo}/automated-security-fixes */ - activityCheckRepoIsStarredByAuthenticatedUser: ( - { owner, repo }: ActivityCheckRepoIsStarredByAuthenticatedUserParams, + reposEnableAutomatedSecurityFixes: ( + { owner, repo }: ReposEnableAutomatedSecurityFixesParams, params: RequestParams = {}, ) => - this.request< - ActivityCheckRepoIsStarredByAuthenticatedUserData, - ActivityCheckRepoIsStarredByAuthenticatedUserError - >({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "PUT", ...params, }), /** - * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags activity - * @name ActivityListReposStarredByAuthenticatedUser - * @summary List repositories starred by the authenticated user - * @request GET:/user/starred + * @tags repos + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - activityListReposStarredByAuthenticatedUser: ( - query: ActivityListReposStarredByAuthenticatedUserParams, + reposEnableVulnerabilityAlerts: ( + { owner, repo }: ReposEnableVulnerabilityAlertsParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/user/starred\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + method: "PUT", + ...params, + }), /** - * @description Lists repositories the authenticated user is watching. + * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. * - * @tags activity - * @name ActivityListWatchedReposForAuthenticatedUser - * @summary List repositories watched by the authenticated user - * @request GET:/user/subscriptions + * @tags repos + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} */ - activityListWatchedReposForAuthenticatedUser: ( - query: ActivityListWatchedReposForAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request< - ActivityListWatchedReposForAuthenticatedUserData, - BasicError - >({ - path: \`/user/subscriptions\`, + reposGet: ({ owner, repo }: ReposGetParams, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. * - * @tags activity - * @name ActivityStarRepoForAuthenticatedUser - * @summary Star a repository for the authenticated user - * @request PUT:/user/starred/{owner}/{repo} + * @tags repos + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - activityStarRepoForAuthenticatedUser: ( - { owner, repo }: ActivityStarRepoForAuthenticatedUserParams, + reposGetAccessRestrictions: ( + { owner, repo, branch }: ReposGetAccessRestrictionsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @tags repos + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - activityUnstarRepoForAuthenticatedUser: ( - { owner, repo }: ActivityUnstarRepoForAuthenticatedUserParams, + reposGetAdminBranchProtection: ( + { owner, repo, branch }: ReposGetAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "GET", + format: "json", ...params, }), /** - * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags apps - * @name AppsAddRepoToInstallation - * @summary Add a repository to an app installation - * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + * @tags repos + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - appsAddRepoToInstallation: ( - { installationId, repositoryId }: AppsAddRepoToInstallationParams, + reposGetAllStatusCheckContexts: ( + { owner, repo, branch }: ReposGetAllStatusCheckContextsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "GET", + format: "json", ...params, }), /** - * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. + * No description * - * @tags apps - * @name AppsListInstallationReposForAuthenticatedUser - * @summary List repositories accessible to the user access token - * @request GET:/user/installations/{installation_id}/repositories + * @tags repos + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - appsListInstallationReposForAuthenticatedUser: ( - { - installationId, - ...query - }: AppsListInstallationReposForAuthenticatedUserParams, + reposGetAllTopics: ( + { owner, repo }: ReposGetAllTopicsParams, params: RequestParams = {}, ) => this.request< - AppsListInstallationReposForAuthenticatedUserData, - BasicError + ReposGetAllTopicsData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/user/installations/\${installationId}/repositories\`, + path: \`/repos/\${owner}/\${repo}/topics\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. * - * @tags apps - * @name AppsListInstallationsForAuthenticatedUser - * @summary List app installations accessible to the user access token - * @request GET:/user/installations + * @tags repos + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - appsListInstallationsForAuthenticatedUser: ( - query: AppsListInstallationsForAuthenticatedUserParams, + reposGetAppsWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetAppsWithAccessToProtectedBranchParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} + */ + reposGetBranch: ( + { owner, repo, branch }: ReposGetBranchParams, params: RequestParams = {}, ) => this.request< - AppsListInstallationsForAuthenticatedUserData, + ReposGetBranchData, | BasicError | { documentation_url: string; message: string; } >({ - path: \`/user/installations\`, + path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUser - * @summary List subscriptions for the authenticated user - * @request GET:/user/marketplace_purchases + * @tags repos + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - appsListSubscriptionsForAuthenticatedUser: ( - query: AppsListSubscriptionsForAuthenticatedUserParams, + reposGetBranchProtection: ( + { owner, repo, branch }: ReposGetBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/marketplace_purchases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. * - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUserStubbed - * @summary List subscriptions for the authenticated user (stubbed) - * @request GET:/user/marketplace_purchases/stubbed + * @tags repos + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones */ - appsListSubscriptionsForAuthenticatedUserStubbed: ( - query: AppsListSubscriptionsForAuthenticatedUserStubbedParams, + reposGetClones: ( + { owner, repo, ...query }: ReposGetClonesParams, params: RequestParams = {}, ) => - this.request< - AppsListSubscriptionsForAuthenticatedUserStubbedData, - BasicError - >({ - path: \`/user/marketplace_purchases/stubbed\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/clones\`, method: "GET", query: query, format: "json", @@ -63984,156 +62463,171 @@ export class Api< }), /** - * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. * - * @tags apps - * @name AppsRemoveRepoFromInstallation - * @summary Remove a repository from an app installation - * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + * @tags repos + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - appsRemoveRepoFromInstallation: ( - { installationId, repositoryId }: AppsRemoveRepoFromInstallationParams, + reposGetCodeFrequencyStats: ( + { owner, repo }: ReposGetCodeFrequencyStatsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + method: "GET", + format: "json", ...params, }), /** - * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. + * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. * - * @tags interactions - * @name InteractionsGetRestrictionsForAuthenticatedUser - * @summary Get interaction restrictions for your public repositories - * @request GET:/user/interaction-limits + * @tags repos + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - interactionsGetRestrictionsForAuthenticatedUser: ( + reposGetCollaboratorPermissionLevel: ( + { owner, repo, username }: ReposGetCollaboratorPermissionLevelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, method: "GET", format: "json", ...params, }), /** - * @description Removes any interaction restrictions from your public repositories. + * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` * - * @tags interactions - * @name InteractionsRemoveRestrictionsForAuthenticatedUser - * @summary Remove interaction restrictions from your public repositories - * @request DELETE:/user/interaction-limits + * @tags repos + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - interactionsRemoveRestrictionsForAuthenticatedUser: ( + reposGetCombinedStatusForRef: ( + { owner, repo, ref }: ReposGetCombinedStatusForRefParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * + * @tags repos + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} + */ + reposGetCommit: ( + { owner, repo, ref }: ReposGetCommitParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/user/interaction-limits\`, - method: "DELETE", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, + method: "GET", + format: "json", + ...params, + }), /** - * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. * - * @tags interactions - * @name InteractionsSetRestrictionsForAuthenticatedUser - * @summary Set interaction restrictions for your public repositories - * @request PUT:/user/interaction-limits + * @tags repos + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - interactionsSetRestrictionsForAuthenticatedUser: ( - data: InteractionLimit, + reposGetCommitActivityStats: ( + { owner, repo }: ReposGetCommitActivityStatsParams, params: RequestParams = {}, ) => - this.request< - InteractionsSetRestrictionsForAuthenticatedUserData, - ValidationError - >({ - path: \`/user/interaction-limits\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + method: "GET", format: "json", ...params, }), /** - * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * No description * - * @tags issues - * @name IssuesListForAuthenticatedUser - * @summary List user account issues assigned to the authenticated user - * @request GET:/user/issues + * @tags repos + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - issuesListForAuthenticatedUser: ( - query: IssuesListForAuthenticatedUserParams, + reposGetCommitComment: ( + { owner, repo, commentId }: ReposGetCommitCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/issues\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. * - * @tags migrations - * @name MigrationsDeleteArchiveForAuthenticatedUser - * @summary Delete a user migration archive - * @request DELETE:/user/migrations/{migration_id}/archive + * @tags repos + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - migrationsDeleteArchiveForAuthenticatedUser: ( - { migrationId }: MigrationsDeleteArchiveForAuthenticatedUserParams, + reposGetCommitSignatureProtection: ( + { owner, repo, branch }: ReposGetCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/user/migrations/\${migrationId}/archive\`, - method: "DELETE", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "GET", + format: "json", + ...params, + }), /** - * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. + * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. * - * @tags migrations - * @name MigrationsGetArchiveForAuthenticatedUser - * @summary Download a user migration archive - * @request GET:/user/migrations/{migration_id}/archive + * @tags repos + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - migrationsGetArchiveForAuthenticatedUser: ( - { migrationId }: MigrationsGetArchiveForAuthenticatedUserParams, + reposGetCommunityProfileMetrics: ( + { owner, repo }: ReposGetCommunityProfileMetricsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/archive\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/profile\`, method: "GET", + format: "json", ...params, }), /** - * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. * - * @tags migrations - * @name MigrationsGetStatusForAuthenticatedUser - * @summary Get a user migration status - * @request GET:/user/migrations/{migration_id} + * @tags repos + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} */ - migrationsGetStatusForAuthenticatedUser: ( - { migrationId, ...query }: MigrationsGetStatusForAuthenticatedUserParams, + reposGetContent: ( + { owner, repo, path, ...query }: ReposGetContentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "GET", query: query, format: "json", @@ -64141,122 +62635,122 @@ export class Api< }), /** - * @description Lists all migrations a user has started. + * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits * - * @tags migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * @tags repos + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors */ - migrationsListForAuthenticatedUser: ( - query: MigrationsListForAuthenticatedUserParams, + reposGetContributorsStats: ( + { owner, repo }: ReposGetContributorsStatsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists all the repositories for this user migration. + * No description * - * @tags migrations - * @name MigrationsListReposForUser - * @summary List repositories for a user migration - * @request GET:/user/migrations/{migration_id}/repositories + * @tags repos + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} */ - migrationsListReposForUser: ( - { migrationId, ...query }: MigrationsListReposForUserParams, + reposGetDeployKey: ( + { owner, repo, keyId }: ReposGetDeployKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Initiates the generation of a user migration archive. + * No description * - * @tags migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @tags repos + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} */ - migrationsStartForAuthenticatedUser: ( - data: MigrationsStartForAuthenticatedUserPayload, + reposGetDeployment: ( + { owner, repo, deploymentId }: ReposGetDeploymentParams, params: RequestParams = {}, ) => - this.request< - MigrationsStartForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/migrations\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. + * @description Users with pull access can view a deployment status for a deployment: * - * @tags migrations - * @name MigrationsUnlockRepoForAuthenticatedUser - * @summary Unlock a user repository - * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + * @tags repos + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - migrationsUnlockRepoForAuthenticatedUser: ( - { migrationId, repoName }: MigrationsUnlockRepoForAuthenticatedUserParams, + reposGetDeploymentStatus: ( + { owner, repo, deploymentId, statusId }: ReposGetDeploymentStatusParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", + this.request< + ReposGetDeploymentStatusData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, + method: "GET", + format: "json", ...params, }), /** * No description * - * @tags orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @tags repos + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - orgsGetMembershipForAuthenticatedUser: ( - { org }: OrgsGetMembershipForAuthenticatedUserParams, + reposGetLatestPagesBuild: ( + { owner, repo }: ReposGetLatestPagesBuildParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, method: "GET", format: "json", ...params, }), /** - * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. + * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. * - * @tags orgs - * @name OrgsListForAuthenticatedUser - * @summary List organizations for the authenticated user - * @request GET:/user/orgs + * @tags repos + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest */ - orgsListForAuthenticatedUser: ( - query: OrgsListForAuthenticatedUserParams, + reposGetLatestRelease: ( + { owner, repo }: ReposGetLatestReleaseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/orgs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/latest\`, method: "GET", - query: query, format: "json", ...params, }), @@ -64264,22 +62758,18 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @tags repos + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - orgsListMembershipsForAuthenticatedUser: ( - query: OrgsListMembershipsForAuthenticatedUserParams, + reposGetPages: ( + { owner, repo }: ReposGetPagesParams, params: RequestParams = {}, ) => - this.request< - OrgsListMembershipsForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/memberships/orgs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages\`, method: "GET", - query: query, format: "json", ...params, }), @@ -64287,477 +62777,456 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} + * @tags repos + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - orgsUpdateMembershipForAuthenticatedUser: ( - { org }: OrgsUpdateMembershipForAuthenticatedUserParams, - data: OrgsUpdateMembershipForAuthenticatedUserPayload, + reposGetPagesBuild: ( + { owner, repo, buildId }: ReposGetPagesBuildParams, params: RequestParams = {}, ) => - this.request< - OrgsUpdateMembershipForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/memberships/orgs/\${org}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. * - * @tags projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @tags repos + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation */ - projectsCreateForAuthenticatedUser: ( - data: ProjectsCreateForAuthenticatedUserPayload, + reposGetParticipationStats: ( + { owner, repo }: ReposGetParticipationStatsParams, params: RequestParams = {}, ) => - this.request< - ProjectsCreateForAuthenticatedUserData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationErrorSimple - >({ - path: \`/user/projects\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/participation\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * @tags repos - * @name ReposAcceptInvitation - * @summary Accept a repository invitation - * @request PATCH:/user/repository_invitations/{invitation_id} + * @name ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - reposAcceptInvitation: ( - { invitationId }: ReposAcceptInvitationParams, + reposGetPullRequestReviewProtection: ( + { owner, repo, branch }: ReposGetPullRequestReviewProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "GET", + format: "json", ...params, }), /** - * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description 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. * * @tags repos - * @name ReposCreateForAuthenticatedUser - * @summary Create a repository for the authenticated user - * @request POST:/user/repos + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - reposCreateForAuthenticatedUser: ( - data: ReposCreateForAuthenticatedUserPayload, + reposGetPunchCardStats: ( + { owner, repo }: ReposGetPunchCardStatsParams, params: RequestParams = {}, ) => - this.request< - ReposCreateForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/repos\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. * * @tags repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - reposDeclineInvitation: ( - { invitationId }: ReposDeclineInvitationParams, + reposGetReadme: ( + { owner, repo, ...query }: ReposGetReadmeParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/readme\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). * * @tags repos - * @name ReposListForAuthenticatedUser - * @summary List repositories for the authenticated user - * @request GET:/user/repos + * @name ReposGetRelease + * @summary Get a release + * @request GET:/repos/{owner}/{repo}/releases/{release_id} */ - reposListForAuthenticatedUser: ( - query: ReposListForAuthenticatedUserParams, + reposGetRelease: ( + { owner, repo, releaseId }: ReposGetReleaseParams, params: RequestParams = {}, ) => - this.request< - ReposListForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/repos\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. * * @tags repos - * @name ReposListInvitationsForAuthenticatedUser - * @summary List repository invitations for the authenticated user - * @request GET:/user/repository_invitations + * @name ReposGetReleaseAsset + * @summary Get a release asset + * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - reposListInvitationsForAuthenticatedUser: ( - query: ReposListInvitationsForAuthenticatedUserParams, + reposGetReleaseAsset: ( + { owner, repo, assetId }: ReposGetReleaseAssetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations\`, + this.request< + ReposGetReleaseAssetData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). + * @description Get a published release with the specified tag. * - * @tags teams - * @name TeamsListForAuthenticatedUser - * @summary List teams for the authenticated user - * @request GET:/user/teams + * @tags repos + * @name ReposGetReleaseByTag + * @summary Get a release by tag name + * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} */ - teamsListForAuthenticatedUser: ( - query: TeamsListForAuthenticatedUserParams, + reposGetReleaseByTag: ( + { owner, repo, tag }: ReposGetReleaseByTagParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/teams\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags users - * @name UsersAddEmailForAuthenticated - * @summary Add an email address for the authenticated user - * @request POST:/user/emails + * @tags repos + * @name ReposGetStatusChecksProtection + * @summary Get status checks protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - usersAddEmailForAuthenticated: ( - data: UsersAddEmailForAuthenticatedPayload, + reposGetStatusChecksProtection: ( + { owner, repo, branch }: ReposGetStatusChecksProtectionParams, params: RequestParams = {}, ) => - this.request< - UsersAddEmailForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/emails\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. * - * @tags users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} + * @tags repos + * @name ReposGetTeamsWithAccessToProtectedBranch + * @summary Get teams with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - usersBlock: ({ username }: UsersBlockParams, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "PUT", + reposGetTeamsWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetTeamsWithAccessToProtectedBranchParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @description Get the top 10 popular contents over the last 14 days. * - * @tags users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} + * @tags repos + * @name ReposGetTopPaths + * @summary Get top referral paths + * @request GET:/repos/{owner}/{repo}/traffic/popular/paths */ - usersCheckBlocked: ( - { username }: UsersCheckBlockedParams, + reposGetTopPaths: ( + { owner, repo }: ReposGetTopPathsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/blocks/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, method: "GET", + format: "json", ...params, }), /** - * No description + * @description Get the top 10 referrers over the last 14 days. * - * @tags users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @tags repos + * @name ReposGetTopReferrers + * @summary Get top referral sources + * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers */ - usersCheckPersonIsFollowedByAuthenticated: ( - { username }: UsersCheckPersonIsFollowedByAuthenticatedParams, + reposGetTopReferrers: ( + { owner, repo }: ReposGetTopReferrersParams, params: RequestParams = {}, ) => - this.request< - UsersCheckPersonIsFollowedByAuthenticatedData, - UsersCheckPersonIsFollowedByAuthenticatedError - >({ - path: \`/user/following/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, method: "GET", + format: "json", ...params, }), /** - * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. * - * @tags users - * @name UsersCreateGpgKeyForAuthenticated - * @summary Create a GPG key for the authenticated user - * @request POST:/user/gpg_keys + * @tags repos + * @name ReposGetUsersWithAccessToProtectedBranch + * @summary Get users with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - usersCreateGpgKeyForAuthenticated: ( - data: UsersCreateGpgKeyForAuthenticatedPayload, + reposGetUsersWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetUsersWithAccessToProtectedBranchParams, params: RequestParams = {}, ) => - this.request< - UsersCreateGpgKeyForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/gpg_keys\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "GET", format: "json", ...params, }), /** - * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. * - * @tags users - * @name UsersCreatePublicSshKeyForAuthenticated - * @summary Create a public SSH key for the authenticated user - * @request POST:/user/keys + * @tags repos + * @name ReposGetViews + * @summary Get page views + * @request GET:/repos/{owner}/{repo}/traffic/views */ - usersCreatePublicSshKeyForAuthenticated: ( - data: UsersCreatePublicSshKeyForAuthenticatedPayload, + reposGetViews: ( + { owner, repo, ...query }: ReposGetViewsParams, params: RequestParams = {}, ) => - this.request< - UsersCreatePublicSshKeyForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/keys\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/views\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." * - * @tags users - * @name UsersDeleteEmailForAuthenticated - * @summary Delete an email address for the authenticated user - * @request DELETE:/user/emails + * @tags repos + * @name ReposGetWebhook + * @summary Get a repository webhook + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} */ - usersDeleteEmailForAuthenticated: ( - data: UsersDeleteEmailForAuthenticatedPayload, + reposGetWebhook: ( + { owner, repo, hookId }: ReposGetWebhookParams, params: RequestParams = {}, ) => - this.request< - UsersDeleteEmailForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/emails\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. * - * @tags users - * @name UsersDeleteGpgKeyForAuthenticated - * @summary Delete a GPG key for the authenticated user - * @request DELETE:/user/gpg_keys/{gpg_key_id} + * @tags repos + * @name ReposGetWebhookConfigForRepo + * @summary Get a webhook configuration for a repository + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config */ - usersDeleteGpgKeyForAuthenticated: ( - { gpgKeyId }: UsersDeleteGpgKeyForAuthenticatedParams, + reposGetWebhookConfigForRepo: ( + { owner, repo, hookId }: ReposGetWebhookConfigForRepoParams, params: RequestParams = {}, ) => - this.request< - UsersDeleteGpgKeyForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags users - * @name UsersDeletePublicSshKeyForAuthenticated - * @summary Delete a public SSH key for the authenticated user - * @request DELETE:/user/keys/{key_id} + * @tags repos + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches */ - usersDeletePublicSshKeyForAuthenticated: ( - { keyId }: UsersDeletePublicSshKeyForAuthenticatedParams, + reposListBranches: ( + { owner, repo, ...query }: ReposListBranchesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. * - * @tags users - * @name UsersFollow - * @summary Follow a user - * @request PUT:/user/following/{username} + * @tags repos + * @name ReposListBranchesForHeadCommit + * @summary List branches for HEAD commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head */ - usersFollow: ( - { username }: UsersFollowParams, + reposListBranchesForHeadCommit: ( + { owner, repo, commitSha }: ReposListBranchesForHeadCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, - method: "PUT", + this.request< + ReposListBranchesForHeadCommitData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, + method: "GET", + format: "json", ...params, }), /** - * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. * - * @tags users - * @name UsersGetAuthenticated - * @summary Get the authenticated user - * @request GET:/user + * @tags repos + * @name ReposListCollaborators + * @summary List repository collaborators + * @request GET:/repos/{owner}/{repo}/collaborators */ - usersGetAuthenticated: (params: RequestParams = {}) => - this.request({ - path: \`/user\`, + reposListCollaborators: ( + { owner, repo, ...query }: ReposListCollaboratorsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. * - * @tags users - * @name UsersGetGpgKeyForAuthenticated - * @summary Get a GPG key for the authenticated user - * @request GET:/user/gpg_keys/{gpg_key_id} + * @tags repos + * @name ReposListCommentsForCommit + * @summary List commit comments + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - usersGetGpgKeyForAuthenticated: ( - { gpgKeyId }: UsersGetGpgKeyForAuthenticatedParams, + reposListCommentsForCommit: ( + { owner, repo, commitSha, ...query }: ReposListCommentsForCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. * - * @tags users - * @name UsersGetPublicSshKeyForAuthenticated - * @summary Get a public SSH key for the authenticated user - * @request GET:/user/keys/{key_id} + * @tags repos + * @name ReposListCommitCommentsForRepo + * @summary List commit comments for a repository + * @request GET:/repos/{owner}/{repo}/comments */ - usersGetPublicSshKeyForAuthenticated: ( - { keyId }: UsersGetPublicSshKeyForAuthenticatedParams, + reposListCommitCommentsForRepo: ( + { owner, repo, ...query }: ReposListCommitCommentsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description List the users you've blocked on your personal account. + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags users - * @name UsersListBlockedByAuthenticated - * @summary List users blocked by the authenticated user - * @request GET:/user/blocks + * @tags repos + * @name ReposListCommits + * @summary List commits + * @request GET:/repos/{owner}/{repo}/commits */ - usersListBlockedByAuthenticated: (params: RequestParams = {}) => - this.request< - UsersListBlockedByAuthenticatedData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/user/blocks\`, + reposListCommits: ( + { owner, repo, ...query }: ReposListCommitsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/commits\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. + * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. * - * @tags users - * @name UsersListEmailsForAuthenticated - * @summary List email addresses for the authenticated user - * @request GET:/user/emails + * @tags repos + * @name ReposListCommitStatusesForRef + * @summary List commit statuses for a reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses */ - usersListEmailsForAuthenticated: ( - query: UsersListEmailsForAuthenticatedParams, + reposListCommitStatusesForRef: ( + { owner, repo, ref, ...query }: ReposListCommitStatusesForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, method: "GET", query: query, format: "json", @@ -64765,19 +63234,19 @@ export class Api< }), /** - * @description Lists the people who the authenticated user follows. + * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. * - * @tags users - * @name UsersListFollowedByAuthenticated - * @summary List the people the authenticated user follows - * @request GET:/user/following + * @tags repos + * @name ReposListContributors + * @summary List repository contributors + * @request GET:/repos/{owner}/{repo}/contributors */ - usersListFollowedByAuthenticated: ( - query: UsersListFollowedByAuthenticatedParams, + reposListContributors: ( + { owner, repo, ...query }: ReposListContributorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/contributors\`, method: "GET", query: query, format: "json", @@ -64785,19 +63254,19 @@ export class Api< }), /** - * @description Lists the people following the authenticated user. + * No description * - * @tags users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @tags repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys */ - usersListFollowersForAuthenticatedUser: ( - query: UsersListFollowersForAuthenticatedUserParams, + reposListDeployKeys: ( + { owner, repo, ...query }: ReposListDeployKeysParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/followers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, method: "GET", query: query, format: "json", @@ -64805,19 +63274,19 @@ export class Api< }), /** - * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Simple filtering of deployments is available via query parameters: * - * @tags users - * @name UsersListGpgKeysForAuthenticated - * @summary List GPG keys for the authenticated user - * @request GET:/user/gpg_keys + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments */ - usersListGpgKeysForAuthenticated: ( - query: UsersListGpgKeysForAuthenticatedParams, + reposListDeployments: ( + { owner, repo, ...query }: ReposListDeploymentsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", query: query, format: "json", @@ -64825,19 +63294,24 @@ export class Api< }), /** - * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. + * @description Users with pull access can view deployment statuses for a deployment: * - * @tags users - * @name UsersListPublicEmailsForAuthenticated - * @summary List public email addresses for the authenticated user - * @request GET:/user/public_emails + * @tags repos + * @name ReposListDeploymentStatuses + * @summary List deployment statuses + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - usersListPublicEmailsForAuthenticated: ( - query: UsersListPublicEmailsForAuthenticatedParams, + reposListDeploymentStatuses: ( + { + owner, + repo, + deploymentId, + ...query + }: ReposListDeploymentStatusesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/public_emails\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, method: "GET", query: query, format: "json", @@ -64845,19 +63319,19 @@ export class Api< }), /** - * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags users - * @name UsersListPublicSshKeysForAuthenticated - * @summary List public SSH keys for the authenticated user - * @request GET:/user/keys + * @tags repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks */ - usersListPublicSshKeysForAuthenticated: ( - query: UsersListPublicSshKeysForAuthenticatedParams, + reposListForks: ( + { owner, repo, ...query }: ReposListForksParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, method: "GET", query: query, format: "json", @@ -64865,101 +63339,109 @@ export class Api< }), /** - * @description Sets the visibility for your primary email addresses. + * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. * - * @tags users - * @name UsersSetPrimaryEmailVisibilityForAuthenticated - * @summary Set primary email visibility for the authenticated user - * @request PATCH:/user/email/visibility + * @tags repos + * @name ReposListInvitations + * @summary List repository invitations + * @request GET:/repos/{owner}/{repo}/invitations */ - usersSetPrimaryEmailVisibilityForAuthenticated: ( - data: UsersSetPrimaryEmailVisibilityForAuthenticatedPayload, + reposListInvitations: ( + { owner, repo, ...query }: ReposListInvitationsParams, params: RequestParams = {}, ) => - this.request< - UsersSetPrimaryEmailVisibilityForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/email/visibility\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. * - * @tags users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} + * @tags repos + * @name ReposListLanguages + * @summary List repository languages + * @request GET:/repos/{owner}/{repo}/languages */ - usersUnblock: ( - { username }: UsersUnblockParams, + reposListLanguages: ( + { owner, repo }: ReposListLanguagesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/languages\`, + method: "GET", + format: "json", ...params, }), /** - * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * No description * - * @tags users - * @name UsersUnfollow - * @summary Unfollow a user - * @request DELETE:/user/following/{username} + * @tags repos + * @name ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds */ - usersUnfollow: ( - { username }: UsersUnfollowParams, + reposListPagesBuilds: ( + { owner, repo, ...query }: ReposListPagesBuildsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. + * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. * - * @tags users - * @name UsersUpdateAuthenticated - * @summary Update the authenticated user - * @request PATCH:/user + * @tags repos + * @name ReposListPullRequestsAssociatedWithCommit + * @summary List pull requests associated with a commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls */ - usersUpdateAuthenticated: ( - data: UsersUpdateAuthenticatedPayload, + reposListPullRequestsAssociatedWithCommit: ( + { + owner, + repo, + commitSha, + ...query + }: ReposListPullRequestsAssociatedWithCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + ReposListPullRequestsAssociatedWithCommitData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, + method: "GET", + query: query, format: "json", ...params, }), - }; - users = { + /** - * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * No description * - * @tags activity - * @name ActivityListEventsForAuthenticatedUser - * @summary List events for the authenticated user - * @request GET:/users/{username}/events + * @tags repos + * @name ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets */ - activityListEventsForAuthenticatedUser: ( - { username, ...query }: ActivityListEventsForAuthenticatedUserParams, + reposListReleaseAssets: ( + { owner, repo, releaseId, ...query }: ReposListReleaseAssetsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "GET", query: query, format: "json", @@ -64967,23 +63449,19 @@ export class Api< }), /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. * - * @tags activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} - */ - activityListOrgEventsForAuthenticatedUser: ( - { - username, - org, - ...query - }: ActivityListOrgEventsForAuthenticatedUserParams, + * @tags repos + * @name ReposListReleases + * @summary List releases + * @request GET:/repos/{owner}/{repo}/releases + */ + reposListReleases: ( + { owner, repo, ...query }: ReposListReleasesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/orgs/\${org}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, method: "GET", query: query, format: "json", @@ -64993,17 +63471,17 @@ export class Api< /** * No description * - * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @tags repos + * @name ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags */ - activityListPublicEventsForUser: ( - { username, ...query }: ActivityListPublicEventsForUserParams, + reposListTags: ( + { owner, repo, ...query }: ReposListTagsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/public\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/tags\`, method: "GET", query: query, format: "json", @@ -65011,19 +63489,19 @@ export class Api< }), /** - * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. + * No description * - * @tags activity - * @name ActivityListReceivedEventsForUser - * @summary List events received by the authenticated user - * @request GET:/users/{username}/received_events + * @tags repos + * @name ReposListTeams + * @summary List repository teams + * @request GET:/repos/{owner}/{repo}/teams */ - activityListReceivedEventsForUser: ( - { username, ...query }: ActivityListReceivedEventsForUserParams, + reposListTeams: ( + { owner, repo, ...query }: ReposListTeamsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/teams\`, method: "GET", query: query, format: "json", @@ -65033,17 +63511,17 @@ export class Api< /** * No description * - * @tags activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @tags repos + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks */ - activityListReceivedPublicEventsForUser: ( - { username, ...query }: ActivityListReceivedPublicEventsForUserParams, + reposListWebhooks: ( + { owner, repo, ...query }: ReposListWebhooksParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events/public\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, method: "GET", query: query, format: "json", @@ -65051,157 +63529,190 @@ export class Api< }), /** - * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * No description * - * @tags activity - * @name ActivityListReposStarredByUser - * @summary List repositories starred by a user - * @request GET:/users/{username}/starred + * @tags repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges */ - activityListReposStarredByUser: ( - { username, ...query }: ActivityListReposStarredByUserParams, + reposMerge: ( + { owner, repo }: ReposMergeParams, + data: ReposMergePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/starred\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/merges\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists repositories a user is watching. + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @tags repos + * @name ReposPingWebhook + * @summary Ping a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings */ - activityListReposWatchedByUser: ( - { username, ...query }: ActivityListReposWatchedByUserParams, + reposPingWebhook: ( + { owner, repo, hookId }: ReposPingWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/subscriptions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, + method: "POST", ...params, }), /** - * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags apps - * @name AppsGetUserInstallation - * @summary Get a user installation for the authenticated app - * @request GET:/users/{username}/installation + * @tags repos + * @name ReposRemoveAppAccessRestrictions + * @summary Remove app access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - appsGetUserInstallation: ( - { username }: AppsGetUserInstallationParams, + reposRemoveAppAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveAppAccessRestrictionsParams, + data: ReposRemoveAppAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/installation\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. + * No description * - * @tags billing - * @name BillingGetGithubActionsBillingUser - * @summary Get GitHub Actions billing for a user - * @request GET:/users/{username}/settings/billing/actions + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} */ - billingGetGithubActionsBillingUser: ( - { username }: BillingGetGithubActionsBillingUserParams, + reposRemoveCollaborator: ( + { owner, repo, username }: ReposRemoveCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/actions\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "DELETE", ...params, }), /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags billing - * @name BillingGetGithubPackagesBillingUser - * @summary Get GitHub Packages billing for a user - * @request GET:/users/{username}/settings/billing/packages + * @tags repos + * @name ReposRemoveStatusCheckContexts + * @summary Remove status check contexts + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - billingGetGithubPackagesBillingUser: ( - { username }: BillingGetGithubPackagesBillingUserParams, + reposRemoveStatusCheckContexts: ( + { owner, repo, branch }: ReposRemoveStatusCheckContextsParams, + data: ReposRemoveStatusCheckContextsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/packages\`, - method: "GET", + this.request< + ReposRemoveStatusCheckContextsData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags billing - * @name BillingGetSharedStorageBillingUser - * @summary Get shared storage billing for a user - * @request GET:/users/{username}/settings/billing/shared-storage + * @tags repos + * @name ReposRemoveStatusCheckProtection + * @summary Remove status check protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - billingGetSharedStorageBillingUser: ( - { username }: BillingGetSharedStorageBillingUserParams, + reposRemoveStatusCheckProtection: ( + { owner, repo, branch }: ReposRemoveStatusCheckProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/shared-storage\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "DELETE", + ...params, + }), + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * + * @tags repos + * @name ReposRemoveTeamAccessRestrictions + * @summary Remove team access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + */ + reposRemoveTeamAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveTeamAccessRestrictionsParams, + data: ReposRemoveTeamAccessRestrictionsPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists public gists for the specified user: + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @tags repos + * @name ReposRemoveUserAccessRestrictions + * @summary Remove user access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - gistsListForUser: ( - { username, ...query }: GistsListForUserParams, + reposRemoveUserAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveUserAccessRestrictionsParams, + data: ReposRemoveUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gists\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. * - * @tags orgs - * @name OrgsListForUser - * @summary List organizations for a user - * @request GET:/users/{username}/orgs + * @tags repos + * @name ReposRenameBranch + * @summary Rename a branch + * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename */ - orgsListForUser: ( - { username, ...query }: OrgsListForUserParams, + reposRenameBranch: ( + { owner, repo, branch }: ReposRenameBranchParams, + data: ReposRenameBranchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/orgs\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -65209,2928 +63720,3465 @@ export class Api< /** * No description * - * @tags projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics */ - projectsListForUser: ( - { username, ...query }: ProjectsListForUserParams, + reposReplaceAllTopics: ( + { owner, repo }: ReposReplaceAllTopicsParams, + data: ReposReplaceAllTopicsPayload, params: RequestParams = {}, ) => this.request< - ProjectsListForUserData, + ReposReplaceAllTopicsData, + | BasicError | { documentation_url: string; message: string; } - | ValidationError + | ValidationErrorSimple >({ - path: \`/users/\${username}/projects\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/topics\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists public repositories for the specified user. + * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. * * @tags repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * @name ReposRequestPagesBuild + * @summary Request a GitHub Pages build + * @request POST:/repos/{owner}/{repo}/pages/builds */ - reposListForUser: ( - { username, ...query }: ReposListForUserParams, + reposRequestPagesBuild: ( + { owner, repo }: ReposRequestPagesBuildParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/repos\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, + method: "POST", format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * - * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} + * @tags repos + * @name ReposSetAdminBranchProtection + * @summary Set admin branch protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - usersCheckFollowingForUser: ( - { username, targetUser }: UsersCheckFollowingForUserParams, + reposSetAdminBranchProtection: ( + { owner, repo, branch }: ReposSetAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following/\${targetUser}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "POST", + format: "json", ...params, }), /** - * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags users - * @name UsersGetByUsername - * @summary Get a user - * @request GET:/users/{username} + * @tags repos + * @name ReposSetAppAccessRestrictions + * @summary Set app access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - usersGetByUsername: ( - { username }: UsersGetByUsernameParams, + reposSetAppAccessRestrictions: ( + { owner, repo, branch }: ReposSetAppAccessRestrictionsParams, + data: ReposSetAppAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags users - * @name UsersGetContextForUser - * @summary Get contextual information for a user - * @request GET:/users/{username}/hovercard + * @tags repos + * @name ReposSetStatusCheckContexts + * @summary Set status check contexts + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - usersGetContextForUser: ( - { username, ...query }: UsersGetContextForUserParams, + reposSetStatusCheckContexts: ( + { owner, repo, branch }: ReposSetStatusCheckContextsParams, + data: ReposSetStatusCheckContextsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/hovercard\`, - method: "GET", - query: query, + this.request< + ReposSetStatusCheckContextsData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags users - * @name UsersList - * @summary List users - * @request GET:/users + * @tags repos + * @name ReposSetTeamAccessRestrictions + * @summary Set team access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - usersList: (query: UsersListParams, params: RequestParams = {}) => - this.request({ - path: \`/users\`, - method: "GET", - query: query, + reposSetTeamAccessRestrictions: ( + { owner, repo, branch }: ReposSetTeamAccessRestrictionsParams, + data: ReposSetTeamAccessRestrictionsPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the people following the specified user. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags users - * @name UsersListFollowersForUser - * @summary List followers of a user - * @request GET:/users/{username}/followers + * @tags repos + * @name ReposSetUserAccessRestrictions + * @summary Set user access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - usersListFollowersForUser: ( - { username, ...query }: UsersListFollowersForUserParams, + reposSetUserAccessRestrictions: ( + { owner, repo, branch }: ReposSetUserAccessRestrictionsParams, + data: ReposSetUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/followers\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the people who the specified user follows. + * @description 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/:hook_id/test\` * - * @tags users - * @name UsersListFollowingForUser - * @summary List the people a user follows - * @request GET:/users/{username}/following + * @tags repos + * @name ReposTestPushWebhook + * @summary Test the push repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests */ - usersListFollowingForUser: ( - { username, ...query }: UsersListFollowingForUserParams, + reposTestPushWebhook: ( + { owner, repo, hookId }: ReposTestPushWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, + method: "POST", + ...params, + }), + + /** + * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). + * + * @tags repos + * @name ReposTransfer + * @summary Transfer a repository + * @request POST:/repos/{owner}/{repo}/transfer + */ + reposTransfer: ( + { owner, repo }: ReposTransferParams, + data: ReposTransferPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/transfer\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. + * + * @tags repos + * @name ReposUpdate + * @summary Update a repository + * @request PATCH:/repos/{owner}/{repo} + */ + reposUpdate: ( + { owner, repo }: ReposUpdateParams, + data: ReposUpdatePayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. + * + * @tags repos + * @name ReposUpdateBranchProtection + * @summary Update branch protection + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + */ + reposUpdateBranchProtection: ( + { owner, repo, branch }: ReposUpdateBranchProtectionParams, + data: ReposUpdateBranchProtectionPayload, + params: RequestParams = {}, + ) => + this.request< + ReposUpdateBranchProtectionData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the GPG keys for a user. This information is accessible by anyone. + * No description * - * @tags users - * @name UsersListGpgKeysForUser - * @summary List GPG keys for a user - * @request GET:/users/{username}/gpg_keys + * @tags repos + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} */ - usersListGpgKeysForUser: ( - { username, ...query }: UsersListGpgKeysForUserParams, + reposUpdateCommitComment: ( + { owner, repo, commentId }: ReposUpdateCommitCommentParams, + data: ReposUpdateCommitCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gpg_keys\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). * - * @tags users - * @name UsersListPublicKeysForUser - * @summary List public keys for a user - * @request GET:/users/{username}/keys + * @tags repos + * @name ReposUpdateInformationAboutPagesSite + * @summary Update information about a GitHub Pages site + * @request PUT:/repos/{owner}/{repo}/pages */ - usersListPublicKeysForUser: ( - { username, ...query }: UsersListPublicKeysForUserParams, + reposUpdateInformationAboutPagesSite: ( + { owner, repo }: ReposUpdateInformationAboutPagesSiteParams, + data: ReposUpdateInformationAboutPagesSitePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/keys\`, - method: "GET", - query: query, - format: "json", + this.request< + ReposUpdateInformationAboutPagesSiteData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), - }; - zen = { + /** - * @description Get a random sentence from the Zen of GitHub + * No description * - * @tags meta - * @name MetaGetZen - * @summary Get the Zen of GitHub - * @request GET:/zen + * @tags repos + * @name ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} */ - metaGetZen: (params: RequestParams = {}) => - this.request({ - path: \`/zen\`, - method: "GET", + reposUpdateInvitation: ( + { owner, repo, invitationId }: ReposUpdateInvitationParams, + data: ReposUpdateInvitationPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - }; -} -" -`; - -exports[`extended > 'furkot-example' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ -export interface Step { - /** address of the stop */ - address?: string; - /** - * arrival at the stop in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - arrival?: string; - /** geographical coordinates of the stop */ - coordinates?: { - /** - * latitude - * @format float - */ - lat?: number; - /** - * longitude - * @format float - */ - lon?: number; - }; - /** - * departure from the stop in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - departure?: string; - /** name of the stop */ - name?: string; - /** - * number of nights - * @format int64 - */ - nights?: number; - /** route leading to the stop */ - route?: { - /** - * route distance in meters - * @format int64 - */ - distance?: number; /** - * route duration in seconds - * @format int64 + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. + * + * @tags repos + * @name ReposUpdatePullRequestReviewProtection + * @summary Update pull request review protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - duration?: number; - /** travel mode */ - mode?: StepModeEnum; - /** route path compatible with Google polyline encoding algorithm */ - polyline?: string; - }; - /** url of the page with more information about the stop */ - url?: string; -} - -/** travel mode */ -export enum StepModeEnum { - Car = "car", - Motorcycle = "motorcycle", - Bicycle = "bicycle", - Walk = "walk", - Other = "other", -} - -export type StopListData = Step[]; - -export interface StopListParams { - /** id of the trip */ - tripId: string; -} - -export interface Trip { - /** - * begin of the trip in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - begin?: string; - /** description of the trip (truncated to 200 characters) */ - description?: string; - /** - * end of the trip in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - end?: string; - /** Unique ID of the trip */ - id?: string; - /** name of the trip */ - name?: string; -} - -export type TripListData = Trip[]; - -export namespace Trip { - /** - * @description list stops for a trip identified by {trip_id} - * @name StopList - * @request GET:/trip/{trip_id}/stop - * @secure - */ - export namespace StopList { - export type RequestParams = { - /** id of the trip */ - tripId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = StopListData; - } - - /** - * @description list user's trips - * @name TripList - * @request GET:/trip - * @secure - */ - export namespace TripList { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TripListData; - } -} - -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -export class HttpClient { - public baseUrl: string = "https://trips.furkot.com/pub/api"; - 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.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } - - return 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: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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 responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[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 Furkot Trips - * @version 1.0.0 - * @baseUrl https://trips.furkot.com/pub/api - * @externalDocs https://help.furkot.com/widgets/furkot-api.html - * @contact - * - * Furkot provides Rest API to access user trip data. - * Using Furkot API an application can list user trips and display stops for a specific trip. - * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { - trip = { + reposUpdatePullRequestReviewProtection: ( + { owner, repo, branch }: ReposUpdatePullRequestReviewProtectionParams, + data: ReposUpdatePullRequestReviewProtectionPayload, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }, + ), + /** - * @description list stops for a trip identified by {trip_id} + * @description Users with push access to the repository can edit a release. * - * @name StopList - * @request GET:/trip/{trip_id}/stop - * @secure + * @tags repos + * @name ReposUpdateRelease + * @summary Update a release + * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} */ - stopList: ({ tripId }: StopListParams, params: RequestParams = {}) => - this.request({ - path: \`/trip/\${tripId}/stop\`, - method: "GET", - secure: true, + reposUpdateRelease: ( + { owner, repo, releaseId }: ReposUpdateReleaseParams, + data: ReposUpdateReleasePayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description list user's trips + * @description Users with push access to the repository can edit a release asset. * - * @name TripList - * @request GET:/trip - * @secure + * @tags repos + * @name ReposUpdateReleaseAsset + * @summary Update a release asset + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - tripList: (params: RequestParams = {}) => - this.request({ - path: \`/trip\`, - method: "GET", - secure: true, + reposUpdateReleaseAsset: ( + { owner, repo, assetId }: ReposUpdateReleaseAssetParams, + data: ReposUpdateReleaseAssetPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - }; -} -" -`; - -exports[`extended > 'giphy' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -/** Your request was formatted incorrectly or missing required parameters. */ -export type BadRequest = any; - -/** You weren't authorized to make your request; most likely this indicates an issue with your API Key. */ -export type Forbidden = any; - -export interface GetGifByIdData { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; -} - -export interface GetGifByIdParams { - /** - * Filters results by specified GIF ID. - * @format int32 - */ - gifId: number; -} - -export interface GetGifsByIdData { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; -} - -export interface GetGifsByIdParams { - /** Filters results by specified GIF IDs, separated by commas. */ - ids?: string; -} - -export interface Gif { - /** - * The unique bit.ly URL for this GIF - * @example "http://gph.is/1gsWDcL" - */ - bitly_url?: string; - /** Currently unused */ - content_url?: string; - /** - * The date this GIF was added to the GIPHY database. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - create_datetime?: string; - /** - * A URL used for embedding this GIF - * @example "http://giphy.com/embed/YsTs5ltWtEhnq" - */ - embded_url?: string; - /** An array of featured tags for this GIF (Note: Not available when using the Public Beta Key) */ - featured_tags?: string[]; - /** - * This GIF's unique ID - * @example "YsTs5ltWtEhnq" - */ - id?: string; - /** An object containing data for various available formats and sizes of this GIF. */ - images?: { - /** Data surrounding a version of this GIF downsized to be under 2mb. */ - downsized?: Image; - /** Data surrounding a version of this GIF downsized to be under 8mb. */ - downsized_large?: Image; - /** Data surrounding a version of this GIF downsized to be under 5mb. */ - downsized_medium?: Image; - /** Data surrounding a version of this GIF downsized to be under 200kb. */ - downsized_small?: Image; - /** Data surrounding a static preview image of the downsized version of this GIF. */ - downsized_still?: Image; - /** Data surrounding versions of this GIF with a fixed height of 200 pixels. Good for mobile use. */ - fixed_height?: Image; - /** Data surrounding versions of this GIF with a fixed height of 200 pixels and the number of frames reduced to 6. */ - fixed_height_downsampled?: Image; - /** Data surrounding versions of this GIF with a fixed height of 100 pixels. Good for mobile keyboards. */ - fixed_height_small?: Image; - /** Data surrounding a static image of this GIF with a fixed height of 100 pixels. */ - fixed_height_small_still?: Image; - /** Data surrounding a static image of this GIF with a fixed height of 200 pixels. */ - fixed_height_still?: Image; - /** Data surrounding versions of this GIF with a fixed width of 200 pixels. Good for mobile use. */ - fixed_width?: Image; - /** Data surrounding versions of this GIF with a fixed width of 200 pixels and the number of frames reduced to 6. */ - fixed_width_downsampled?: Image; - /** Data surrounding versions of this GIF with a fixed width of 100 pixels. Good for mobile keyboards. */ - fixed_width_small?: Image; - /** Data surrounding a static image of this GIF with a fixed width of 100 pixels. */ - fixed_width_small_still?: Image; - /** Data surrounding a static image of this GIF with a fixed width of 200 pixels. */ - fixed_width_still?: Image; - /** Data surrounding a version of this GIF set to loop for 15 seconds. */ - looping?: Image; - /** Data surrounding the original version of this GIF. Good for desktop use. */ - original?: Image; - /** Data surrounding a static preview image of the original GIF. */ - original_still?: Image; - /** Data surrounding a version of this GIF in .MP4 format limited to 50kb that displays the first 1-2 seconds of the GIF. */ - preview?: Image; - /** Data surrounding a version of this GIF limited to 50kb that displays the first 1-2 seconds of the GIF. */ - preview_gif?: Image; - }; - /** - * The creation or upload date from this GIF's source. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - import_datetime?: string; - /** - * The MPAA-style rating for this content. Examples include Y, G, PG, PG-13 and R - * @example "g" - */ - rating?: string; - /** - * The unique slug used in this GIF's URL - * @example "confused-flying-YsTs5ltWtEhnq" - */ - slug?: string; - /** - * The page on which this GIF was found - * @example "http://www.reddit.com/r/reactiongifs/comments/1xpyaa/superman_goes_to_hollywood/" - */ - source?: string; - /** - * The URL of the webpage on which this GIF was found. - * @example "http://cheezburger.com/5282328320" - */ - source_post_url?: string; - /** - * The top level domain of the source URL. - * @example "cheezburger.com" - */ - source_tld?: string; - /** An array of tags for this GIF (Note: Not available when using the Public Beta Key) */ - tags?: string[]; - /** - * The date on which this gif was marked trending, if applicable. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - trending_datetime?: string; - /** - * Type of the gif. By default, this is almost always gif - * @default "gif" - */ - type?: GifTypeEnum; - /** - * The date on which this GIF was last updated. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - update_datetime?: string; - /** - * The unique URL for this GIF - * @example "http://giphy.com/gifs/confused-flying-YsTs5ltWtEhnq" - */ - url?: string; - /** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ - user?: User; - /** - * The username this GIF is attached to, if applicable - * @example "JoeCool4000" - */ - username?: string; -} - -/** - * Type of the gif. By default, this is almost always gif - * @default "gif" - */ -export enum GifTypeEnum { - Gif = "gif", -} - -export interface Image { - /** - * The URL for this GIF in .MP4 format. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.mp4" - */ - mp4?: string; - /** - * The size in bytes of the .MP4 file corresponding to this GIF. - * @example "25123" - */ - mp4_size?: string; - /** - * The number of frames in this GIF. - * @example "15" - */ - frames?: string; - /** - * The height of this GIF in pixels. - * @example "200" - */ - height?: string; - /** - * The size of this GIF in bytes. - * @example "32381" - */ - size?: string; - /** - * The publicly-accessible direct URL for this GIF. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/200.gif" - */ - url?: string; - /** - * The URL for this GIF in .webp format. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.webp" - */ - webp?: string; - /** - * The size in bytes of the .webp file corresponding to this GIF. - * @example "12321" - */ - webp_size?: string; - /** - * The width of this GIF in pixels. - * @example "320" - */ - width?: string; -} - -/** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ -export interface Meta { - /** - * HTTP Response Message - * @example "OK" - */ - msg?: string; - /** - * A unique ID paired with this response from the API. - * @example "57eea03c72381f86e05c35d2" - */ - response_id?: string; - /** - * HTTP Response Code - * @format int32 - * @example 200 - */ - status?: number; -} - -/** The particular GIF you are requesting was not found. This occurs, for example, if you request a GIF by an id that does not exist. */ -export type NotFound = any; - -/** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ -export interface Pagination { - /** - * Total number of items returned. - * @format int32 - * @example 25 - */ - count?: number; - /** - * Position in pagination. - * @format int32 - * @example 75 - */ - offset?: number; - /** - * Total number of items available. - * @format int32 - * @example 250 - */ - total_count?: number; -} - -export interface RandomGifData { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; -} - -export interface RandomGifParams { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; -} - -export interface RandomStickerData { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; -} - -export interface RandomStickerParams { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; -} - -export interface SearchGifsData { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; -} - -export interface SearchGifsParams { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; -} - -export interface SearchStickersData { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; -} -export interface SearchStickersParams { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; -} + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + * + * @tags repos + * @name ReposUpdateStatusCheckProtection + * @summary Update status check protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + */ + reposUpdateStatusCheckProtection: ( + { owner, repo, branch }: ReposUpdateStatusCheckProtectionParams, + data: ReposUpdateStatusCheckProtectionPayload, + params: RequestParams = {}, + ) => + this.request< + ReposUpdateStatusCheckProtectionData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -/** Your API Key is making too many requests. Read about [requesting a Production Key](https://developers.giphy.com/docs/#access) to upgrade your API Key rate limits. */ -export type TooManyRequests = any; + /** + * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." + * + * @tags repos + * @name ReposUpdateWebhook + * @summary Update a repository webhook + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + */ + reposUpdateWebhook: ( + { owner, repo, hookId }: ReposUpdateWebhookParams, + data: ReposUpdateWebhookPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export interface TranslateGifData { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; -} + /** + * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. + * + * @tags repos + * @name ReposUpdateWebhookConfigForRepo + * @summary Update a webhook configuration for a repository + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + */ + reposUpdateWebhookConfigForRepo: ( + { owner, repo, hookId }: ReposUpdateWebhookConfigForRepoParams, + data: ReposUpdateWebhookConfigForRepoPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export interface TranslateGifParams { - /** Search term. */ - s: string; -} + /** + * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + * + * @tags repos + * @name ReposUploadReleaseAsset + * @summary Upload a release asset + * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + */ + reposUploadReleaseAsset: ( + { owner, repo, releaseId, ...query }: ReposUploadReleaseAssetParams, + data: ReposUploadReleaseAssetPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, + method: "POST", + query: query, + body: data, + format: "json", + ...params, + }), -export interface TranslateStickerData { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; -} + /** + * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * + * @tags secret-scanning + * @name SecretScanningGetAlert + * @summary Get a secret scanning alert + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + */ + secretScanningGetAlert: ( + { owner, repo, alertNumber }: SecretScanningGetAlertParams, + params: RequestParams = {}, + ) => + this.request< + SecretScanningGetAlertData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + method: "GET", + format: "json", + ...params, + }), -export interface TranslateStickerParams { - /** Search term. */ - s: string; -} + /** + * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * + * @tags secret-scanning + * @name SecretScanningListAlertsForRepo + * @summary List secret scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + */ + secretScanningListAlertsForRepo: ( + { owner, repo, ...query }: SecretScanningListAlertsForRepoParams, + params: RequestParams = {}, + ) => + this.request< + SecretScanningListAlertsForRepoData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface TrendingGifsData { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; -} + /** + * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. + * + * @tags secret-scanning + * @name SecretScanningUpdateAlert + * @summary Update a secret scanning alert + * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + */ + secretScanningUpdateAlert: ( + { owner, repo, alertNumber }: SecretScanningUpdateAlertParams, + data: SecretScanningUpdateAlertPayload, + params: RequestParams = {}, + ) => + this.request< + SecretScanningUpdateAlertData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + repositories = { + /** + * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + * + * @tags repos + * @name ReposListPublic + * @summary List public repositories + * @request GET:/repositories + */ + reposListPublic: ( + query: ReposListPublicParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + scim = { + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * @tags enterprise-admin + * @name EnterpriseAdminDeleteScimGroupFromEnterprise + * @summary Delete a SCIM group from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + enterpriseAdminDeleteScimGroupFromEnterprise: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminDeleteScimGroupFromEnterpriseParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "DELETE", + ...params, + }), -export interface TrendingGifsParams { - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; -} + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * @tags enterprise-admin + * @name EnterpriseAdminDeleteUserFromEnterprise + * @summary Delete a SCIM user from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + enterpriseAdminDeleteUserFromEnterprise: ( + { enterprise, scimUserId }: EnterpriseAdminDeleteUserFromEnterpriseParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "DELETE", + ...params, + }), -export interface TrendingStickersData { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; -} + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup + * @summary Get SCIM provisioning information for an enterprise group + * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "GET", + format: "json", + ...params, + }), -export interface TrendingStickersParams { - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; -} + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser + * @summary Get SCIM provisioning information for an enterprise user + * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "GET", + format: "json", + ...params, + }), -/** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ -export interface User { - /** - * The URL for this user's avatar image. - * @example "https://media1.giphy.com/avatars/election2016/XwYrZi5H87o6.gif" - */ - avatar_url?: string; - /** - * The URL for the banner image that appears atop this user's profile page. - * @example "https://media4.giphy.com/avatars/cheezburger/XkuejOhoGLE6.jpg" - */ - banner_url?: string; - /** - * The display name associated with this user (contains formatting the base username might not). - * @example "JoeCool4000" - */ - display_name?: string; - /** - * The URL for this user's profile. - * @example "https://giphy.com/cheezburger/" - */ - profile_url?: string; - /** - * The Twitter username associated with this user, if applicable. - * @example "@joecool4000" - */ - twitter?: string; - /** - * The username associated with this user. - * @example "joecool4000" - */ - username?: string; -} + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedGroupsEnterprise + * @summary List provisioned SCIM groups for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Groups + */ + enterpriseAdminListProvisionedGroupsEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListProvisionedGroupsEnterpriseParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export namespace Gifs { - /** - * @description Returns a GIF given that GIF's unique ID - * @tags gifs - * @name GetGifById - * @summary Get GIF by Id - * @request GET:/gifs/{gifId} - * @secure - */ - export namespace GetGifById { - export type RequestParams = { - /** - * Filters results by specified GIF ID. - * @format int32 - */ - gifId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetGifByIdData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. + * + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedIdentitiesEnterprise + * @summary List SCIM provisioned identities for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Users + */ + enterpriseAdminListProvisionedIdentitiesEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListProvisionedIdentitiesEnterpriseParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), - /** - * @description A multiget version of the get GIF by ID endpoint. - * @tags gifs - * @name GetGifsById - * @summary Get GIFs by ID - * @request GET:/gifs - * @secure - */ - export namespace GetGifsById { - export type RequestParams = {}; - export type RequestQuery = { - /** Filters results by specified GIF IDs, separated by commas. */ - ids?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetGifsByIdData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + * + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup + * @summary Provision a SCIM enterprise group and invite users + * @request POST:/scim/v2/enterprises/{enterprise}/Groups + */ + enterpriseAdminProvisionAndInviteEnterpriseGroup: ( + { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseGroupParams, + data: EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. - * @tags gifs - * @name RandomGif - * @summary Random GIF - * @request GET:/gifs/random - * @secure - */ - export namespace RandomGif { - export type RequestParams = {}; - export type RequestQuery = { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = RandomGifData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + * + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseUser + * @summary Provision and invite a SCIM enterprise user + * @request POST:/scim/v2/enterprises/{enterprise}/Users + */ + enterpriseAdminProvisionAndInviteEnterpriseUser: ( + { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseUserParams, + data: EnterpriseAdminProvisionAndInviteEnterpriseUserPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. - * @tags gifs - * @name SearchGifs - * @summary Search GIFs - * @request GET:/gifs/search - * @secure - */ - export namespace SearchGifs { - export type RequestParams = {}; - export type RequestQuery = { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = SearchGifsData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + * + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup + * @summary Set SCIM information for a provisioned enterprise group + * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams, + data: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF - * @tags gifs - * @name TranslateGif - * @summary Translate phrase to GIF - * @request GET:/gifs/translate - * @secure - */ - export namespace TranslateGif { - export type RequestParams = {}; - export type RequestQuery = { - /** Search term. */ - s: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TranslateGifData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser + * @summary Set SCIM information for a provisioned enterprise user + * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams, + data: EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. - * @tags gifs - * @name TrendingGifs - * @summary Trending GIFs - * @request GET:/gifs/trending - * @secure - */ - export namespace TrendingGifs { - export type RequestParams = {}; - export type RequestQuery = { - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TrendingGifsData; - } -} + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup + * @summary Update an attribute for a SCIM enterprise group + * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + */ + enterpriseAdminUpdateAttributeForEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminUpdateAttributeForEnterpriseGroupParams, + data: EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export namespace Stickers { - /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. - * @tags stickers - * @name RandomSticker - * @summary Random Sticker - * @request GET:/stickers/random - * @secure - */ - export namespace RandomSticker { - export type RequestParams = {}; - export type RequestQuery = { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = RandomStickerData; - } + /** + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseUser + * @summary Update an attribute for a SCIM enterprise user + * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + */ + enterpriseAdminUpdateAttributeForEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminUpdateAttributeForEnterpriseUserParams, + data: EnterpriseAdminUpdateAttributeForEnterpriseUserPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. - * @tags stickers - * @name SearchStickers - * @summary Search Stickers - * @request GET:/stickers/search - * @secure - */ - export namespace SearchStickers { - export type RequestParams = {}; - export type RequestQuery = { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = SearchStickersData; - } + /** + * No description + * + * @tags scim + * @name ScimDeleteUserFromOrg + * @summary Delete a SCIM user from an organization + * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimDeleteUserFromOrg: ( + { org, scimUserId }: ScimDeleteUserFromOrgParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "DELETE", + ...params, + }), - /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. - * @tags stickers - * @name TranslateSticker - * @summary Translate phrase to Sticker - * @request GET:/stickers/translate - * @secure - */ - export namespace TranslateSticker { - export type RequestParams = {}; - export type RequestQuery = { - /** Search term. */ - s: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TranslateStickerData; - } + /** + * No description + * + * @tags scim + * @name ScimGetProvisioningInformationForUser + * @summary Get SCIM provisioning information for a user + * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimGetProvisioningInformationForUser: ( + { org, scimUserId }: ScimGetProvisioningInformationForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "GET", + format: "json", + ...params, + }), - /** - * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. - * @tags stickers - * @name TrendingStickers - * @summary Trending Stickers - * @request GET:/stickers/trending - * @secure - */ - export namespace TrendingStickers { - export type RequestParams = {}; - export type RequestQuery = { - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = TrendingStickersData; - } -} + /** + * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. + * + * @tags scim + * @name ScimListProvisionedIdentities + * @summary List SCIM provisioned identities + * @request GET:/scim/v2/organizations/{org}/Users + */ + scimListProvisionedIdentities: ( + { org, ...query }: ScimListProvisionedIdentitiesParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * @description Provision organization membership for a user, and send an activation email to the email address. + * + * @tags scim + * @name ScimProvisionAndInviteUser + * @summary Provision and invite a SCIM user + * @request POST:/scim/v2/organizations/{org}/Users + */ + scimProvisionAndInviteUser: ( + { org }: ScimProvisionAndInviteUserParams, + data: ScimProvisionAndInviteUserPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -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; -} + /** + * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * + * @tags scim + * @name ScimSetInformationForProvisionedUser + * @summary Update a provisioned organization membership + * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimSetInformationForProvisionedUser: ( + { org, scimUserId }: ScimSetInformationForProvisionedUserParams, + data: ScimSetInformationForProvisionedUserPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * + * @tags scim + * @name ScimUpdateAttributeForUser + * @summary Update an attribute for a SCIM user + * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimUpdateAttributeForUser: ( + { org, scimUserId }: ScimUpdateAttributeForUserParams, + data: ScimUpdateAttributeForUserPayload, + params: RequestParams = {}, + ) => + this.request< + ScimUpdateAttributeForUserData, + ScimUpdateAttributeForUserError + >({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + search = { + /** + * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + * + * @tags search + * @name SearchCode + * @summary Search code + * @request GET:/search/code + */ + searchCode: (query: SearchCodeParams, params: RequestParams = {}) => + this.request< + SearchCodeData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/code\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` + * + * @tags search + * @name SearchCommits + * @summary Search commits + * @request GET:/search/commits + */ + searchCommits: (query: SearchCommitsParams, params: RequestParams = {}) => + this.request< + SearchCommitsData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/commits\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + * + * @tags search + * @name SearchIssuesAndPullRequests + * @summary Search issues and pull requests + * @request GET:/search/issues + */ + searchIssuesAndPullRequests: ( + query: SearchIssuesAndPullRequestsParams, + params: RequestParams = {}, + ) => + this.request< + SearchIssuesAndPullRequestsData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/issues\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -type CancelToken = Symbol | string | number; + /** + * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. + * + * @tags search + * @name SearchLabels + * @summary Search labels + * @request GET:/search/labels + */ + searchLabels: (query: SearchLabelsParams, params: RequestParams = {}) => + this.request({ + path: \`/search/labels\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export enum ContentType { - Json = "application/json", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} + /** + * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` + * + * @tags search + * @name SearchRepos + * @summary Search repositories + * @request GET:/search/repositories + */ + searchRepos: (query: SearchReposParams, params: RequestParams = {}) => + this.request< + SearchReposData, + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export class HttpClient { - public baseUrl: string = "https://api.giphy.com/v1"; - private securityData: SecurityDataType | null = null; - private securityWorker?: ApiConfig["securityWorker"]; - private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => - fetch(...fetchParams); + /** + * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. + * + * @tags search + * @name SearchTopics + * @summary Search topics + * @request GET:/search/topics + */ + searchTopics: (query: SearchTopicsParams, params: RequestParams = {}) => + this.request< + SearchTopicsData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/topics\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", + /** + * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + * + * @tags search + * @name SearchUsers + * @summary Search users + * @request GET:/search/users + */ + searchUsers: (query: SearchUsersParams, params: RequestParams = {}) => + this.request< + SearchUsersData, + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/users\`, + method: "GET", + query: query, + format: "json", + ...params, + }), }; + teams = { + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. + * + * @tags reactions + * @name ReactionsCreateForTeamDiscussionCommentLegacy + * @summary Create reaction for a team discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated + */ + reactionsCreateForTeamDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: ReactionsCreateForTeamDiscussionCommentLegacyParams, + data: ReactionsCreateForTeamDiscussionCommentLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. + * + * @tags reactions + * @name ReactionsCreateForTeamDiscussionLegacy + * @summary Create reaction for a team discussion (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + reactionsCreateForTeamDiscussionLegacy: ( + { + teamId, + discussionNumber, + }: ReactionsCreateForTeamDiscussionLegacyParams, + data: ReactionsCreateForTeamDiscussionLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; - }; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags reactions + * @name ReactionsListForTeamDiscussionCommentLegacy + * @summary List reactions for a team discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated + */ + reactionsListForTeamDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + ...query + }: ReactionsListForTeamDiscussionCommentLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected encodeQueryParam(key: string, value: any) { - const encodedKey = encodeURIComponent(key); - return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags reactions + * @name ReactionsListForTeamDiscussionLegacy + * @summary List reactions for a team discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + reactionsListForTeamDiscussionLegacy: ( + { + teamId, + discussionNumber, + ...query + }: ReactionsListForTeamDiscussionLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); - } + /** + * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags teams + * @name TeamsAddMemberLegacy + * @summary Add team member (Legacy) + * @request PUT:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsAddMemberLegacy: ( + { teamId, username }: TeamsAddMemberLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "PUT", + ...params, + }), - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserLegacy + * @summary Add or update team membership for a user (Legacy) + * @request PUT:/teams/{team_id}/memberships/{username} + * @deprecated + */ + teamsAddOrUpdateMembershipForUserLegacy: ( + { teamId, username }: TeamsAddOrUpdateMembershipForUserLegacyParams, + data: TeamsAddOrUpdateMembershipForUserLegacyPayload, + params: RequestParams = {}, + ) => + this.request< + TeamsAddOrUpdateMembershipForUserLegacyData, + TeamsAddOrUpdateMembershipForUserLegacyError + >({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - 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("&"); - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. + * + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsLegacy + * @summary Add or update team project permissions (Legacy) + * @request PUT:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + teamsAddOrUpdateProjectPermissionsLegacy: ( + { teamId, projectId }: TeamsAddOrUpdateProjectPermissionsLegacyParams, + data: TeamsAddOrUpdateProjectPermissionsLegacyPayload, + params: RequestParams = {}, + ) => + this.request< + TeamsAddOrUpdateProjectPermissionsLegacyData, + TeamsAddOrUpdateProjectPermissionsLegacyError + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsLegacy + * @summary Add or update team repository permissions (Legacy) + * @request PUT:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsAddOrUpdateRepoPermissionsLegacy: ( + { teamId, owner, repo }: TeamsAddOrUpdateRepoPermissionsLegacyParams, + data: TeamsAddOrUpdateRepoPermissionsLegacyPayload, + params: RequestParams = {}, + ) => + this.request< + TeamsAddOrUpdateRepoPermissionsLegacyData, + BasicError | ValidationError + >({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. + * + * @tags teams + * @name TeamsCheckPermissionsForProjectLegacy + * @summary Check team permissions for a project (Legacy) + * @request GET:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + teamsCheckPermissionsForProjectLegacy: ( + { teamId, projectId }: TeamsCheckPermissionsForProjectLegacyParams, + params: RequestParams = {}, + ) => + this.request< + TeamsCheckPermissionsForProjectLegacyData, + void | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "GET", + format: "json", + ...params, + }), - return 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), - }; + /** + * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * + * @tags teams + * @name TeamsCheckPermissionsForRepoLegacy + * @summary Check team permissions for a repository (Legacy) + * @request GET:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsCheckPermissionsForRepoLegacy: ( + { teamId, owner, repo }: TeamsCheckPermissionsForRepoLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "GET", + format: "json", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * + * @tags teams + * @name TeamsCreateDiscussionCommentLegacy + * @summary Create a discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated + */ + teamsCreateDiscussionCommentLegacy: ( + { teamId, discussionNumber }: TeamsCreateDiscussionCommentLegacyParams, + data: TeamsCreateDiscussionCommentLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - 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; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * + * @tags teams + * @name TeamsCreateDiscussionLegacy + * @summary Create a discussion (Legacy) + * @request POST:/teams/{team_id}/discussions + * @deprecated + */ + teamsCreateDiscussionLegacy: ( + { teamId }: TeamsCreateDiscussionLegacyParams, + data: TeamsCreateDiscussionLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. + * + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy + * @summary Create or update IdP group connections (Legacy) + * @request PATCH:/teams/{team_id}/team-sync/group-mappings + * @deprecated + */ + teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( + { teamId }: TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams, + data: TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload, + params: RequestParams = {}, + ) => + this.request< + TeamsCreateOrUpdateIdpGroupConnectionsLegacyData, + BasicError | ValidationError + >({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsDeleteDiscussionCommentLegacy + * @summary Delete a discussion comment (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + teamsDeleteDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: TeamsDeleteDiscussionCommentLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsDeleteDiscussionLegacy + * @summary Delete a discussion (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + teamsDeleteDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsDeleteDiscussionLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "DELETE", + ...params, + }), - 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; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * + * @tags teams + * @name TeamsDeleteLegacy + * @summary Delete a team (Legacy) + * @request DELETE:/teams/{team_id} + * @deprecated + */ + teamsDeleteLegacy: ( + { teamId }: TeamsDeleteLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}\`, + method: "DELETE", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsGetDiscussionCommentLegacy + * @summary Get a discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + teamsGetDiscussionCommentLegacy: ( { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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; + teamId, + discussionNumber, + commentNumber, + }: TeamsGetDiscussionCommentLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "GET", + format: "json", + ...params, + }), - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsGetDiscussionLegacy + * @summary Get a discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + teamsGetDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsGetDiscussionLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "GET", + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * + * @tags teams + * @name TeamsGetLegacy + * @summary Get a team (Legacy) + * @request GET:/teams/{team_id} + * @deprecated + */ + teamsGetLegacy: ( + { teamId }: TeamsGetLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}\`, + method: "GET", + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. + * + * @tags teams + * @name TeamsGetMemberLegacy + * @summary Get team member (Legacy) + * @request GET:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsGetMemberLegacy: ( + { teamId, username }: TeamsGetMemberLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "GET", + ...params, + }), -/** - * @title Giphy - * @version 1.0 - * @termsOfService https://developers.giphy.com/ - * @baseUrl https://api.giphy.com/v1 - * @externalDocs https://developers.giphy.com/docs/ - * @contact - * - * Giphy API - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { - gifs = { /** - * @description Returns a GIF given that GIF's unique ID + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). * - * @tags gifs - * @name GetGifById - * @summary Get GIF by Id - * @request GET:/gifs/{gifId} - * @secure + * @tags teams + * @name TeamsGetMembershipForUserLegacy + * @summary Get team membership for a user (Legacy) + * @request GET:/teams/{team_id}/memberships/{username} + * @deprecated */ - getGifById: ({ gifId }: GetGifByIdParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/\${gifId}\`, + teamsGetMembershipForUserLegacy: ( + { teamId, username }: TeamsGetMembershipForUserLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", - secure: true, format: "json", ...params, }), /** - * @description A multiget version of the get GIF by ID endpoint. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. * - * @tags gifs - * @name GetGifsById - * @summary Get GIFs by ID - * @request GET:/gifs - * @secure + * @tags teams + * @name TeamsListChildLegacy + * @summary List child teams (Legacy) + * @request GET:/teams/{team_id}/teams + * @deprecated */ - getGifsById: (query: GetGifsByIdParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs\`, + teamsListChildLegacy: ( + { teamId, ...query }: TeamsListChildLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/teams\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags gifs - * @name RandomGif - * @summary Random GIF - * @request GET:/gifs/random - * @secure + * @tags teams + * @name TeamsListDiscussionCommentsLegacy + * @summary List discussion comments (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - randomGif: (query: RandomGifParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/random\`, + teamsListDiscussionCommentsLegacy: ( + { + teamId, + discussionNumber, + ...query + }: TeamsListDiscussionCommentsLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags gifs - * @name SearchGifs - * @summary Search GIFs - * @request GET:/gifs/search - * @secure + * @tags teams + * @name TeamsListDiscussionsLegacy + * @summary List discussions (Legacy) + * @request GET:/teams/{team_id}/discussions + * @deprecated */ - searchGifs: (query: SearchGifsParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/search\`, + teamsListDiscussionsLegacy: ( + { teamId, ...query }: TeamsListDiscussionsLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. * - * @tags gifs - * @name TranslateGif - * @summary Translate phrase to GIF - * @request GET:/gifs/translate - * @secure + * @tags teams + * @name TeamsListIdpGroupsForLegacy + * @summary List IdP groups for a team (Legacy) + * @request GET:/teams/{team_id}/team-sync/group-mappings + * @deprecated */ - translateGif: (query: TranslateGifParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/translate\`, + teamsListIdpGroupsForLegacy: ( + { teamId }: TeamsListIdpGroupsForLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * + * @tags teams + * @name TeamsListMembersLegacy + * @summary List team members (Legacy) + * @request GET:/teams/{team_id}/members + * @deprecated + */ + teamsListMembersLegacy: ( + { teamId, ...query }: TeamsListMembersLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. * - * @tags gifs - * @name TrendingGifs - * @summary Trending GIFs - * @request GET:/gifs/trending - * @secure + * @tags teams + * @name TeamsListPendingInvitationsLegacy + * @summary List pending team invitations (Legacy) + * @request GET:/teams/{team_id}/invitations + * @deprecated */ - trendingGifs: (query: TrendingGifsParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/trending\`, + teamsListPendingInvitationsLegacy: ( + { teamId, ...query }: TeamsListPendingInvitationsLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/invitations\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), - }; - stickers = { + /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. * - * @tags stickers - * @name RandomSticker - * @summary Random Sticker - * @request GET:/stickers/random - * @secure + * @tags teams + * @name TeamsListProjectsLegacy + * @summary List team projects (Legacy) + * @request GET:/teams/{team_id}/projects + * @deprecated */ - randomSticker: (query: RandomStickerParams, params: RequestParams = {}) => - this.request({ - path: \`/stickers/random\`, + teamsListProjectsLegacy: ( + { teamId, ...query }: TeamsListProjectsLegacyParams, + params: RequestParams = {}, + ) => + this.request< + TeamsListProjectsLegacyData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), - + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * + * @tags teams + * @name TeamsListReposLegacy + * @summary List team repositories (Legacy) + * @request GET:/teams/{team_id}/repos + * @deprecated + */ + teamsListReposLegacy: ( + { teamId, ...query }: TeamsListReposLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * @tags teams + * @name TeamsRemoveMemberLegacy + * @summary Remove team member (Legacy) + * @request DELETE:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsRemoveMemberLegacy: ( + { teamId, username }: TeamsRemoveMemberLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "DELETE", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * @tags teams + * @name TeamsRemoveMembershipForUserLegacy + * @summary Remove team membership for a user (Legacy) + * @request DELETE:/teams/{team_id}/memberships/{username} + * @deprecated + */ + teamsRemoveMembershipForUserLegacy: ( + { teamId, username }: TeamsRemoveMembershipForUserLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "DELETE", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + * + * @tags teams + * @name TeamsRemoveProjectLegacy + * @summary Remove a project from a team (Legacy) + * @request DELETE:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + teamsRemoveProjectLegacy: ( + { teamId, projectId }: TeamsRemoveProjectLegacyParams, + params: RequestParams = {}, + ) => + this.request< + TeamsRemoveProjectLegacyData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + * + * @tags teams + * @name TeamsRemoveRepoLegacy + * @summary Remove a repository from a team (Legacy) + * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsRemoveRepoLegacy: ( + { teamId, owner, repo }: TeamsRemoveRepoLegacyParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "DELETE", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsUpdateDiscussionCommentLegacy + * @summary Update a discussion comment (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated + */ + teamsUpdateDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: TeamsUpdateDiscussionCommentLegacyParams, + data: TeamsUpdateDiscussionCommentLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags teams + * @name TeamsUpdateDiscussionLegacy + * @summary Update a discussion (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number} + * @deprecated + */ + teamsUpdateDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsUpdateDiscussionLegacyParams, + data: TeamsUpdateDiscussionLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. + * + * @tags teams + * @name TeamsUpdateLegacy + * @summary Update a team (Legacy) + * @request PATCH:/teams/{team_id} + * @deprecated + */ + teamsUpdateLegacy: ( + { teamId }: TeamsUpdateLegacyParams, + data: TeamsUpdateLegacyPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + user = { /** - * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. + * No description * - * @tags stickers - * @name SearchStickers - * @summary Search Stickers - * @request GET:/stickers/search - * @secure + * @tags activity + * @name ActivityCheckRepoIsStarredByAuthenticatedUser + * @summary Check if a repository is starred by the authenticated user + * @request GET:/user/starred/{owner}/{repo} */ - searchStickers: (query: SearchStickersParams, params: RequestParams = {}) => - this.request({ - path: \`/stickers/search\`, + activityCheckRepoIsStarredByAuthenticatedUser: ( + { owner, repo }: ActivityCheckRepoIsStarredByAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + ActivityCheckRepoIsStarredByAuthenticatedUserData, + ActivityCheckRepoIsStarredByAuthenticatedUserError + >({ + path: \`/user/starred/\${owner}/\${repo}\`, method: "GET", - query: query, - secure: true, - format: "json", ...params, }), /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. + * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: * - * @tags stickers - * @name TranslateSticker - * @summary Translate phrase to Sticker - * @request GET:/stickers/translate - * @secure + * @tags activity + * @name ActivityListReposStarredByAuthenticatedUser + * @summary List repositories starred by the authenticated user + * @request GET:/user/starred */ - translateSticker: ( - query: TranslateStickerParams, + activityListReposStarredByAuthenticatedUser: ( + query: ActivityListReposStarredByAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/stickers/translate\`, - method: "GET", - query: query, - secure: true, - format: "json", - ...params, - }), + this.request( + { + path: \`/user/starred\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), /** - * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. + * @description Lists repositories the authenticated user is watching. * - * @tags stickers - * @name TrendingStickers - * @summary Trending Stickers - * @request GET:/stickers/trending - * @secure + * @tags activity + * @name ActivityListWatchedReposForAuthenticatedUser + * @summary List repositories watched by the authenticated user + * @request GET:/user/subscriptions */ - trendingStickers: ( - query: TrendingStickersParams, + activityListWatchedReposForAuthenticatedUser: ( + query: ActivityListWatchedReposForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/stickers/trending\`, + this.request< + ActivityListWatchedReposForAuthenticatedUserData, + BasicError + >({ + path: \`/user/subscriptions\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), - }; -} -" -`; - -exports[`extended > 'issue-1057' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface MySchema { - not_working?: MySchemaNotWorkingEnum; - working?: MySchemaWorkingEnum; -} - -export enum MySchemaNotWorkingEnum { - PhoneNumber = "phone_number", -} - -export enum MySchemaWorkingEnum { - EmailAddress = "email_address", -} - -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -export class HttpClient { - public baseUrl: string = ""; - 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.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } - - return 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: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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 responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[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 No title - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient {} -" -`; - -exports[`extended > 'issue-1057' 2`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface MySchema { - not_working?: MySchemaNotWorkingEnum; - working?: MySchemaWorkingEnum; -} - -export enum MySchemaNotWorkingEnum { - PhoneNumber = "phone_number", -} - -export enum MySchemaWorkingEnum { - EmailAddress = "email_address", -} - -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -export class HttpClient { - public baseUrl: string = ""; - 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}\` : ""; - } + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags activity + * @name ActivityStarRepoForAuthenticatedUser + * @summary Star a repository for the authenticated user + * @request PUT:/user/starred/{owner}/{repo} + */ + activityStarRepoForAuthenticatedUser: ( + { owner, repo }: ActivityStarRepoForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + method: "PUT", + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * No description + * + * @tags activity + * @name ActivityUnstarRepoForAuthenticatedUser + * @summary Unstar a repository for the authenticated user + * @request DELETE:/user/starred/{owner}/{repo} + */ + activityUnstarRepoForAuthenticatedUser: ( + { owner, repo }: ActivityUnstarRepoForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + method: "DELETE", + ...params, + }), - return 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), - }; + /** + * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * + * @tags apps + * @name AppsAddRepoToInstallation + * @summary Add a repository to an app installation + * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + */ + appsAddRepoToInstallation: ( + { installationId, repositoryId }: AppsAddRepoToInstallationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "PUT", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } + /** + * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. + * + * @tags apps + * @name AppsListInstallationReposForAuthenticatedUser + * @summary List repositories accessible to the user access token + * @request GET:/user/installations/{installation_id}/repositories + */ + appsListInstallationReposForAuthenticatedUser: ( + { + installationId, + ...query + }: AppsListInstallationReposForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + AppsListInstallationReposForAuthenticatedUserData, + BasicError + >({ + path: \`/user/installations/\${installationId}/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - 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; - } + /** + * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. + * + * @tags apps + * @name AppsListInstallationsForAuthenticatedUser + * @summary List app installations accessible to the user access token + * @request GET:/user/installations + */ + appsListInstallationsForAuthenticatedUser: ( + query: AppsListInstallationsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + AppsListInstallationsForAuthenticatedUserData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/installations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUser + * @summary List subscriptions for the authenticated user + * @request GET:/user/marketplace_purchases + */ + appsListSubscriptionsForAuthenticatedUser: ( + query: AppsListSubscriptionsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/marketplace_purchases\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUserStubbed + * @summary List subscriptions for the authenticated user (stubbed) + * @request GET:/user/marketplace_purchases/stubbed + */ + appsListSubscriptionsForAuthenticatedUserStubbed: ( + query: AppsListSubscriptionsForAuthenticatedUserStubbedParams, + params: RequestParams = {}, + ) => + this.request< + AppsListSubscriptionsForAuthenticatedUserStubbedData, + BasicError + >({ + path: \`/user/marketplace_purchases/stubbed\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * + * @tags apps + * @name AppsRemoveRepoFromInstallation + * @summary Remove a repository from an app installation + * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + */ + appsRemoveRepoFromInstallation: ( + { installationId, repositoryId }: AppsRemoveRepoFromInstallationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "DELETE", + ...params, + }), - 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; + /** + * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. + * + * @tags interactions + * @name InteractionsGetRestrictionsForAuthenticatedUser + * @summary Get interaction restrictions for your public repositories + * @request GET:/user/interaction-limits + */ + interactionsGetRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/interaction-limits\`, + method: "GET", + format: "json", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), + /** + * @description Removes any interaction restrictions from your public repositories. + * + * @tags interactions + * @name InteractionsRemoveRestrictionsForAuthenticatedUser + * @summary Remove interaction restrictions from your public repositories + * @request DELETE:/user/interaction-limits + */ + interactionsRemoveRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => + this.request( + { + path: \`/user/interaction-limits\`, + method: "DELETE", + ...params, }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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 responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * + * @tags interactions + * @name InteractionsSetRestrictionsForAuthenticatedUser + * @summary Set interaction restrictions for your public repositories + * @request PUT:/user/interaction-limits + */ + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, + params: RequestParams = {}, + ) => + this.request< + InteractionsSetRestrictionsForAuthenticatedUserData, + ValidationError + >({ + path: \`/user/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * + * @tags issues + * @name IssuesListForAuthenticatedUser + * @summary List user account issues assigned to the authenticated user + * @request GET:/user/issues + */ + issuesListForAuthenticatedUser: ( + query: IssuesListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/issues\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * + * @tags migrations + * @name MigrationsDeleteArchiveForAuthenticatedUser + * @summary Delete a user migration archive + * @request DELETE:/user/migrations/{migration_id}/archive + */ + migrationsDeleteArchiveForAuthenticatedUser: ( + { migrationId }: MigrationsDeleteArchiveForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/user/migrations/\${migrationId}/archive\`, + method: "DELETE", + ...params, + }, + ), -/** - * @title No title - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient {} -" -`; + /** + * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. + * + * @tags migrations + * @name MigrationsGetArchiveForAuthenticatedUser + * @summary Download a user migration archive + * @request GET:/user/migrations/{migration_id}/archive + */ + migrationsGetArchiveForAuthenticatedUser: ( + { migrationId }: MigrationsGetArchiveForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/archive\`, + method: "GET", + ...params, + }), -exports[`extended > 'link-example' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ + /** + * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + * + * @tags migrations + * @name MigrationsGetStatusForAuthenticatedUser + * @summary Get a user migration status + * @request GET:/user/migrations/{migration_id} + */ + migrationsGetStatusForAuthenticatedUser: ( + { migrationId, ...query }: MigrationsGetStatusForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type GetPullRequestsByIdData = Pullrequest; + /** + * @description Lists all migrations a user has started. + * + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations + */ + migrationsListForAuthenticatedUser: ( + query: MigrationsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface GetPullRequestsByIdParams { - pid: string; - slug: string; - username: string; -} + /** + * @description Lists all the repositories for this user migration. + * + * @tags migrations + * @name MigrationsListReposForUser + * @summary List repositories for a user migration + * @request GET:/user/migrations/{migration_id}/repositories + */ + migrationsListReposForUser: ( + { migrationId, ...query }: MigrationsListReposForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type GetPullRequestsByRepositoryData = Pullrequest[]; + /** + * @description Initiates the generation of a user migration archive. + * + * @tags migrations + * @name MigrationsStartForAuthenticatedUser + * @summary Start a user migration + * @request POST:/user/migrations + */ + migrationsStartForAuthenticatedUser: ( + data: MigrationsStartForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => + this.request< + MigrationsStartForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/user/migrations\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export interface GetPullRequestsByRepositoryParams { - slug: string; - state?: StateEnum; - username: string; -} + /** + * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. + * + * @tags migrations + * @name MigrationsUnlockRepoForAuthenticatedUser + * @summary Unlock a user repository + * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + */ + migrationsUnlockRepoForAuthenticatedUser: ( + { migrationId, repoName }: MigrationsUnlockRepoForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, + method: "DELETE", + ...params, + }), -export enum GetPullRequestsByRepositoryParams1StateEnum { - Open = "open", - Merged = "merged", - Declined = "declined", -} + /** + * No description + * + * @tags orgs + * @name OrgsGetMembershipForAuthenticatedUser + * @summary Get an organization membership for the authenticated user + * @request GET:/user/memberships/orgs/{org} + */ + orgsGetMembershipForAuthenticatedUser: ( + { org }: OrgsGetMembershipForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/memberships/orgs/\${org}\`, + method: "GET", + format: "json", + ...params, + }), -export type GetRepositoriesByOwnerData = Repository[]; + /** + * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. + * + * @tags orgs + * @name OrgsListForAuthenticatedUser + * @summary List organizations for the authenticated user + * @request GET:/user/orgs + */ + orgsListForAuthenticatedUser: ( + query: OrgsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface GetRepositoriesByOwnerParams { - username: string; -} + /** + * No description + * + * @tags orgs + * @name OrgsListMembershipsForAuthenticatedUser + * @summary List organization memberships for the authenticated user + * @request GET:/user/memberships/orgs + */ + orgsListMembershipsForAuthenticatedUser: ( + query: OrgsListMembershipsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + OrgsListMembershipsForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/user/memberships/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type GetRepositoryData = Repository; + /** + * No description + * + * @tags orgs + * @name OrgsUpdateMembershipForAuthenticatedUser + * @summary Update an organization membership for the authenticated user + * @request PATCH:/user/memberships/orgs/{org} + */ + orgsUpdateMembershipForAuthenticatedUser: ( + { org }: OrgsUpdateMembershipForAuthenticatedUserParams, + data: OrgsUpdateMembershipForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => + this.request< + OrgsUpdateMembershipForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/user/memberships/orgs/\${org}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export interface GetRepositoryParams { - slug: string; - username: string; -} + /** + * No description + * + * @tags projects + * @name ProjectsCreateForAuthenticatedUser + * @summary Create a user project + * @request POST:/user/projects + */ + projectsCreateForAuthenticatedUser: ( + data: ProjectsCreateForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => + this.request< + ProjectsCreateForAuthenticatedUserData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/user/projects\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export type GetUserByNameData = User; + /** + * No description + * + * @tags repos + * @name ReposAcceptInvitation + * @summary Accept a repository invitation + * @request PATCH:/user/repository_invitations/{invitation_id} + */ + reposAcceptInvitation: ( + { invitationId }: ReposAcceptInvitationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repository_invitations/\${invitationId}\`, + method: "PATCH", + ...params, + }), -export interface GetUserByNameParams { - username: string; -} + /** + * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * + * @tags repos + * @name ReposCreateForAuthenticatedUser + * @summary Create a repository for the authenticated user + * @request POST:/user/repos + */ + reposCreateForAuthenticatedUser: ( + data: ReposCreateForAuthenticatedUserPayload, + params: RequestParams = {}, + ) => + this.request< + ReposCreateForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/user/repos\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export type MergePullRequestData = any; + /** + * No description + * + * @tags repos + * @name ReposDeclineInvitation + * @summary Decline a repository invitation + * @request DELETE:/user/repository_invitations/{invitation_id} + */ + reposDeclineInvitation: ( + { invitationId }: ReposDeclineInvitationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repository_invitations/\${invitationId}\`, + method: "DELETE", + ...params, + }), -export interface MergePullRequestParams { - pid: string; - slug: string; - username: string; -} + /** + * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * @tags repos + * @name ReposListForAuthenticatedUser + * @summary List repositories for the authenticated user + * @request GET:/user/repos + */ + reposListForAuthenticatedUser: ( + query: ReposListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + ReposListForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/user/repos\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface Pullrequest { - author?: User; - id?: number; - repository?: Repository; - title?: string; -} + /** + * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * + * @tags repos + * @name ReposListInvitationsForAuthenticatedUser + * @summary List repository invitations for the authenticated user + * @request GET:/user/repository_invitations + */ + reposListInvitationsForAuthenticatedUser: ( + query: ReposListInvitationsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repository_invitations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface Repository { - owner?: User; - slug?: string; -} + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). + * + * @tags teams + * @name TeamsListForAuthenticatedUser + * @summary List teams for the authenticated user + * @request GET:/user/teams + */ + teamsListForAuthenticatedUser: ( + query: TeamsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/teams\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export enum StateEnum { - Open = "open", - Merged = "merged", - Declined = "declined", -} + /** + * @description This endpoint is accessible with the \`user\` scope. + * + * @tags users + * @name UsersAddEmailForAuthenticated + * @summary Add an email address for the authenticated user + * @request POST:/user/emails + */ + usersAddEmailForAuthenticated: ( + data: UsersAddEmailForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersAddEmailForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/emails\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export interface User { - username?: string; - uuid?: string; -} + /** + * No description + * + * @tags users + * @name UsersBlock + * @summary Block a user + * @request PUT:/user/blocks/{username} + */ + usersBlock: ({ username }: UsersBlockParams, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "PUT", + ...params, + }), -export namespace V20 { - /** - * No description - * @name GetPullRequestsById - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} - * @link \`200.pullRequestMerge\` operationId:mergePullRequest - */ - export namespace GetPullRequestsById { - export type RequestParams = { - pid: string; - slug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetPullRequestsByIdData; - } + /** + * No description + * + * @tags users + * @name UsersCheckBlocked + * @summary Check if a user is blocked by the authenticated user + * @request GET:/user/blocks/{username} + */ + usersCheckBlocked: ( + { username }: UsersCheckBlockedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "GET", + ...params, + }), - /** - * No description - * @name GetPullRequestsByRepository - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests - */ - export namespace GetPullRequestsByRepository { - export type RequestParams = { - slug: string; - username: string; - }; - export type RequestQuery = { - state?: GetPullRequestsByRepositoryParams1StateEnum; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetPullRequestsByRepositoryData; - } + /** + * No description + * + * @tags users + * @name UsersCheckPersonIsFollowedByAuthenticated + * @summary Check if a person is followed by the authenticated user + * @request GET:/user/following/{username} + */ + usersCheckPersonIsFollowedByAuthenticated: ( + { username }: UsersCheckPersonIsFollowedByAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request< + UsersCheckPersonIsFollowedByAuthenticatedData, + UsersCheckPersonIsFollowedByAuthenticatedError + >({ + path: \`/user/following/\${username}\`, + method: "GET", + ...params, + }), - /** - * No description - * @name GetRepositoriesByOwner - * @request GET:/2.0/repositories/{username} - * @link \`200.userRepository\` operationId:getRepository - */ - export namespace GetRepositoriesByOwner { - export type RequestParams = { - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetRepositoriesByOwnerData; - } + /** + * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersCreateGpgKeyForAuthenticated + * @summary Create a GPG key for the authenticated user + * @request POST:/user/gpg_keys + */ + usersCreateGpgKeyForAuthenticated: ( + data: UsersCreateGpgKeyForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersCreateGpgKeyForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/gpg_keys\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * No description - * @name GetRepository - * @request GET:/2.0/repositories/{username}/{slug} - * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository - */ - export namespace GetRepository { - export type RequestParams = { - slug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetRepositoryData; - } + /** + * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersCreatePublicSshKeyForAuthenticated + * @summary Create a public SSH key for the authenticated user + * @request POST:/user/keys + */ + usersCreatePublicSshKeyForAuthenticated: ( + data: UsersCreatePublicSshKeyForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersCreatePublicSshKeyForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/keys\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - /** - * No description - * @name GetUserByName - * @request GET:/2.0/users/{username} - * @link \`200.userRepositories\` operationId:getRepositoriesByOwner - */ - export namespace GetUserByName { - export type RequestParams = { - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GetUserByNameData; - } + /** + * @description This endpoint is accessible with the \`user\` scope. + * + * @tags users + * @name UsersDeleteEmailForAuthenticated + * @summary Delete an email address for the authenticated user + * @request DELETE:/user/emails + */ + usersDeleteEmailForAuthenticated: ( + data: UsersDeleteEmailForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersDeleteEmailForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/emails\`, + method: "DELETE", + body: data, + type: ContentType.Json, + ...params, + }), - /** - * No description - * @name MergePullRequest - * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge - */ - export namespace MergePullRequest { - export type RequestParams = { - pid: string; - slug: string; - username: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = MergePullRequestData; - } -} + /** + * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersDeleteGpgKeyForAuthenticated + * @summary Delete a GPG key for the authenticated user + * @request DELETE:/user/gpg_keys/{gpg_key_id} + */ + usersDeleteGpgKeyForAuthenticated: ( + { gpgKeyId }: UsersDeleteGpgKeyForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request< + UsersDeleteGpgKeyForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/gpg_keys/\${gpgKeyId}\`, + method: "DELETE", + ...params, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersDeletePublicSshKeyForAuthenticated + * @summary Delete a public SSH key for the authenticated user + * @request DELETE:/user/keys/{key_id} + */ + usersDeletePublicSshKeyForAuthenticated: ( + { keyId }: UsersDeletePublicSshKeyForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/keys/\${keyId}\`, + method: "DELETE", + ...params, + }), -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; -} + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * + * @tags users + * @name UsersFollow + * @summary Follow a user + * @request PUT:/user/following/{username} + */ + usersFollow: ( + { username }: UsersFollowParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/following/\${username}\`, + method: "PUT", + ...params, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. + * + * @tags users + * @name UsersGetAuthenticated + * @summary Get the authenticated user + * @request GET:/user + */ + usersGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/user\`, + method: "GET", + format: "json", + ...params, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersGetGpgKeyForAuthenticated + * @summary Get a GPG key for the authenticated user + * @request GET:/user/gpg_keys/{gpg_key_id} + */ + usersGetGpgKeyForAuthenticated: ( + { gpgKeyId }: UsersGetGpgKeyForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys/\${gpgKeyId}\`, + method: "GET", + format: "json", + ...params, + }), -export interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersGetPublicSshKeyForAuthenticated + * @summary Get a public SSH key for the authenticated user + * @request GET:/user/keys/{key_id} + */ + usersGetPublicSshKeyForAuthenticated: ( + { keyId }: UsersGetPublicSshKeyForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/keys/\${keyId}\`, + method: "GET", + format: "json", + ...params, + }), -type CancelToken = Symbol | string | number; + /** + * @description List the users you've blocked on your personal account. + * + * @tags users + * @name UsersListBlockedByAuthenticated + * @summary List users blocked by the authenticated user + * @request GET:/user/blocks + */ + usersListBlockedByAuthenticated: (params: RequestParams = {}) => + this.request< + UsersListBlockedByAuthenticatedData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/blocks\`, + method: "GET", + format: "json", + ...params, + }), -export enum ContentType { - Json = "application/json", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} + /** + * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. + * + * @tags users + * @name UsersListEmailsForAuthenticated + * @summary List email addresses for the authenticated user + * @request GET:/user/emails + */ + usersListEmailsForAuthenticated: ( + query: UsersListEmailsForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/emails\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType | null = null; - private securityWorker?: ApiConfig["securityWorker"]; - private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => - fetch(...fetchParams); + /** + * @description Lists the people who the authenticated user follows. + * + * @tags users + * @name UsersListFollowedByAuthenticated + * @summary List the people the authenticated user follows + * @request GET:/user/following + */ + usersListFollowedByAuthenticated: ( + query: UsersListFollowedByAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/following\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; + /** + * @description Lists the people following the authenticated user. + * + * @tags users + * @name UsersListFollowersForAuthenticatedUser + * @summary List followers of the authenticated user + * @request GET:/user/followers + */ + usersListFollowersForAuthenticatedUser: ( + query: UsersListFollowersForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/followers\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersListGpgKeysForAuthenticated + * @summary List GPG keys for the authenticated user + * @request GET:/user/gpg_keys + */ + usersListGpgKeysForAuthenticated: ( + query: UsersListGpgKeysForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; - }; + /** + * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. + * + * @tags users + * @name UsersListPublicEmailsForAuthenticated + * @summary List public email addresses for the authenticated user + * @request GET:/user/public_emails + */ + usersListPublicEmailsForAuthenticated: ( + query: UsersListPublicEmailsForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/public_emails\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected encodeQueryParam(key: string, value: any) { - const encodedKey = encodeURIComponent(key); - return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; - } + /** + * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersListPublicSshKeysForAuthenticated + * @summary List public SSH keys for the authenticated user + * @request GET:/user/keys + */ + usersListPublicSshKeysForAuthenticated: ( + query: UsersListPublicSshKeysForAuthenticatedParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); - } + /** + * @description Sets the visibility for your primary email addresses. + * + * @tags users + * @name UsersSetPrimaryEmailVisibilityForAuthenticated + * @summary Set primary email visibility for the authenticated user + * @request PATCH:/user/email/visibility + */ + usersSetPrimaryEmailVisibilityForAuthenticated: ( + data: UsersSetPrimaryEmailVisibilityForAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request< + UsersSetPrimaryEmailVisibilityForAuthenticatedData, + BasicError | ValidationError + >({ + path: \`/user/email/visibility\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); - } + /** + * No description + * + * @tags users + * @name UsersUnblock + * @summary Unblock a user + * @request DELETE:/user/blocks/{username} + */ + usersUnblock: ( + { username }: UsersUnblockParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "DELETE", + ...params, + }), - 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("&"); - } + /** + * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * + * @tags users + * @name UsersUnfollow + * @summary Unfollow a user + * @request DELETE:/user/following/{username} + */ + usersUnfollow: ( + { username }: UsersUnfollowParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/following/\${username}\`, + method: "DELETE", + ...params, + }), - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. + * + * @tags users + * @name UsersUpdateAuthenticated + * @summary Update the authenticated user + * @request PATCH:/user + */ + usersUpdateAuthenticated: ( + data: UsersUpdateAuthenticatedPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + users = { + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * + * @tags activity + * @name ActivityListEventsForAuthenticatedUser + * @summary List events for the authenticated user + * @request GET:/users/{username}/events + */ + activityListEventsForAuthenticatedUser: ( + { username, ...query }: ActivityListEventsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * + * @tags activity + * @name ActivityListOrgEventsForAuthenticatedUser + * @summary List organization events for the authenticated user + * @request GET:/users/{username}/events/orgs/{org} + */ + activityListOrgEventsForAuthenticatedUser: ( + { + username, + org, + ...query + }: ActivityListOrgEventsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events/orgs/\${org}\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - return 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), - }; + /** + * No description + * + * @tags activity + * @name ActivityListPublicEventsForUser + * @summary List public events for a user + * @request GET:/users/{username}/events/public + */ + activityListPublicEventsForUser: ( + { username, ...query }: ActivityListPublicEventsForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events/public\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } + /** + * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. + * + * @tags activity + * @name ActivityListReceivedEventsForUser + * @summary List events received by the authenticated user + * @request GET:/users/{username}/received_events + */ + activityListReceivedEventsForUser: ( + { username, ...query }: ActivityListReceivedEventsForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/received_events\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - 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; - } + /** + * No description + * + * @tags activity + * @name ActivityListReceivedPublicEventsForUser + * @summary List public events received by a user + * @request GET:/users/{username}/received_events/public + */ + activityListReceivedPublicEventsForUser: ( + { username, ...query }: ActivityListReceivedPublicEventsForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/received_events/public\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * + * @tags activity + * @name ActivityListReposStarredByUser + * @summary List repositories starred by a user + * @request GET:/users/{username}/starred + */ + activityListReposStarredByUser: ( + { username, ...query }: ActivityListReposStarredByUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/starred\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description Lists repositories a user is watching. + * + * @tags activity + * @name ActivityListReposWatchedByUser + * @summary List repositories watched by a user + * @request GET:/users/{username}/subscriptions + */ + activityListReposWatchedByUser: ( + { username, ...query }: ActivityListReposWatchedByUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/subscriptions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * @tags apps + * @name AppsGetUserInstallation + * @summary Get a user installation for the authenticated app + * @request GET:/users/{username}/installation + */ + appsGetUserInstallation: ( + { username }: AppsGetUserInstallationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/installation\`, + method: "GET", + format: "json", + ...params, + }), - 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; + /** + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetGithubActionsBillingUser + * @summary Get GitHub Actions billing for a user + * @request GET:/users/{username}/settings/billing/actions + */ + billingGetGithubActionsBillingUser: ( + { username }: BillingGetGithubActionsBillingUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/actions\`, + method: "GET", + format: "json", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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; + /** + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetGithubPackagesBillingUser + * @summary Get GitHub Packages billing for a user + * @request GET:/users/{username}/settings/billing/packages + */ + billingGetGithubPackagesBillingUser: ( + { username }: BillingGetGithubPackagesBillingUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/packages\`, + method: "GET", + format: "json", + ...params, + }), - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetSharedStorageBillingUser + * @summary Get shared storage billing for a user + * @request GET:/users/{username}/settings/billing/shared-storage + */ + billingGetSharedStorageBillingUser: ( + { username }: BillingGetSharedStorageBillingUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/shared-storage\`, + method: "GET", + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description Lists public gists for the specified user: + * + * @tags gists + * @name GistsListForUser + * @summary List gists for a user + * @request GET:/users/{username}/gists + */ + gistsListForUser: ( + { username, ...query }: GistsListForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/gists\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + * + * @tags orgs + * @name OrgsListForUser + * @summary List organizations for a user + * @request GET:/users/{username}/orgs + */ + orgsListForUser: ( + { username, ...query }: OrgsListForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -/** - * @title Link Example - * @version 1.0.0 - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { - v20 = { /** * No description * - * @name GetPullRequestsById - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} - * @link \`200.pullRequestMerge\` operationId:mergePullRequest + * @tags projects + * @name ProjectsListForUser + * @summary List user projects + * @request GET:/users/{username}/projects */ - getPullRequestsById: ( - { username, slug, pid }: GetPullRequestsByIdParams, + projectsListForUser: ( + { username, ...query }: ProjectsListForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, + this.request< + ProjectsListForUserData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/users/\${username}/projects\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists public repositories for the specified user. * - * @name GetPullRequestsByRepository - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests + * @tags repos + * @name ReposListForUser + * @summary List repositories for a user + * @request GET:/users/{username}/repos */ - getPullRequestsByRepository: ( - { username, slug, ...query }: GetPullRequestsByRepositoryParams, + reposListForUser: ( + { username, ...query }: ReposListForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests\`, + this.request({ + path: \`/users/\${username}/repos\`, method: "GET", query: query, format: "json", @@ -68140,70 +67188,170 @@ export class Api< /** * No description * - * @name GetRepositoriesByOwner - * @request GET:/2.0/repositories/{username} - * @link \`200.userRepository\` operationId:getRepository + * @tags users + * @name UsersCheckFollowingForUser + * @summary Check if a user follows another user + * @request GET:/users/{username}/following/{target_user} */ - getRepositoriesByOwner: ( - { username }: GetRepositoriesByOwnerParams, + usersCheckFollowingForUser: ( + { username, targetUser }: UsersCheckFollowingForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/repositories/\${username}\`, + this.request({ + path: \`/users/\${username}/following/\${targetUser}\`, + method: "GET", + ...params, + }), + + /** + * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + * + * @tags users + * @name UsersGetByUsername + * @summary Get a user + * @request GET:/users/{username} + */ + usersGetByUsername: ( + { username }: UsersGetByUsernameParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` * - * @name GetRepository - * @request GET:/2.0/repositories/{username}/{slug} - * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository + * @tags users + * @name UsersGetContextForUser + * @summary Get contextual information for a user + * @request GET:/users/{username}/hovercard */ - getRepository: ( - { username, slug }: GetRepositoryParams, + usersGetContextForUser: ( + { username, ...query }: UsersGetContextForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}\`, + this.request({ + path: \`/users/\${username}/hovercard\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. * - * @name GetUserByName - * @request GET:/2.0/users/{username} - * @link \`200.userRepositories\` operationId:getRepositoriesByOwner + * @tags users + * @name UsersList + * @summary List users + * @request GET:/users */ - getUserByName: ( - { username }: GetUserByNameParams, + usersList: (query: UsersListParams, params: RequestParams = {}) => + this.request({ + path: \`/users\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Lists the people following the specified user. + * + * @tags users + * @name UsersListFollowersForUser + * @summary List followers of a user + * @request GET:/users/{username}/followers + */ + usersListFollowersForUser: ( + { username, ...query }: UsersListFollowersForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/users/\${username}\`, + this.request({ + path: \`/users/\${username}/followers\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Lists the people who the specified user follows. * - * @name MergePullRequest - * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge + * @tags users + * @name UsersListFollowingForUser + * @summary List the people a user follows + * @request GET:/users/{username}/following */ - mergePullRequest: ( - { username, slug, pid }: MergePullRequestParams, + usersListFollowingForUser: ( + { username, ...query }: UsersListFollowingForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, - method: "POST", + this.request({ + path: \`/users/\${username}/following\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Lists the GPG keys for a user. This information is accessible by anyone. + * + * @tags users + * @name UsersListGpgKeysForUser + * @summary List GPG keys for a user + * @request GET:/users/{username}/gpg_keys + */ + usersListGpgKeysForUser: ( + { username, ...query }: UsersListGpgKeysForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/gpg_keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * + * @tags users + * @name UsersListPublicKeysForUser + * @summary List public keys for a user + * @request GET:/users/{username}/keys + */ + usersListPublicKeysForUser: ( + { username, ...query }: UsersListPublicKeysForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + zen = { + /** + * @description Get a random sentence from the Zen of GitHub + * + * @tags meta + * @name MetaGetZen + * @summary Get the Zen of GitHub + * @request GET:/zen + */ + metaGetZen: (params: RequestParams = {}) => + this.request({ + path: \`/zen\`, + method: "GET", ...params, }), }; diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 2b89a9112..3d2de8f53 100644 --- a/tests/__snapshots__/simple.test.ts.snap +++ b/tests/__snapshots__/simple.test.ts.snap @@ -8523,7 +8523,7 @@ export class Api< " `; -exports[`simple > 'full-swagger-scheme' 1`] = ` +exports[`simple > 'furkot-example' 1`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -8536,3798 +8536,3130 @@ exports[`simple > 'full-swagger-scheme' 1`] = ` * --------------------------------------------------------------- */ -export interface ActionsBillingUsage { - /** The amount of free GitHub Actions minutes available. */ - included_minutes: number; - minutes_used_breakdown: { - /** Total minutes used on macOS runner machines. */ - MACOS?: number; - /** Total minutes used on Ubuntu runner machines. */ - UBUNTU?: number; - /** Total minutes used on Windows runner machines. */ - WINDOWS?: number; +export interface Step { + /** address of the stop */ + address?: string; + /** + * arrival at the stop in its local timezone as YYYY-MM-DDThh:mm + * @format date-time + */ + arrival?: string; + /** geographical coordinates of the stop */ + coordinates?: { + /** + * latitude + * @format float + */ + lat?: number; + /** + * longitude + * @format float + */ + lon?: number; }; - /** The sum of the free and paid GitHub Actions minutes used. */ - total_minutes_used: number; - /** The total paid GitHub Actions minutes used. */ - total_paid_minutes_used: number; -} - -/** Whether GitHub Actions is enabled on the repository. */ -export type ActionsEnabled = boolean; - -export interface ActionsEnterprisePermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_organizations: EnabledOrganizations; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; - /** The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when \`enabled_organizations\` is set to \`selected\`. */ - selected_organizations_url?: string; -} - -export interface ActionsOrganizationPermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_repositories: EnabledRepositories; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; - /** The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when \`enabled_repositories\` is set to \`selected\`. */ - selected_repositories_url?: string; -} - -/** - * ActionsPublicKey - * The public key used for setting Actions Secrets. - */ -export interface ActionsPublicKey { - /** @example "2011-01-26T19:01:12Z" */ - created_at?: string; - /** @example 2 */ - id?: number; /** - * The Base64 encoded public key. - * @example "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=" + * departure from the stop in its local timezone as YYYY-MM-DDThh:mm + * @format date-time */ - key: string; + departure?: string; + /** name of the stop */ + name?: string; /** - * The identifier for the key. - * @example "1234567" + * number of nights + * @format int64 */ - key_id: string; - /** @example "ssh-rsa AAAAB3NzaC1yc2EAAA" */ - title?: string; - /** @example "https://api.github.com/user/keys/2" */ + nights?: number; + /** route leading to the stop */ + route?: { + /** + * route distance in meters + * @format int64 + */ + distance?: number; + /** + * route duration in seconds + * @format int64 + */ + duration?: number; + /** travel mode */ + mode?: "car" | "motorcycle" | "bicycle" | "walk" | "other"; + /** route path compatible with Google polyline encoding algorithm */ + polyline?: string; + }; + /** url of the page with more information about the stop */ url?: string; } -export interface ActionsRepositoryPermissions { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions: AllowedActions; - /** Whether GitHub Actions is enabled on the repository. */ - enabled: ActionsEnabled; - /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ - selected_actions_url?: SelectedActionsUrl; -} - -/** - * Actions Secret - * Set secrets for GitHub Actions. - */ -export interface ActionsSecret { - /** @format date-time */ - created_at: string; +export interface Trip { /** - * The name of the secret. - * @example "SECRET_TOKEN" + * begin of the trip in its local timezone as YYYY-MM-DDThh:mm + * @format date-time */ - name: string; - /** @format date-time */ - updated_at: string; + begin?: string; + /** description of the trip (truncated to 200 characters) */ + description?: string; + /** + * end of the trip in its local timezone as YYYY-MM-DDThh:mm + * @format date-time + */ + end?: string; + /** Unique ID of the trip */ + id?: string; + /** name of the trip */ + name?: string; } -/** - * Actor - * Actor - */ -export interface Actor { - /** @format uri */ - avatar_url: string; - display_login?: string; - gravatar_id: string | null; - id: number; - login: string; - /** @format uri */ - url: 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; } -/** - * The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time - */ -export type AlertCreatedAt = string; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -/** - * The GitHub URL of the alert resource. - * @format uri - */ -export type AlertHtmlUrl = string; +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} -/** The security alert number. */ -export type AlertNumber = number; +export interface HttpResponse + extends Response { + data: D; + error: E; +} -/** - * The REST API URL of the alert resource. - * @format uri - */ -export type AlertUrl = string; +type CancelToken = Symbol | string | number; -/** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ -export enum AllowedActions { - All = "all", - LocalOnly = "local_only", - Selected = "selected", +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", } -/** - * Api Overview - * Api Overview - */ -export interface ApiOverview { - /** @example ["13.64.0.0/16","13.65.0.0/16"] */ - actions?: string[]; - /** @example ["127.0.0.1/32"] */ - api?: string[]; - /** @example ["127.0.0.1/32"] */ - git?: string[]; - /** @example ["127.0.0.1/32"] */ - hooks?: string[]; - /** @example ["54.158.161.132","54.226.70.38"] */ - importer?: string[]; - /** @example ["192.30.252.153/32","192.30.252.154/32"] */ - pages?: string[]; - ssh_key_fingerprints?: { - SHA256_DSA?: string; - SHA256_RSA?: string; - }; - /** @example true */ - verifiable_password_authentication: boolean; - /** @example ["127.0.0.1/32"] */ - web?: string[]; -} +export class HttpClient { + public baseUrl: string = "https://trips.furkot.com/pub/api"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); -/** - * App Permissions - * The permissions granted to the user-to-server access token. - * @example {"contents":"read","issues":"read","deployments":"write","single_file":"read"} - */ -export interface AppPermissions { - /** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ - actions?: "read" | "write"; - /** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ - administration?: "read" | "write"; - /** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ - checks?: "read" | "write"; - /** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ - content_references?: "read" | "write"; - /** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ - contents?: "read" | "write"; - /** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ - deployments?: "read" | "write"; - /** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ - environments?: "read" | "write"; - /** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ - issues?: "read" | "write"; - /** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ - members?: "read" | "write"; - /** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ - metadata?: "read" | "write"; - /** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ - organization_administration?: "read" | "write"; - /** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ - organization_hooks?: "read" | "write"; - /** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ - organization_plan?: "read"; - /** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ - organization_projects?: "read" | "write" | "admin"; - /** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ - organization_secrets?: "read" | "write"; - /** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ - organization_self_hosted_runners?: "read" | "write"; - /** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ - organization_user_blocking?: "read" | "write"; - /** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ - packages?: "read" | "write"; - /** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ - pages?: "read" | "write"; - /** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ - pull_requests?: "read" | "write"; - /** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ - repository_hooks?: "read" | "write"; - /** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ - repository_projects?: "read" | "write" | "admin"; - /** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ - secret_scanning_alerts?: "read" | "write"; - /** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ - secrets?: "read" | "write"; - /** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ - security_events?: "read" | "write"; - /** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ - single_file?: "read" | "write"; - /** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ - statuses?: "read" | "write"; - /** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ - team_discussions?: "read" | "write"; - /** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ - vulnerability_alerts?: "read"; - /** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ - workflows?: "write"; -} + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; -/** - * Application Grant - * The authorization associated with an OAuth Access. - */ -export interface ApplicationGrant { - app: { - client_id: string; - name: string; - /** @format uri */ - url: string; + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; }; - /** - * @format date-time - * @example "2011-09-06T17:26:27Z" - */ - created_at: string; - /** @example 1 */ - id: number; - /** @example ["public_repo"] */ - scopes: string[]; - /** - * @format date-time - * @example "2011-09-06T20:39:23Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/applications/grants/1" - */ - url: string; - user?: SimpleUser | null; -} -/** - * Artifact - * An artifact - */ -export interface Artifact { - /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip" */ - archive_download_url: string; - /** @format date-time */ - created_at: string | null; - /** Whether or not the artifact has expired. */ - expired: boolean; - /** @format date-time */ - expires_at: string; - /** @example 5 */ - id: number; - /** - * The name of the artifact. - * @example "AdventureWorks.Framework" - */ - name: string; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - /** - * The size in bytes of the artifact. - * @example 12345 - */ - size_in_bytes: number; - /** @format date-time */ - updated_at: string | null; - /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5" */ - url: string; -} + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } -export interface AuditLogEvent { - /** The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ - "@timestamp"?: number; - /** The name of the action that was performed, for example \`user.login\` or \`repo.create\`. */ - action?: string; - active?: boolean; - active_was?: boolean; - /** The actor who performed the action. */ - actor?: string; - /** The username of the account being blocked. */ - blocked_user?: string; - business?: string; - config?: any[]; - config_was?: any[]; - content_type?: string; - /** The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ - created_at?: number; - deploy_key_fingerprint?: string; - emoji?: string; - events?: any[]; - events_were?: any[]; - explanation?: string; - fingerprint?: string; - hook_id?: number; - limited_availability?: boolean; - message?: string; - name?: string; - old_user?: string; - openssh_public_key?: string; - org?: string; - previous_visibility?: string; - read_only?: boolean; - /** The name of the repository. */ - repo?: string; - /** The name of the repository. */ - repository?: string; - repository_public?: boolean; - target_login?: string; - team?: string; - /** The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ - transport_protocol?: number; - /** A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ - transport_protocol_name?: string; - /** The user that was affected by the action performed (if available). */ - user?: string; - /** The repository visibility, for example \`public\` or \`private\`. */ - visibility?: string; -} + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } -/** - * Authentication Token - * Authentication Token - */ -export interface AuthenticationToken { - /** - * The time this token expires - * @format date-time - * @example "2016-07-11T22:14:10Z" - */ - expires_at: string; - /** @example {"issues":"read","deployments":"write"} */ - permissions?: object; - /** The repositories this token has access to */ - repositories?: Repository[]; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection?: "all" | "selected"; - /** @example "config.yaml" */ - single_file?: string | null; - /** - * The token used for authentication - * @example "v1.1f699f1069f60xxx" - */ - token: string; -} + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } -/** - * author_association - * How the author is associated with the repository. - * @example "OWNER" - */ -export enum AuthorAssociation { - COLLABORATOR = "COLLABORATOR", - CONTRIBUTOR = "CONTRIBUTOR", - FIRST_TIMER = "FIRST_TIMER", - FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR", - MANNEQUIN = "MANNEQUIN", - MEMBER = "MEMBER", - NONE = "NONE", - OWNER = "OWNER", -} + 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("&"); + } -/** - * Authorization - * The authorization for an OAuth app, GitHub App, or a Personal Access Token. - */ -export interface Authorization { - app: { - client_id: string; - name: string; - /** @format uri */ - url: string; + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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), }; - /** @format date-time */ - created_at: string; - fingerprint: string | null; - hashed_token: string | null; - id: number; - installation?: ScopedInstallation | null; - note: string | null; - /** @format uri */ - note_url: string | null; - /** A list of scopes that this authorization is in. */ - scopes: string[] | null; - token: string; - token_last_eight: string | null; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user?: SimpleUser | null; -} -/** - * Auto merge - * The status of auto merging a pull request. - */ -export type AutoMerge = { - /** Commit message for the merge commit. */ - commit_message: string; - /** Title for the merge commit message. */ - commit_title: string; - /** Simple User */ - enabled_by: SimpleUser; - /** The merge method to use. */ - merge_method: "merge" | "squash" | "rebase"; -} | null; + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } -/** - * Base Gist - * Base Gist - */ -export interface BaseGist { - comments: number; - /** @format uri */ - comments_url: string; - /** @format uri */ - commits_url: string; - /** @format date-time */ - created_at: string; - description: string | null; - files: Record< - string, - { - filename?: string; - language?: string; - raw_url?: string; - size?: number; - type?: string; + 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; } - >; - forks?: any[]; - /** @format uri */ - forks_url: string; - /** @format uri */ - git_pull_url: string; - /** @format uri */ - git_push_url: string; - history?: any[]; - /** @format uri */ - html_url: string; - id: string; - node_id: string; - owner?: SimpleUser | null; - public: boolean; - truncated?: boolean; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user: SimpleUser | null; -} -/** - * Basic Error - * Basic Error - */ -export interface BasicError { - documentation_url?: string; - message?: string; -} + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; -/** - * Blob - * Blob - */ -export interface Blob { - content: string; - encoding: string; - highlighted_content?: string; - node_id: string; - sha: string; - size: number | null; - /** @format uri */ - url: string; -} + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); -/** - * Branch Protection - * Branch Protection - */ -export interface BranchProtection { - allow_deletions?: { - enabled?: boolean; - }; - allow_force_pushes?: { - enabled?: boolean; - }; - enabled: boolean; - /** Protected Branch Admin Enforced */ - enforce_admins?: ProtectedBranchAdminEnforced; - /** @example ""branch/with/protection"" */ - name?: string; - /** @example ""https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection"" */ - protection_url?: string; - required_linear_history?: { - enabled?: boolean; - }; - /** Protected Branch Pull Request Review */ - required_pull_request_reviews?: ProtectedBranchPullRequestReview; - required_status_checks: { - contexts: string[]; - contexts_url?: string; - enforcement_level: string; - url?: string; + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } }; - /** Branch Restriction Policy */ - restrictions?: BranchRestrictionPolicy; - url?: string; -} -/** - * Branch Restriction Policy - * Branch Restriction Policy - */ -export interface BranchRestrictionPolicy { - apps: { - created_at?: string; - description?: string; - events?: string[]; - external_url?: string; - html_url?: string; - id?: number; - name?: string; - node_id?: string; - owner?: { - avatar_url?: string; - description?: string; - events_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers"" */ - followers_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}"" */ - following_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}"" */ - gists_url?: string; - /** @example """" */ - gravatar_id?: string; - hooks_url?: string; - /** @example ""https://github.com/testorg-ea8ec76d71c3af4b"" */ - html_url?: string; - id?: number; - issues_url?: string; - login?: string; - members_url?: string; - node_id?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs"" */ - organizations_url?: string; - public_members_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events"" */ - received_events_url?: string; - repos_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}"" */ - starred_url?: string; - /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions"" */ - subscriptions_url?: string; - /** @example ""Organization"" */ - type?: string; - url?: string; - }; - permissions?: { - contents?: string; - issues?: string; - metadata?: string; - single_file?: string; - }; - slug?: string; - updated_at?: string; - }[]; - /** @format uri */ - apps_url: string; - teams: { - description?: string | null; - html_url?: string; - id?: number; - members_url?: string; - name?: string; - node_id?: string; - parent?: string | null; - permission?: string; - privacy?: string; - repositories_url?: string; - slug?: string; - url?: string; - }[]; - /** @format uri */ - teams_url: string; - /** @format uri */ - url: string; - users: { - avatar_url?: string; - events_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string; - html_url?: string; - id?: number; - login?: string; - node_id?: string; - organizations_url?: string; - received_events_url?: string; - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - subscriptions_url?: string; - type?: string; - url?: string; - }[]; - /** @format uri */ - users_url: string; -} + 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; -/** - * Branch Short - * Branch Short - */ -export interface BranchShort { - commit: { - sha: string; - url: string; + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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; + }); }; - name: string; - protected: boolean; } /** - * Branch With Protection - * Branch With Protection + * @title Furkot Trips + * @version 1.0.0 + * @baseUrl https://trips.furkot.com/pub/api + * @externalDocs https://help.furkot.com/widgets/furkot-api.html + * @contact + * + * Furkot provides Rest API to access user trip data. + * Using Furkot API an application can list user trips and display stops for a specific trip. + * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. */ -export interface BranchWithProtection { - _links: { - html: string; - /** @format uri */ - self: string; +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + trip = { + /** + * @description list user's trips + * + * @name TripList + * @request GET:/trip + * @secure + */ + tripList: (params: RequestParams = {}) => + this.request({ + path: \`/trip\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description list stops for a trip identified by {trip_id} + * + * @name StopList + * @request GET:/trip/{trip_id}/stop + * @secure + */ + stopList: (tripId: string, params: RequestParams = {}) => + this.request({ + path: \`/trip/\${tripId}/stop\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), }; - /** Commit */ - commit: Commit; - name: string; - /** @example ""mas*"" */ - pattern?: string; - protected: boolean; - /** Branch Protection */ - protection: BranchProtection; - /** @format uri */ - protection_url: string; - /** @example 1 */ - required_approving_review_count?: number; } +" +`; -/** - * Check Annotation - * Check Annotation +exports[`simple > 'giphy' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- */ -export interface CheckAnnotation { - /** @example "warning" */ - annotation_level: string | null; - blob_href: string; - /** @example 10 */ - end_column: number | null; - /** @example 2 */ - end_line: number; - /** @example "Check your spelling for 'banaas'." */ - message: string | null; - /** @example "README.md" */ - path: string; - /** @example "Do you mean 'bananas' or 'banana'?" */ - raw_details: string | null; - /** @example 5 */ - start_column: number | null; - /** @example 2 */ - start_line: number; - /** @example "Spell Checker" */ - title: string | null; -} -/** - * CheckRun - * A check performed on the code of a given code change - */ -export interface CheckRun { - app: Integration | null; - check_suite: { - id: number; - } | null; +export interface Gif { + /** + * The unique bit.ly URL for this GIF + * @example "http://gph.is/1gsWDcL" + */ + bitly_url?: string; + /** Currently unused */ + content_url?: string; /** + * The date this GIF was added to the GIPHY database. * @format date-time - * @example "2018-05-04T01:14:52Z" + * @example "2013-08-01 12:41:48" */ - completed_at: string | null; - /** @example "neutral" */ - conclusion: - | "success" - | "failure" - | "neutral" - | "cancelled" - | "skipped" - | "timed_out" - | "action_required" - | null; - /** @example "https://example.com" */ - details_url: string | null; - /** @example "42" */ - external_id: string | null; + create_datetime?: string; /** - * The SHA of the commit that is being checked. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * A URL used for embedding this GIF + * @example "http://giphy.com/embed/YsTs5ltWtEhnq" */ - head_sha: string; - /** @example "https://github.com/github/hello-world/runs/4" */ - html_url: string | null; + embded_url?: string; + /** An array of featured tags for this GIF (Note: Not available when using the Public Beta Key) */ + featured_tags?: string[]; /** - * The id of the check. - * @example 21 + * This GIF's unique ID + * @example "YsTs5ltWtEhnq" */ - id: number; + id?: string; + /** An object containing data for various available formats and sizes of this GIF. */ + images?: { + /** Data surrounding a version of this GIF downsized to be under 2mb. */ + downsized?: Image; + /** Data surrounding a version of this GIF downsized to be under 8mb. */ + downsized_large?: Image; + /** Data surrounding a version of this GIF downsized to be under 5mb. */ + downsized_medium?: Image; + /** Data surrounding a version of this GIF downsized to be under 200kb. */ + downsized_small?: Image; + /** Data surrounding a static preview image of the downsized version of this GIF. */ + downsized_still?: Image; + /** Data surrounding versions of this GIF with a fixed height of 200 pixels. Good for mobile use. */ + fixed_height?: Image; + /** Data surrounding versions of this GIF with a fixed height of 200 pixels and the number of frames reduced to 6. */ + fixed_height_downsampled?: Image; + /** Data surrounding versions of this GIF with a fixed height of 100 pixels. Good for mobile keyboards. */ + fixed_height_small?: Image; + /** Data surrounding a static image of this GIF with a fixed height of 100 pixels. */ + fixed_height_small_still?: Image; + /** Data surrounding a static image of this GIF with a fixed height of 200 pixels. */ + fixed_height_still?: Image; + /** Data surrounding versions of this GIF with a fixed width of 200 pixels. Good for mobile use. */ + fixed_width?: Image; + /** Data surrounding versions of this GIF with a fixed width of 200 pixels and the number of frames reduced to 6. */ + fixed_width_downsampled?: Image; + /** Data surrounding versions of this GIF with a fixed width of 100 pixels. Good for mobile keyboards. */ + fixed_width_small?: Image; + /** Data surrounding a static image of this GIF with a fixed width of 100 pixels. */ + fixed_width_small_still?: Image; + /** Data surrounding a static image of this GIF with a fixed width of 200 pixels. */ + fixed_width_still?: Image; + /** Data surrounding a version of this GIF set to loop for 15 seconds. */ + looping?: Image; + /** Data surrounding the original version of this GIF. Good for desktop use. */ + original?: Image; + /** Data surrounding a static preview image of the original GIF. */ + original_still?: Image; + /** Data surrounding a version of this GIF in .MP4 format limited to 50kb that displays the first 1-2 seconds of the GIF. */ + preview?: Image; + /** Data surrounding a version of this GIF limited to 50kb that displays the first 1-2 seconds of the GIF. */ + preview_gif?: Image; + }; /** - * The name of the check. - * @example "test-coverage" + * The creation or upload date from this GIF's source. + * @format date-time + * @example "2013-08-01 12:41:48" */ - name: string; - /** @example "MDg6Q2hlY2tSdW40" */ - node_id: string; - output: { - annotations_count: number; - /** @format uri */ - annotations_url: string; - summary: string | null; - text: string | null; - title: string | null; - }; - pull_requests: PullRequestMinimal[]; + import_datetime?: string; + /** + * The MPAA-style rating for this content. Examples include Y, G, PG, PG-13 and R + * @example "g" + */ + rating?: string; + /** + * The unique slug used in this GIF's URL + * @example "confused-flying-YsTs5ltWtEhnq" + */ + slug?: string; /** + * The page on which this GIF was found + * @example "http://www.reddit.com/r/reactiongifs/comments/1xpyaa/superman_goes_to_hollywood/" + */ + source?: string; + /** + * The URL of the webpage on which this GIF was found. + * @example "http://cheezburger.com/5282328320" + */ + source_post_url?: string; + /** + * The top level domain of the source URL. + * @example "cheezburger.com" + */ + source_tld?: string; + /** An array of tags for this GIF (Note: Not available when using the Public Beta Key) */ + tags?: string[]; + /** + * The date on which this gif was marked trending, if applicable. * @format date-time - * @example "2018-05-04T01:14:52Z" + * @example "2013-08-01 12:41:48" */ - started_at: string | null; + trending_datetime?: string; /** - * The phase of the lifecycle that the check is currently in. - * @example "queued" + * Type of the gif. By default, this is almost always gif + * @default "gif" */ - status: "queued" | "in_progress" | "completed"; - /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ - url: string; -} - -/** - * CheckSuite - * A suite of checks performed on the code of a given code change - */ -export interface CheckSuite { - /** @example "d6fde92930d4715a2b49857d24b940956b26d2d3" */ - after: string | null; - app: Integration | null; - /** @example "146e867f55c26428e5f9fade55a9bbf5e95a7912" */ - before: string | null; - check_runs_url: string; - /** @example "neutral" */ - conclusion: - | "success" - | "failure" - | "neutral" - | "cancelled" - | "skipped" - | "timed_out" - | "action_required" - | null; - /** @format date-time */ - created_at: string | null; - /** @example "master" */ - head_branch: string | null; - /** Simple Commit */ - head_commit: SimpleCommit; + type?: "gif"; /** - * The SHA of the head commit that is being checked. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * The date on which this GIF was last updated. + * @format date-time + * @example "2013-08-01 12:41:48" */ - head_sha: string; - /** @example 5 */ - id: number; - latest_check_runs_count: number; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - pull_requests: PullRequestMinimal[] | null; - /** Minimal Repository */ - repository: MinimalRepository; - /** @example "completed" */ - status: "queued" | "in_progress" | "completed" | null; - /** @format date-time */ - updated_at: string | null; - /** @example "https://api.github.com/repos/github/hello-world/check-suites/5" */ - url: string | null; + update_datetime?: string; + /** + * The unique URL for this GIF + * @example "http://giphy.com/gifs/confused-flying-YsTs5ltWtEhnq" + */ + url?: string; + /** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ + user?: User; + /** + * The username this GIF is attached to, if applicable + * @example "JoeCool4000" + */ + username?: string; } -/** - * Check Suite Preference - * Check suite configuration preferences for a repository. - */ -export interface CheckSuitePreference { - preferences: { - auto_trigger_checks?: { - app_id: number; - setting: boolean; - }[]; - }; - /** A git repository */ - repository: Repository; +export interface Image { + /** + * The URL for this GIF in .MP4 format. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.mp4" + */ + mp4?: string; + /** + * The size in bytes of the .MP4 file corresponding to this GIF. + * @example "25123" + */ + mp4_size?: string; + /** + * The number of frames in this GIF. + * @example "15" + */ + frames?: string; + /** + * The height of this GIF in pixels. + * @example "200" + */ + height?: string; + /** + * The size of this GIF in bytes. + * @example "32381" + */ + size?: string; + /** + * The publicly-accessible direct URL for this GIF. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/200.gif" + */ + url?: string; + /** + * The URL for this GIF in .webp format. + * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.webp" + */ + webp?: string; + /** + * The size in bytes of the .webp file corresponding to this GIF. + * @example "12321" + */ + webp_size?: string; + /** + * The width of this GIF in pixels. + * @example "320" + */ + width?: string; } -/** - * Clone Traffic - * Clone Traffic - */ -export interface CloneTraffic { - clones: Traffic[]; - /** @example 173 */ - count: number; - /** @example 128 */ - uniques: number; +/** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ +export interface Meta { + /** + * HTTP Response Message + * @example "OK" + */ + msg?: string; + /** + * A unique ID paired with this response from the API. + * @example "57eea03c72381f86e05c35d2" + */ + response_id?: string; + /** + * HTTP Response Code + * @format int32 + * @example 200 + */ + status?: number; } -/** - * Code Frequency Stat - * Code Frequency Stat - */ -export type CodeFrequencyStat = number[]; - -/** - * Code Of Conduct - * Code Of Conduct - */ -export interface CodeOfConduct { +/** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ +export interface Pagination { /** - * @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/ - * " + * Total number of items returned. + * @format int32 + * @example 25 */ - body?: string; - /** @format uri */ - html_url: string | null; - /** @example "contributor_covenant" */ - key: string; - /** @example "Contributor Covenant" */ - name: string; + count?: number; /** - * @format uri - * @example "https://api.github.com/codes_of_conduct/contributor_covenant" + * Position in pagination. + * @format int32 + * @example 75 */ - url: string; + offset?: number; + /** + * Total number of items available. + * @format int32 + * @example 250 + */ + total_count?: number; } -/** - * Code Of Conduct Simple - * Code of Conduct Simple - */ -export interface CodeOfConductSimple { - /** @format uri */ - html_url: string | null; - /** @example "citizen_code_of_conduct" */ - key: string; - /** @example "Citizen Code of Conduct" */ - name: string; +/** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ +export interface User { /** - * @format uri - * @example "https://api.github.com/codes_of_conduct/citizen_code_of_conduct" + * The URL for this user's avatar image. + * @example "https://media1.giphy.com/avatars/election2016/XwYrZi5H87o6.gif" */ - url: string; + avatar_url?: string; + /** + * The URL for the banner image that appears atop this user's profile page. + * @example "https://media4.giphy.com/avatars/cheezburger/XkuejOhoGLE6.jpg" + */ + banner_url?: string; + /** + * The display name associated with this user (contains formatting the base username might not). + * @example "JoeCool4000" + */ + display_name?: string; + /** + * The URL for this user's profile. + * @example "https://giphy.com/cheezburger/" + */ + profile_url?: string; + /** + * The Twitter username associated with this user, if applicable. + * @example "@joecool4000" + */ + twitter?: string; + /** + * The username associated with this user. + * @example "joecool4000" + */ + username?: string; } -export interface CodeScanningAlertCodeScanningAlert { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: AlertCreatedAt; - /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - dismissed_at: CodeScanningAlertDismissedAt; - /** Simple User */ - dismissed_by: SimpleUser; - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason: CodeScanningAlertDismissedReason; - /** The GitHub URL of the alert resource. */ - html_url: AlertHtmlUrl; - instances: CodeScanningAlertInstances; - /** The security alert number. */ - number: AlertNumber; - rule: CodeScanningAlertRule; - /** State of a code scanning alert. */ - state: CodeScanningAlertState; - tool: CodeScanningAnalysisTool; - /** The REST API URL of the alert resource. */ - url: AlertUrl; -} +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; -export interface CodeScanningAlertCodeScanningAlertItems { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: AlertCreatedAt; - /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - dismissed_at: CodeScanningAlertDismissedAt; - /** Simple User */ - dismissed_by: SimpleUser; - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason: CodeScanningAlertDismissedReason; - /** The GitHub URL of the alert resource. */ - html_url: AlertHtmlUrl; - /** The security alert number. */ - number: AlertNumber; - rule: CodeScanningAlertRule; - /** State of a code scanning alert. */ - state: CodeScanningAlertState; - tool: CodeScanningAnalysisTool; - /** The REST API URL of the alert resource. */ - url: AlertUrl; +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; } -/** - * The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time - */ -export type CodeScanningAlertDismissedAt = string | null; - -/** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ -export type CodeScanningAlertDismissedReason = - | "false positive" - | "won't fix" - | "used in tests" - | null; +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; -/** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ -export type CodeScanningAlertEnvironment = string; +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} -export type CodeScanningAlertInstances = - | { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key?: CodeScanningAnalysisAnalysisKey; - /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ - environment?: CodeScanningAlertEnvironment; - matrix_vars?: string | null; - /** The full Git reference, formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** State of a code scanning alert. */ - state?: CodeScanningAlertState; - }[] - | null; +export interface HttpResponse + extends Response { + data: D; + error: E; +} -/** The full Git reference, formatted as \`refs/heads/\`. */ -export type CodeScanningAlertRef = string; +type CancelToken = Symbol | string | number; -export interface CodeScanningAlertRule { - /** A short description of the rule used to detect the alert. */ - description?: string; - /** A unique identifier for the rule used to detect the alert. */ - id?: string | null; - /** The severity of the alert. */ - severity?: "none" | "note" | "warning" | "error" | null; +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", } -/** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ -export enum CodeScanningAlertSetState { - Open = "open", - Dismissed = "dismissed", -} +export class HttpClient { + public baseUrl: string = "https://api.giphy.com/v1"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => + fetch(...fetchParams); -/** State of a code scanning alert. */ -export enum CodeScanningAlertState { - Open = "open", - Dismissed = "dismissed", - Fixed = "fixed", -} + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; -/** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ -export type CodeScanningAnalysisAnalysisKey = string; + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } -export interface CodeScanningAnalysisCodeScanningAnalysis { - /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ - analysis_key: CodeScanningAnalysisAnalysisKey; - /** The commit SHA of the code scanning analysis file. */ - commit_sha: CodeScanningAnalysisCommitSha; - /** The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at: CodeScanningAnalysisCreatedAt; - /** Identifies the variable values associated with the environment in which this analysis was performed. */ - environment: CodeScanningAnalysisEnvironment; - /** @example "error reading field xyz" */ - error: string; - /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ - ref: CodeScanningAnalysisRef; - /** The name of the tool used to generate the code scanning analysis alert. */ - tool_name: CodeScanningAnalysisToolName; -} + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; -/** - * The commit SHA of the code scanning analysis file. - * @minLength 40 - * @maxLength 40 - * @pattern ^[0-9a-fA-F]+$ - */ -export type CodeScanningAnalysisCommitSha = string; + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } -/** - * The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time - */ -export type CodeScanningAnalysisCreatedAt = string; + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } -/** Identifies the variable values associated with the environment in which this analysis was performed. */ -export type CodeScanningAnalysisEnvironment = string; + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } -/** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ -export type CodeScanningAnalysisRef = string; + 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("&"); + } -/** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ -export type CodeScanningAnalysisSarifFile = string; + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } -export interface CodeScanningAnalysisTool { - /** The name of the tool used to generate the code scanning analysis alert. */ - name?: CodeScanningAnalysisToolName; - /** The version of the tool used to detect the alert. */ - version?: string | null; -} + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } -/** The name of the tool used to generate the code scanning analysis alert. */ -export type CodeScanningAnalysisToolName = string; + return 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), + }; -/** - * Code Search Result Item - * Code Search Result Item - */ -export interface CodeSearchResultItem { - file_size?: number; - /** @format uri */ - git_url: string; - /** @format uri */ - html_url: string; - language?: string | null; - /** @format date-time */ - last_modified_at?: string; - /** @example ["73..77","77..78"] */ - line_numbers?: string[]; - name: string; - path: string; - /** Minimal Repository */ - repository: MinimalRepository; - score: number; - sha: string; - text_matches?: SearchResultTextMatches; - /** @format uri */ - url: string; -} + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } -/** - * Collaborator - * Collaborator - */ -export interface Collaborator { - /** - * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" - */ - avatar_url: string; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ - events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/followers" - */ - followers_url: string; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; - /** - * @format uri - * @example "https://github.com/octocat" - */ - html_url: string; - /** @example 1 */ - id: number; - /** @example "octocat" */ - login: string; - /** @example "MDQ6VXNlcjE=" */ - node_id: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/orgs" - */ - organizations_url: string; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; + 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; }; - /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" - */ - received_events_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" - */ - repos_url: string; - site_admin: boolean; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" - */ - subscriptions_url: string; - /** @example "User" */ - type: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat" - */ - url: string; -} -export interface CombinedBillingUsage { - /** Numbers of days left in billing cycle. */ - days_left_in_billing_cycle: number; - /** Estimated storage space (GB) used in billing cycle. */ - estimated_paid_storage_for_month: number; - /** Estimated sum of free and paid storage space (GB) used in billing cycle. */ - estimated_storage_for_month: number; -} + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); -/** - * Combined Commit Status - * Combined Commit Status - */ -export interface CombinedCommitStatus { - /** @format uri */ - commit_url: string; - /** Minimal Repository */ - repository: MinimalRepository; - sha: string; - state: string; - statuses: SimpleCommitStatus[]; - total_count: number; - /** @format uri */ - url: string; + 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: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), + }, + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + 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 responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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; + }); + }; } /** - * Commit - * Commit + * @title Giphy + * @version 1.0 + * @termsOfService https://developers.giphy.com/ + * @baseUrl https://api.giphy.com/v1 + * @externalDocs https://developers.giphy.com/docs/ + * @contact + * + * Giphy API */ -export interface Commit { - author: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments" - */ - comments_url: string; - commit: { - author: GitUser | null; - /** @example 0 */ - comment_count: number; - committer: GitUser | null; - /** @example "Fix all the bugs" */ - message: string; - tree: { - /** @example "827efc6d56897b048c772eb4087f854f46256132" */ - sha: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" - */ - url: string; - }; +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + gifs = { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * @description A multiget version of the get GIF by ID endpoint. + * + * @tags gifs + * @name GetGifsById + * @summary Get GIFs by ID + * @request GET:/gifs + * @secure */ - url: string; - verification?: Verification; - }; - committer: SimpleUser | null; - files?: { - additions?: number; - blob_url?: string; - changes?: number; - /** @example ""https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573"" */ - contents_url?: string; - deletions?: number; - filename?: string; - patch?: string; - /** @example ""subdir/before_name.txt"" */ - previous_filename?: string; - raw_url?: string; - /** @example ""1e8e60ce9733d5283f7836fa602b6365a66b2567"" */ - sha?: string; - status?: string; - }[]; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - html_url: string; - /** @example "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==" */ - node_id: string; - parents: { + getGifsById: ( + query?: { + /** Filters results by specified GIF IDs, separated by commas. */ + ids?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; + }, + any + >({ + path: \`/gifs\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + /** - * @format uri - * @example "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd" + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * + * @tags gifs + * @name RandomGif + * @summary Random GIF + * @request GET:/gifs/random + * @secure */ - html_url?: string; - /** @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ - sha: string; + randomGif: ( + query?: { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + }, + any + >({ + path: \`/gifs/random\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd" - */ - url: string; - }[]; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - sha: string; - stats?: { - additions?: number; - deletions?: number; - total?: number; - }; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - url: string; -} - -/** - * Commit Activity - * Commit Activity - */ -export interface CommitActivity { - /** @example [0,3,26,20,39,1,0] */ - days: number[]; - /** @example 89 */ - total: number; - /** @example 1336280400 */ - week: number; -} + * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. + * + * @tags gifs + * @name SearchGifs + * @summary Search GIFs + * @request GET:/gifs/search + * @secure + */ + searchGifs: ( + query: { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; + }, + any + >({ + path: \`/gifs/search\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -/** - * Commit Comment - * Commit Comment - */ -export interface CommitComment { - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - body: string; - commit_id: string; - /** @format date-time */ - created_at: string; - /** @format uri */ - html_url: string; - id: number; - line: number | null; - node_id: string; - path: string | null; - position: number | null; - reactions?: ReactionRollup; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - user: SimpleUser | null; -} + /** + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF + * + * @tags gifs + * @name TranslateGif + * @summary Translate phrase to GIF + * @request GET:/gifs/translate + * @secure + */ + translateGif: ( + query: { + /** Search term. */ + s: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + }, + any + >({ + path: \`/gifs/translate\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -/** - * Commit Comparison - * Commit Comparison - */ -export interface CommitComparison { - /** @example 4 */ - ahead_by: number; - /** Commit */ - base_commit: Commit; - /** @example 5 */ - behind_by: number; - commits: Commit[]; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic.diff" - */ - diff_url: string; - files: DiffEntry[]; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic" - */ - html_url: string; - /** Commit */ - merge_base_commit: Commit; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/master...topic.patch" - */ - patch_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17" - */ - permalink_url: string; - /** @example "ahead" */ - status: "diverged" | "ahead" | "behind" | "identical"; - /** @example 6 */ - total_commits: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/compare/master...topic" - */ - url: string; -} + /** + * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. + * + * @tags gifs + * @name TrendingGifs + * @summary Trending GIFs + * @request GET:/gifs/trending + * @secure + */ + trendingGifs: ( + query?: { + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Filters results by specified rating. */ + rating?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; + }, + any + >({ + path: \`/gifs/trending\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -/** - * Commit Search Result Item - * Commit Search Result Item - */ -export interface CommitSearchResultItem { - author: SimpleUser | null; - /** @format uri */ - comments_url: string; - commit: { - author: { - /** @format date-time */ - date: string; - email: string; - name: string; - }; - comment_count: number; - committer: GitUser | null; - message: string; - tree: { - sha: string; - /** @format uri */ - url: string; - }; - /** @format uri */ - url: string; - verification?: Verification; - }; - committer: GitUser | null; - /** @format uri */ - html_url: string; - node_id: string; - parents: { - html_url?: string; - sha?: string; - url?: string; - }[]; - /** Minimal Repository */ - repository: MinimalRepository; - score: number; - sha: string; - text_matches?: SearchResultTextMatches; - /** @format uri */ - url: string; -} + /** + * @description Returns a GIF given that GIF's unique ID + * + * @tags gifs + * @name GetGifById + * @summary Get GIF by Id + * @request GET:/gifs/{gifId} + * @secure + */ + getGifById: (gifId: number, params: RequestParams = {}) => + this.request< + { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + }, + any + >({ + path: \`/gifs/\${gifId}\`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + }; + stickers = { + /** + * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * + * @tags stickers + * @name RandomSticker + * @summary Random Sticker + * @request GET:/stickers/random + * @secure + */ + randomSticker: ( + query?: { + /** Filters results by specified rating. */ + rating?: string; + /** Filters results by specified tag. */ + tag?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + }, + any + >({ + path: \`/stickers/random\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), -/** Community Health File */ -export interface CommunityHealthFile { - /** @format uri */ - html_url: string; - /** @format uri */ - url: string; + /** + * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. + * + * @tags stickers + * @name SearchStickers + * @summary Search Stickers + * @request GET:/stickers/search + * @secure + */ + searchStickers: ( + query: { + /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ + lang?: string; + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Search query term or prhase. */ + q: string; + /** Filters results by specified rating. */ + rating?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; + }, + any + >({ + path: \`/stickers/search\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. + * + * @tags stickers + * @name TranslateSticker + * @summary Translate phrase to Sticker + * @request GET:/stickers/translate + * @secure + */ + translateSticker: ( + query: { + /** Search term. */ + s: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + }, + any + >({ + path: \`/stickers/translate\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. + * + * @tags stickers + * @name TrendingStickers + * @summary Trending Stickers + * @request GET:/stickers/trending + * @secure + */ + trendingStickers: ( + query?: { + /** + * The maximum number of records to return. + * @format int32 + * @default 25 + */ + limit?: number; + /** + * An optional results offset. + * @format int32 + * @default 0 + */ + offset?: number; + /** Filters results by specified rating. */ + rating?: string; + }, + params: RequestParams = {}, + ) => + this.request< + { + data?: Gif[]; + /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ + meta?: Meta; + /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ + pagination?: Pagination; + }, + any + >({ + path: \`/stickers/trending\`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + }; } +" +`; -/** - * Community Profile - * Community Profile +exports[`simple > 'issue-1057' 1`] = ` +"/* eslint-disable */ +/* tslint:disable */ +// @ts-nocheck +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- */ -export interface CommunityProfile { - /** @example true */ - content_reports_enabled?: boolean; - /** @example "My first repository on GitHub!" */ - description: string | null; - /** @example "example.com" */ - documentation: string | null; - files: { - code_of_conduct: CodeOfConductSimple | null; - contributing: CommunityHealthFile | null; - issue_template: CommunityHealthFile | null; - license: LicenseSimple | null; - pull_request_template: CommunityHealthFile | null; - readme: CommunityHealthFile | null; + +export interface ActionsBillingUsage { + /** The amount of free GitHub Actions minutes available. */ + included_minutes: number; + minutes_used_breakdown: { + /** Total minutes used on macOS runner machines. */ + MACOS?: number; + /** Total minutes used on Ubuntu runner machines. */ + UBUNTU?: number; + /** Total minutes used on Windows runner machines. */ + WINDOWS?: number; }; - /** @example 100 */ - health_percentage: number; - /** - * @format date-time - * @example "2017-02-28T19:09:29Z" - */ - updated_at: string | null; + /** The sum of the free and paid GitHub Actions minutes used. */ + total_minutes_used: number; + /** The total paid GitHub Actions minutes used. */ + total_paid_minutes_used: number; } -/** - * Content Directory - * A list of directory items - */ -export type ContentDirectory = { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content?: string; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; -}[]; +/** Whether GitHub Actions is enabled on the repository. */ +export type ActionsEnabled = boolean; -/** - * Content File - * Content File - */ -export interface ContentFile { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content: string; - /** @format uri */ - download_url: string | null; - encoding: string; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - /** @example ""git://example.com/defunkt/dotjs.git"" */ - submodule_git_url?: string; - /** @example ""actual/actual.md"" */ - target?: string; - type: string; - /** @format uri */ - url: string; +export interface ActionsEnterprisePermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_organizations: EnabledOrganizations; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; + /** The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when \`enabled_organizations\` is set to \`selected\`. */ + selected_organizations_url?: string; +} + +export interface ActionsOrganizationPermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_repositories: EnabledRepositories; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; + /** The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when \`enabled_repositories\` is set to \`selected\`. */ + selected_repositories_url?: string; } /** - * ContentReferenceAttachment - * Content Reference attachments allow you to provide context around URLs posted in comments + * ActionsPublicKey + * The public key used for setting Actions Secrets. */ -export interface ContentReferenceAttachment { - /** - * The body of the attachment - * @maxLength 262144 - * @example "Body of the attachment" - */ - body: string; - /** - * The ID of the attachment - * @example 21 - */ - id: number; +export interface ActionsPublicKey { + /** @example "2011-01-26T19:01:12Z" */ + created_at?: string; + /** @example 2 */ + id?: number; /** - * The node_id of the content attachment - * @example "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=" + * The Base64 encoded public key. + * @example "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=" */ - node_id?: string; + key: string; /** - * The title of the attachment - * @maxLength 1024 - * @example "Title of the attachment" + * The identifier for the key. + * @example "1234567" */ - title: string; + key_id: string; + /** @example "ssh-rsa AAAAB3NzaC1yc2EAAA" */ + title?: string; + /** @example "https://api.github.com/user/keys/2" */ + url?: string; +} + +export interface ActionsRepositoryPermissions { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions: AllowedActions; + /** Whether GitHub Actions is enabled on the repository. */ + enabled: ActionsEnabled; + /** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ + selected_actions_url?: SelectedActionsUrl; } /** - * Symlink Content - * An object describing a symlink + * Actions Secret + * Set secrets for GitHub Actions. */ -export interface ContentSubmodule { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; +export interface ActionsSecret { + /** @format date-time */ + created_at: string; + /** + * The name of the secret. + * @example "SECRET_TOKEN" + */ name: string; - path: string; - sha: string; - size: number; - /** @format uri */ - submodule_git_url: string; - type: string; - /** @format uri */ - url: string; + /** @format date-time */ + updated_at: string; } /** - * Symlink Content - * An object describing a symlink + * Actor + * Actor */ -export interface ContentSymlink { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; +export interface Actor { /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - target: string; - type: string; + avatar_url: string; + display_login?: string; + gravatar_id: string | null; + id: number; + login: string; /** @format uri */ url: string; } /** - * Content Traffic - * Content Traffic + * The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ -export interface ContentTraffic { - /** @example 3542 */ - count: number; - /** @example "/github/hubot" */ - path: string; - /** @example "github/hubot: A customizable life embetterment robot." */ - title: string; - /** @example 2225 */ - uniques: number; +export type AlertCreatedAt = string; + +/** + * The GitHub URL of the alert resource. + * @format uri + */ +export type AlertHtmlUrl = string; + +/** The security alert number. */ +export type AlertNumber = number; + +/** + * The REST API URL of the alert resource. + * @format uri + */ +export type AlertUrl = string; + +/** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ +export enum AllowedActions { + All = "all", + LocalOnly = "local_only", + Selected = "selected", } /** - * Content Tree - * Content Tree + * Api Overview + * Api Overview */ -export interface ContentTree { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; +export interface ApiOverview { + /** @example ["13.64.0.0/16","13.65.0.0/16"] */ + actions?: string[]; + /** @example ["127.0.0.1/32"] */ + api?: string[]; + /** @example ["127.0.0.1/32"] */ + git?: string[]; + /** @example ["127.0.0.1/32"] */ + hooks?: string[]; + /** @example ["54.158.161.132","54.226.70.38"] */ + importer?: string[]; + /** @example ["192.30.252.153/32","192.30.252.154/32"] */ + pages?: string[]; + ssh_key_fingerprints?: { + SHA256_DSA?: string; + SHA256_RSA?: string; }; - /** @format uri */ - download_url: string | null; - entries?: { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content?: string; - /** @format uri */ - download_url: string | null; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; - }[]; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; -} - -/** - * Contributor - * Contributor - */ -export interface Contributor { - /** @format uri */ - avatar_url?: string; - contributions: number; - email?: string; - events_url?: string; - /** @format uri */ - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string | null; - /** @format uri */ - html_url?: string; - id?: number; - login?: string; - name?: string; - node_id?: string; - /** @format uri */ - organizations_url?: string; - /** @format uri */ - received_events_url?: string; - /** @format uri */ - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - /** @format uri */ - subscriptions_url?: string; - type: string; - /** @format uri */ - url?: string; + /** @example true */ + verifiable_password_authentication: boolean; + /** @example ["127.0.0.1/32"] */ + web?: string[]; } /** - * Contributor Activity - * Contributor Activity + * App Permissions + * The permissions granted to the user-to-server access token. + * @example {"contents":"read","issues":"read","deployments":"write","single_file":"read"} */ -export interface ContributorActivity { - author: SimpleUser | null; - /** @example 135 */ - total: number; - /** @example [{"w":"1367712000","a":6898,"d":77,"c":10}] */ - weeks: { - a?: number; - c?: number; - d?: number; - w?: string; - }[]; +export interface AppPermissions { + /** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: \`read\` or \`write\`. */ + actions?: "read" | "write"; + /** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: \`read\` or \`write\`. */ + administration?: "read" | "write"; + /** The level of permission to grant the access token for checks on code. Can be one of: \`read\` or \`write\`. */ + checks?: "read" | "write"; + /** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: \`read\` or \`write\`. */ + content_references?: "read" | "write"; + /** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: \`read\` or \`write\`. */ + contents?: "read" | "write"; + /** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: \`read\` or \`write\`. */ + deployments?: "read" | "write"; + /** The level of permission to grant the access token for managing repository environments. Can be one of: \`read\` or \`write\`. */ + environments?: "read" | "write"; + /** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: \`read\` or \`write\`. */ + issues?: "read" | "write"; + /** The level of permission to grant the access token for organization teams and members. Can be one of: \`read\` or \`write\`. */ + members?: "read" | "write"; + /** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: \`read\` or \`write\`. */ + metadata?: "read" | "write"; + /** The level of permission to grant the access token to manage access to an organization. Can be one of: \`read\` or \`write\`. */ + organization_administration?: "read" | "write"; + /** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: \`read\` or \`write\`. */ + organization_hooks?: "read" | "write"; + /** The level of permission to grant the access token for viewing an organization's plan. Can be one of: \`read\`. */ + organization_plan?: "read"; + /** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ + organization_projects?: "read" | "write" | "admin"; + /** The level of permission to grant the access token to manage organization secrets. Can be one of: \`read\` or \`write\`. */ + organization_secrets?: "read" | "write"; + /** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: \`read\` or \`write\`. */ + organization_self_hosted_runners?: "read" | "write"; + /** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: \`read\` or \`write\`. */ + organization_user_blocking?: "read" | "write"; + /** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: \`read\` or \`write\`. */ + packages?: "read" | "write"; + /** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: \`read\` or \`write\`. */ + pages?: "read" | "write"; + /** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: \`read\` or \`write\`. */ + pull_requests?: "read" | "write"; + /** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: \`read\` or \`write\`. */ + repository_hooks?: "read" | "write"; + /** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: \`read\`, \`write\`, or \`admin\`. */ + repository_projects?: "read" | "write" | "admin"; + /** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: \`read\` or \`write\`. */ + secret_scanning_alerts?: "read" | "write"; + /** The level of permission to grant the access token to manage repository secrets. Can be one of: \`read\` or \`write\`. */ + secrets?: "read" | "write"; + /** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: \`read\` or \`write\`. */ + security_events?: "read" | "write"; + /** The level of permission to grant the access token to manage just a single file. Can be one of: \`read\` or \`write\`. */ + single_file?: "read" | "write"; + /** The level of permission to grant the access token for commit statuses. Can be one of: \`read\` or \`write\`. */ + statuses?: "read" | "write"; + /** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: \`read\` or \`write\`. */ + team_discussions?: "read" | "write"; + /** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: \`read\`. */ + vulnerability_alerts?: "read"; + /** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: \`write\`. */ + workflows?: "write"; } /** - * Credential Authorization - * Credential Authorization + * Application Grant + * The authorization associated with an OAuth Access. */ -export interface CredentialAuthorization { - /** @example 12345678 */ - authorized_credential_id?: number | null; - /** - * The note given to the token. This will only be present when the credential is a token. - * @example "my token" - */ - authorized_credential_note?: string | null; - /** - * The title given to the ssh key. This will only be present when the credential is an ssh key. - * @example "my ssh key" - */ - authorized_credential_title?: string | null; +export interface ApplicationGrant { + app: { + client_id: string; + name: string; + /** @format uri */ + url: string; + }; /** - * Date when the credential was last accessed. May be null if it was never accessed * @format date-time - * @example "2011-01-26T19:06:43Z" + * @example "2011-09-06T17:26:27Z" */ - credential_accessed_at?: string | null; + created_at: string; + /** @example 1 */ + id: number; + /** @example ["public_repo"] */ + scopes: string[]; /** - * Date when the credential was authorized for use. * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - credential_authorized_at: string; - /** - * Unique identifier for the credential. - * @example 1 - */ - credential_id: number; - /** - * Human-readable description of the credential type. - * @example "SSH Key" - */ - credential_type: string; - /** - * Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. - * @example "jklmnop12345678" - */ - fingerprint?: string; - /** - * User login that owns the underlying credential. - * @example "monalisa" - */ - login: string; - /** - * List of oauth scopes the token has been granted. - * @example ["user","repo"] + * @example "2011-09-06T20:39:23Z" */ - scopes?: string[]; + updated_at: string; /** - * Last eight characters of the credential. Only included in responses with credential_type of personal access token. - * @example "12345678" + * @format uri + * @example "https://api.github.com/applications/grants/1" */ - token_last_eight?: string; -} - -/** - * Deploy Key - * An SSH key granting access to a single repository. - */ -export interface DeployKey { - created_at: string; - id: number; - key: string; - read_only: boolean; - title: string; url: string; - verified: boolean; + user?: SimpleUser | null; } /** - * Deployment - * A request for a specific ref(branch,sha,tag) to be deployed + * Artifact + * An artifact */ -export interface Deployment { +export interface Artifact { + /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5/zip" */ + archive_download_url: string; + /** @format date-time */ + created_at: string | null; + /** Whether or not the artifact has expired. */ + expired: boolean; + /** @format date-time */ + expires_at: string; + /** @example 5 */ + id: number; /** - * @format date-time - * @example "2012-07-20T01:19:13Z" + * The name of the artifact. + * @example "AdventureWorks.Framework" */ - created_at: string; - creator: SimpleUser | null; - /** @example "Deploy request from hubot" */ - description: string | null; - /** - * Name for the target deployment environment. - * @example "production" - */ - environment: string; - /** - * Unique identifier of the deployment - * @example 42 - */ - id: number; - /** @example "MDEwOkRlcGxveW1lbnQx" */ + name: string; + /** @example "MDEwOkNoZWNrU3VpdGU1" */ node_id: string; - /** @example "staging" */ - original_environment?: string; - payload: object; - performed_via_github_app?: Integration | null; - /** - * Specifies if the given environment is one that end-users directly interact with. Default: false. - * @example true - */ - production_environment?: boolean; - /** - * The ref to deploy. This can be a branch, tag, or sha. - * @example "topic-branch" - */ - ref: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example" - */ - repository_url: string; - /** @example "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d" */ - sha: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/1/statuses" - */ - statuses_url: string; - /** - * Parameter to specify a task to execute - * @example "deploy" - */ - task: string; - /** - * Specifies if the given environment is will no longer exist at some point in the future. Default: false. - * @example true - */ - transient_environment?: boolean; - /** - * @format date-time - * @example "2012-07-20T01:19:13Z" - */ - updated_at: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/1" + * The size in bytes of the artifact. + * @example 12345 */ + size_in_bytes: number; + /** @format date-time */ + updated_at: string | null; + /** @example "https://api.github.com/repos/github/hello-world/actions/artifacts/5" */ url: string; } +export interface AuditLogEvent { + /** The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + "@timestamp"?: number; + /** The name of the action that was performed, for example \`user.login\` or \`repo.create\`. */ + action?: string; + active?: boolean; + active_was?: boolean; + /** The actor who performed the action. */ + actor?: string; + /** The username of the account being blocked. */ + blocked_user?: string; + business?: string; + config?: any[]; + config_was?: any[]; + content_type?: string; + /** The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + created_at?: number; + deploy_key_fingerprint?: string; + emoji?: string; + events?: any[]; + events_were?: any[]; + explanation?: string; + fingerprint?: string; + hook_id?: number; + limited_availability?: boolean; + message?: string; + name?: string; + old_user?: string; + openssh_public_key?: string; + org?: string; + previous_visibility?: string; + read_only?: boolean; + /** The name of the repository. */ + repo?: string; + /** The name of the repository. */ + repository?: string; + repository_public?: boolean; + target_login?: string; + team?: string; + /** The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol?: number; + /** A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol_name?: string; + /** The user that was affected by the action performed (if available). */ + user?: string; + /** The repository visibility, for example \`public\` or \`private\`. */ + visibility?: string; +} + /** - * Deployment Status - * The status of a deployment. + * Authentication Token + * Authentication Token */ -export interface DeploymentStatus { - /** - * @format date-time - * @example "2012-07-20T01:19:13Z" - */ - created_at: string; - creator: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/42" - */ - deployment_url: string; - /** - * A short description of the status. - * @maxLength 140 - * @default "" - * @example "Deployment finished successfully." - */ - description: string; - /** - * The environment of the deployment that the status is for. - * @default "" - * @example "production" - */ - environment?: string; - /** - * The URL for accessing your environment. - * @format uri - * @default "" - * @example "https://staging.example.com/" - */ - environment_url?: string; - /** @example 1 */ - id: number; - /** - * The URL to associate with this status. - * @format uri - * @default "" - * @example "https://example.com/deployment/42/output" - */ - log_url?: string; - /** @example "MDE2OkRlcGxveW1lbnRTdGF0dXMx" */ - node_id: string; - performed_via_github_app?: Integration | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/example" - */ - repository_url: string; - /** - * The state of the status. - * @example "success" - */ - state: - | "error" - | "failure" - | "inactive" - | "pending" - | "success" - | "queued" - | "in_progress"; - /** - * Deprecated: the URL to associate with this status. - * @format uri - * @default "" - * @example "https://example.com/deployment/42/output" - */ - target_url: string; +export interface AuthenticationToken { /** + * The time this token expires * @format date-time - * @example "2012-07-20T01:19:13Z" + * @example "2016-07-11T22:14:10Z" */ - updated_at: string; + expires_at: string; + /** @example {"issues":"read","deployments":"write"} */ + permissions?: object; + /** The repositories this token has access to */ + repositories?: Repository[]; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection?: "all" | "selected"; + /** @example "config.yaml" */ + single_file?: string | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/example/deployments/42/statuses/1" + * The token used for authentication + * @example "v1.1f699f1069f60xxx" */ - url: string; + token: string; } /** - * Diff Entry - * Diff Entry + * author_association + * How the author is associated with the repository. + * @example "OWNER" */ -export interface DiffEntry { - /** @example 103 */ - additions: number; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" - */ - blob_url: string; - /** @example 124 */ - changes: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - contents_url: string; - /** @example 21 */ - deletions: number; - /** @example "file1.txt" */ - filename: string; - /** @example "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" */ - patch?: string; - /** @example "file.txt" */ - previous_filename?: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" - */ - raw_url: string; - /** @example "bbcd538c8e72b8c175046e27cc8f907076331401" */ - sha: string; - /** @example "added" */ - status: string; +export enum AuthorAssociation { + COLLABORATOR = "COLLABORATOR", + CONTRIBUTOR = "CONTRIBUTOR", + FIRST_TIMER = "FIRST_TIMER", + FIRST_TIME_CONTRIBUTOR = "FIRST_TIME_CONTRIBUTOR", + MANNEQUIN = "MANNEQUIN", + MEMBER = "MEMBER", + NONE = "NONE", + OWNER = "OWNER", } /** - * Email - * Email + * Authorization + * The authorization for an OAuth app, GitHub App, or a Personal Access Token. */ -export interface Email { - /** - * @format email - * @example "octocat@github.com" - */ - email: string; - /** @example true */ - primary: boolean; - /** @example true */ - verified: boolean; - /** @example "public" */ - visibility: string | null; -} - -/** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ -export enum EnabledOrganizations { - All = "all", - None = "none", - Selected = "selected", +export interface Authorization { + app: { + client_id: string; + name: string; + /** @format uri */ + url: string; + }; + /** @format date-time */ + created_at: string; + fingerprint: string | null; + hashed_token: string | null; + id: number; + installation?: ScopedInstallation | null; + note: string | null; + /** @format uri */ + note_url: string | null; + /** A list of scopes that this authorization is in. */ + scopes: string[] | null; + token: string; + token_last_eight: string | null; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + user?: SimpleUser | null; } -/** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ -export enum EnabledRepositories { - All = "all", - None = "none", - Selected = "selected", -} +/** + * Auto merge + * The status of auto merging a pull request. + */ +export type AutoMerge = { + /** Commit message for the merge commit. */ + commit_message: string; + /** Title for the merge commit message. */ + commit_title: string; + /** Simple User */ + enabled_by: SimpleUser; + /** The merge method to use. */ + merge_method: "merge" | "squash" | "rebase"; +} | null; /** - * Enterprise - * An enterprise account + * Base Gist + * Base Gist */ -export interface Enterprise { +export interface BaseGist { + comments: number; + /** @format uri */ + comments_url: string; + /** @format uri */ + commits_url: string; + /** @format date-time */ + created_at: string; + description: string | null; + files: Record< + string, + { + filename?: string; + language?: string; + raw_url?: string; + size?: number; + type?: string; + } + >; + forks?: any[]; + /** @format uri */ + forks_url: string; + /** @format uri */ + git_pull_url: string; + /** @format uri */ + git_push_url: string; + history?: any[]; /** @format uri */ - avatar_url: string; - /** - * @format date-time - * @example "2019-01-26T19:01:12Z" - */ - created_at: string | null; - /** A short description of the enterprise. */ - description?: string | null; - /** - * @format uri - * @example "https://github.com/enterprises/octo-business" - */ html_url: string; - /** - * Unique identifier of the enterprise - * @example 42 - */ - id: number; - /** - * The name of the enterprise. - * @example "Octo Business" - */ - name: string; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + id: string; node_id: string; - /** - * The slug url identifier for the enterprise. - * @example "octo-business" - */ - slug: string; - /** - * @format date-time - * @example "2019-01-26T19:14:43Z" - */ - updated_at: string | null; - /** - * The enterprise's website URL. - * @format uri - */ - website_url?: string | null; + owner?: SimpleUser | null; + public: boolean; + truncated?: boolean; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + user: SimpleUser | null; } /** - * Event - * Event + * Basic Error + * Basic Error */ -export interface Event { - /** Actor */ - actor: Actor; - /** @format date-time */ - created_at: string | null; - id: string; - /** Actor */ - org?: Actor; - payload: { - action: string; - /** Comments provide a way for people to collaborate on an issue. */ - comment?: IssueComment; - /** Issue Simple */ - issue?: IssueSimple; - pages?: { - action?: string; - html_url?: string; - page_name?: string; - sha?: string; - summary?: string | null; - title?: string; - }[]; - }; - public: boolean; - repo: { - id: number; - name: string; - /** @format uri */ - url: string; - }; - type: string | null; +export interface BasicError { + documentation_url?: string; + message?: string; } /** - * Feed - * Feed + * Blob + * Blob */ -export interface Feed { - _links: { - /** Hypermedia Link with Type */ - current_user?: LinkWithType; - /** Hypermedia Link with Type */ - current_user_actor?: LinkWithType; - /** Hypermedia Link with Type */ - current_user_organization?: LinkWithType; - current_user_organizations?: LinkWithType[]; - /** Hypermedia Link with Type */ - current_user_public?: LinkWithType; - /** Hypermedia Link with Type */ - security_advisories?: LinkWithType; - /** Hypermedia Link with Type */ - timeline: LinkWithType; - /** Hypermedia Link with Type */ - user: LinkWithType; - }; - /** @example "https://github.com/octocat.private.actor?token=abc123" */ - current_user_actor_url?: string; - /** @example "https://github.com/octocat-org" */ - current_user_organization_url?: string; - /** @example ["https://github.com/organizations/github/octocat.private.atom?token=abc123"] */ - current_user_organization_urls?: string[]; - /** @example "https://github.com/octocat" */ - current_user_public_url?: string; - /** @example "https://github.com/octocat.private?token=abc123" */ - current_user_url?: string; - /** @example "https://github.com/security-advisories" */ - security_advisories_url?: string; - /** @example "https://github.com/timeline" */ - timeline_url: string; - /** @example "https://github.com/{user}" */ - user_url: string; +export interface Blob { + content: string; + encoding: string; + highlighted_content?: string; + node_id: string; + sha: string; + size: number | null; + /** @format uri */ + url: string; } /** - * File Commit - * File Commit + * Branch Protection + * Branch Protection */ -export interface FileCommit { - commit: { - author?: { - date?: string; - email?: string; - name?: string; - }; - committer?: { - date?: string; - email?: string; - name?: string; - }; - html_url?: string; - message?: string; - node_id?: string; - parents?: { - html_url?: string; - sha?: string; - url?: string; - }[]; - sha?: string; - tree?: { - sha?: string; - url?: string; - }; +export interface BranchProtection { + allow_deletions?: { + enabled?: boolean; + }; + allow_force_pushes?: { + enabled?: boolean; + }; + enabled: boolean; + /** Protected Branch Admin Enforced */ + enforce_admins?: ProtectedBranchAdminEnforced; + /** @example ""branch/with/protection"" */ + name?: string; + /** @example ""https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection"" */ + protection_url?: string; + required_linear_history?: { + enabled?: boolean; + }; + /** Protected Branch Pull Request Review */ + required_pull_request_reviews?: ProtectedBranchPullRequestReview; + required_status_checks: { + contexts: string[]; + contexts_url?: string; + enforcement_level: string; url?: string; - verification?: { - payload?: string | null; - reason?: string; - signature?: string | null; - verified?: boolean; - }; }; - content: { - _links?: { - git?: string; - html?: string; - self?: string; + /** Branch Restriction Policy */ + restrictions?: BranchRestrictionPolicy; + url?: string; +} + +/** + * Branch Restriction Policy + * Branch Restriction Policy + */ +export interface BranchRestrictionPolicy { + apps: { + created_at?: string; + description?: string; + events?: string[]; + external_url?: string; + html_url?: string; + id?: number; + name?: string; + node_id?: string; + owner?: { + avatar_url?: string; + description?: string; + events_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers"" */ + followers_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}"" */ + following_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}"" */ + gists_url?: string; + /** @example """" */ + gravatar_id?: string; + hooks_url?: string; + /** @example ""https://github.com/testorg-ea8ec76d71c3af4b"" */ + html_url?: string; + id?: number; + issues_url?: string; + login?: string; + members_url?: string; + node_id?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs"" */ + organizations_url?: string; + public_members_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events"" */ + received_events_url?: string; + repos_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}"" */ + starred_url?: string; + /** @example ""https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions"" */ + subscriptions_url?: string; + /** @example ""Organization"" */ + type?: string; + url?: string; }; - download_url?: string; - git_url?: string; + permissions?: { + contents?: string; + issues?: string; + metadata?: string; + single_file?: string; + }; + slug?: string; + updated_at?: string; + }[]; + /** @format uri */ + apps_url: string; + teams: { + description?: string | null; html_url?: string; + id?: number; + members_url?: string; name?: string; - path?: string; - sha?: string; - size?: number; + node_id?: string; + parent?: string | null; + permission?: string; + privacy?: string; + repositories_url?: string; + slug?: string; + url?: string; + }[]; + /** @format uri */ + teams_url: string; + /** @format uri */ + url: string; + users: { + avatar_url?: string; + events_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string; + html_url?: string; + id?: number; + login?: string; + node_id?: string; + organizations_url?: string; + received_events_url?: string; + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + subscriptions_url?: string; type?: string; url?: string; - } | null; + }[]; + /** @format uri */ + users_url: string; } /** - * Full Repository - * Full Repository + * Branch Short + * Branch Short */ -export interface FullRepository { - /** @example true */ - allow_merge_commit?: boolean; - /** @example true */ - allow_rebase_merge?: boolean; - /** @example true */ - allow_squash_merge?: boolean; - /** - * Whether anonymous git access is allowed. - * @default true - */ - anonymous_access_enabled?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; +export interface BranchShort { + commit: { + sha: string; + url: string; + }; + name: string; + protected: boolean; +} + +/** + * Branch With Protection + * Branch With Protection + */ +export interface BranchWithProtection { + _links: { + html: string; + /** @format uri */ + self: string; + }; + /** Commit */ + commit: Commit; + name: string; + /** @example ""mas*"" */ + pattern?: string; + protected: boolean; + /** Branch Protection */ + protection: BranchProtection; + /** @format uri */ + protection_url: string; + /** @example 1 */ + required_approving_review_count?: number; +} + +/** + * Check Annotation + * Check Annotation + */ +export interface CheckAnnotation { + /** @example "warning" */ + annotation_level: string | null; + blob_href: string; + /** @example 10 */ + end_column: number | null; + /** @example 2 */ + end_line: number; + /** @example "Check your spelling for 'banaas'." */ + message: string | null; + /** @example "README.md" */ + path: string; + /** @example "Do you mean 'bananas' or 'banana'?" */ + raw_details: string | null; + /** @example 5 */ + start_column: number | null; + /** @example 2 */ + start_line: number; + /** @example "Spell Checker" */ + title: string | null; +} + +/** + * CheckRun + * A check performed on the code of a given code change + */ +export interface CheckRun { + app: Integration | null; + check_suite: { + id: number; + } | null; /** * @format date-time - * @example "2011-01-26T19:01:12Z" + * @example "2018-05-04T01:14:52Z" */ - created_at: string; - /** @example "master" */ - default_branch: string; - /** @example false */ - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" - */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** @example true */ - has_downloads: boolean; - /** @example true */ - has_issues: boolean; - has_pages: boolean; - /** @example true */ - has_projects: boolean; - /** @example true */ - has_wiki: boolean; - /** - * @format uri - * @example "https://github.com" - */ - homepage: string | null; + completed_at: string | null; + /** @example "neutral" */ + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null; + /** @example "https://example.com" */ + details_url: string | null; + /** @example "42" */ + external_id: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * The SHA of the commit that is being checked. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" */ - hooks_url: string; + head_sha: string; + /** @example "https://github.com/github/hello-world/runs/4" */ + html_url: string | null; /** - * @format uri - * @example "https://github.com/octocat/Hello-World" + * The id of the check. + * @example 21 */ - html_url: string; - /** @example 1296269 */ id: number; - /** @example true */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" - */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" - */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; /** - * @format uri - * @example "git:git.example.com/octocat/Hello-World" + * The name of the check. + * @example "test-coverage" */ - mirror_url: string | null; - /** @example "Hello-World" */ name: string; - /** @example 0 */ - network_count: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + /** @example "MDg6Q2hlY2tSdW40" */ node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - organization?: SimpleUser | null; - owner: SimpleUser | null; - /** A git repository */ - parent?: Repository; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; + output: { + annotations_count: number; + /** @format uri */ + annotations_url: string; + summary: string | null; + text: string | null; + title: string | null; }; - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; - /** - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - pushed_at: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** A git repository */ - source?: Repository; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" - */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - /** @example 42 */ - subscribers_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" - */ - subscribers_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" - */ - subscription_url: string; - /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string | null; - template_repository?: Repository | null; - /** @example ["octocat","atom","electron","API"] */ - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; + pull_requests: PullRequestMinimal[]; /** * @format date-time - * @example "2011-01-26T19:14:43Z" + * @example "2018-05-04T01:14:52Z" */ - updated_at: string; + started_at: string | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" + * The phase of the lifecycle that the check is currently in. + * @example "queued" */ + status: "queued" | "in_progress" | "completed"; + /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ url: string; - /** - * The repository visibility: public, private, or internal. - * @example "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; } /** - * Gist Comment - * A comment made to a gist. + * CheckSuite + * A suite of checks performed on the code of a given code change */ -export interface GistComment { - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" - */ - body: string; +export interface CheckSuite { + /** @example "d6fde92930d4715a2b49857d24b940956b26d2d3" */ + after: string | null; + app: Integration | null; + /** @example "146e867f55c26428e5f9fade55a9bbf5e95a7912" */ + before: string | null; + check_runs_url: string; + /** @example "neutral" */ + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null; + /** @format date-time */ + created_at: string | null; + /** @example "master" */ + head_branch: string | null; + /** Simple Commit */ + head_commit: SimpleCommit; /** - * @format date-time - * @example "2011-04-18T23:23:56Z" + * The SHA of the head commit that is being checked. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" */ - created_at: string; - /** @example 1 */ + head_sha: string; + /** @example 5 */ id: number; - /** @example "MDExOkdpc3RDb21tZW50MQ==" */ + latest_check_runs_count: number; + /** @example "MDEwOkNoZWNrU3VpdGU1" */ node_id: string; - /** - * @format date-time - * @example "2011-04-18T23:23:56Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1" - */ - url: string; - user: SimpleUser | null; + pull_requests: PullRequestMinimal[] | null; + /** Minimal Repository */ + repository: MinimalRepository; + /** @example "completed" */ + status: "queued" | "in_progress" | "completed" | null; + /** @format date-time */ + updated_at: string | null; + /** @example "https://api.github.com/repos/github/hello-world/check-suites/5" */ + url: string | null; } /** - * Gist Commit - * Gist Commit + * Check Suite Preference + * Check suite configuration preferences for a repository. */ -export interface GistCommit { - change_status: { - additions?: number; - deletions?: number; - total?: number; +export interface CheckSuitePreference { + preferences: { + auto_trigger_checks?: { + app_id: number; + setting: boolean; + }[]; }; - /** - * @format date-time - * @example "2010-04-14T02:15:15Z" - */ - committed_at: string; - /** - * @format uri - * @example "https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f" - */ - url: string; - user: SimpleUser | null; - /** @example "57a7f021a713b1c5a6a199b54cc514735d2d462f" */ - version: string; + /** A git repository */ + repository: Repository; } /** - * Gist Simple - * Gist Simple + * Clone Traffic + * Clone Traffic */ -export interface GistSimple { - comments?: number; - comments_url?: string; - commits_url?: string; - created_at?: string; - description?: string | null; - files?: Record< - string, - { - content?: string; - filename?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - type?: string; - } | null - >; - forks_url?: string; - git_pull_url?: string; - git_push_url?: string; - html_url?: string; - id?: string; - node_id?: string; - /** Simple User */ - owner?: SimpleUser; - public?: boolean; - truncated?: boolean; - updated_at?: string; - url?: string; - user?: string | null; +export interface CloneTraffic { + clones: Traffic[]; + /** @example 173 */ + count: number; + /** @example 128 */ + uniques: number; } /** - * Git Commit - * Low-level Git commit operations within a repository + * Code Frequency Stat + * Code Frequency Stat */ -export interface GitCommit { - /** Identifying information for the git-user */ - author: { - /** - * Timestamp of the commit - * @format date-time - * @example "2014-08-09T08:02:04+12:00" - */ - date: string; - /** - * Git email address of the user - * @example "monalisa.octocat@example.com" - */ - email: string; - /** - * Name of the git user - * @example "Monalisa Octocat" - */ - name: string; - }; - /** Identifying information for the git-user */ - committer: { - /** - * Timestamp of the commit - * @format date-time - * @example "2014-08-09T08:02:04+12:00" - */ - date: string; - /** - * Git email address of the user - * @example "monalisa.octocat@example.com" - */ - email: string; - /** - * Name of the git user - * @example "Monalisa Octocat" - */ - name: string; - }; - /** @format uri */ - html_url: string; +export type CodeFrequencyStat = number[]; + +/** + * Code Of Conduct + * Code Of Conduct + */ +export interface CodeOfConduct { /** - * Message describing the purpose of the commit - * @example "Fix #42" + * @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/ + * " */ - message: string; - node_id: string; - parents: { - /** @format uri */ - html_url: string; - /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - /** @format uri */ - url: string; - }[]; + body?: string; + /** @format uri */ + html_url: string | null; + /** @example "contributor_covenant" */ + key: string; + /** @example "Contributor Covenant" */ + name: string; /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + * @format uri + * @example "https://api.github.com/codes_of_conduct/contributor_covenant" */ - sha: string; - tree: { - /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - /** @format uri */ - url: string; - }; - /** @format uri */ url: string; - verification: { - payload: string | null; - reason: string; - signature: string | null; - verified: boolean; - }; } /** - * Git Reference - * Git references within a repository + * Code Of Conduct Simple + * Code of Conduct Simple */ -export interface GitRef { - node_id: string; - object: { - /** - * SHA for the reference - * @minLength 40 - * @maxLength 40 - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - type: string; - /** @format uri */ - url: string; - }; - ref: string; +export interface CodeOfConductSimple { /** @format uri */ - url: string; -} - -/** - * Git Tag - * Metadata for a Git tag - */ -export interface GitTag { - /** - * Message describing the purpose of the tag - * @example "Initial public release" - */ - message: string; - /** @example "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==" */ - node_id: string; - object: { - sha: string; - type: string; - /** @format uri */ - url: string; - }; - /** @example "940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ - sha: string; - /** - * Name of the tag - * @example "v0.0.1" - */ - tag: string; - tagger: { - date: string; - email: string; - name: string; - }; + html_url: string | null; + /** @example "citizen_code_of_conduct" */ + key: string; + /** @example "Citizen Code of Conduct" */ + name: string; /** - * URL for the tag * @format uri - * @example "https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" + * @example "https://api.github.com/codes_of_conduct/citizen_code_of_conduct" */ url: string; - verification?: Verification; +} + +export interface CodeScanningAlertCodeScanningAlert { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: AlertCreatedAt; + /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + dismissed_at: CodeScanningAlertDismissedAt; + /** Simple User */ + dismissed_by: SimpleUser; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason: CodeScanningAlertDismissedReason; + /** The GitHub URL of the alert resource. */ + html_url: AlertHtmlUrl; + instances: CodeScanningAlertInstances; + /** The security alert number. */ + number: AlertNumber; + rule: CodeScanningAlertRule; + /** State of a code scanning alert. */ + state: CodeScanningAlertState; + tool: CodeScanningAnalysisTool; + /** The REST API URL of the alert resource. */ + url: AlertUrl; +} + +export interface CodeScanningAlertCodeScanningAlertItems { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: AlertCreatedAt; + /** The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + dismissed_at: CodeScanningAlertDismissedAt; + /** Simple User */ + dismissed_by: SimpleUser; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason: CodeScanningAlertDismissedReason; + /** The GitHub URL of the alert resource. */ + html_url: AlertHtmlUrl; + /** The security alert number. */ + number: AlertNumber; + rule: CodeScanningAlertRule; + /** State of a code scanning alert. */ + state: CodeScanningAlertState; + tool: CodeScanningAnalysisTool; + /** The REST API URL of the alert resource. */ + url: AlertUrl; } /** - * Git Tree - * The hierarchy between files in a Git repository. + * The time that the alert was dismissed in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ -export interface GitTree { - sha: string; - /** - * Objects specifying a tree structure - * @example [{"path":"file.rb","mode":"100644","type":"blob","size":30,"sha":"44b4fc6d56897b048c772eb4087f854f46256132","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132","properties":{"path":{"type":"string"},"mode":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"sha":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"]}] - */ - tree: { - /** @example "040000" */ - mode?: string; - /** @example "test/file.rb" */ - path?: string; - /** @example "23f6827669e43831def8a7ad935069c8bd418261" */ - sha?: string; - /** @example 12 */ - size?: number; - /** @example "tree" */ - type?: string; - /** @example "https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261" */ - url?: string; - }[]; - truncated: boolean; - /** @format uri */ - url: string; +export type CodeScanningAlertDismissedAt = string | null; + +/** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ +export type CodeScanningAlertDismissedReason = + | "false positive" + | "won't fix" + | "used in tests" + | null; + +/** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ +export type CodeScanningAlertEnvironment = string; + +export type CodeScanningAlertInstances = + | { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key?: CodeScanningAnalysisAnalysisKey; + /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ + environment?: CodeScanningAlertEnvironment; + matrix_vars?: string | null; + /** The full Git reference, formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** State of a code scanning alert. */ + state?: CodeScanningAlertState; + }[] + | null; + +/** The full Git reference, formatted as \`refs/heads/\`. */ +export type CodeScanningAlertRef = string; + +export interface CodeScanningAlertRule { + /** A short description of the rule used to detect the alert. */ + description?: string; + /** A unique identifier for the rule used to detect the alert. */ + id?: string | null; + /** The severity of the alert. */ + severity?: "none" | "note" | "warning" | "error" | null; +} + +/** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ +export enum CodeScanningAlertSetState { + Open = "open", + Dismissed = "dismissed", +} + +/** State of a code scanning alert. */ +export enum CodeScanningAlertState { + Open = "open", + Dismissed = "dismissed", + Fixed = "fixed", +} + +/** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ +export type CodeScanningAnalysisAnalysisKey = string; + +export interface CodeScanningAnalysisCodeScanningAnalysis { + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + analysis_key: CodeScanningAnalysisAnalysisKey; + /** The commit SHA of the code scanning analysis file. */ + commit_sha: CodeScanningAnalysisCommitSha; + /** The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at: CodeScanningAnalysisCreatedAt; + /** Identifies the variable values associated with the environment in which this analysis was performed. */ + environment: CodeScanningAnalysisEnvironment; + /** @example "error reading field xyz" */ + error: string; + /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ + ref: CodeScanningAnalysisRef; + /** The name of the tool used to generate the code scanning analysis alert. */ + tool_name: CodeScanningAnalysisToolName; } /** - * Git User - * Metaproperties for Git author/committer information. + * The commit SHA of the code scanning analysis file. + * @minLength 40 + * @maxLength 40 + * @pattern ^[0-9a-fA-F]+$ */ -export interface GitUser { - /** @example ""2007-10-29T02:42:39.000-07:00"" */ - date?: string; - /** @example ""chris@ozmm.org"" */ - email?: string; - /** @example ""Chris Wanstrath"" */ - name?: string; -} +export type CodeScanningAnalysisCommitSha = string; /** - * Gitignore Template - * Gitignore Template + * The time that the analysis was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ -export interface GitignoreTemplate { - /** @example "C" */ - name: string; - /** - * @example "# Object files - * *.o - * - * # Libraries - * *.lib - * *.a - * - * # Shared objects (inc. Windows DLLs) - * *.dll - * *.so - * *.so.* - * *.dylib - * - * # Executables - * *.exe - * *.out - * *.app - * " - */ - source: string; +export type CodeScanningAnalysisCreatedAt = string; + +/** Identifies the variable values associated with the environment in which this analysis was performed. */ +export type CodeScanningAnalysisEnvironment = string; + +/** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ +export type CodeScanningAnalysisRef = string; + +/** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ +export type CodeScanningAnalysisSarifFile = string; + +export interface CodeScanningAnalysisTool { + /** The name of the tool used to generate the code scanning analysis alert. */ + name?: CodeScanningAnalysisToolName; + /** The version of the tool used to detect the alert. */ + version?: string | null; } +/** The name of the tool used to generate the code scanning analysis alert. */ +export type CodeScanningAnalysisToolName = string; + /** - * GPG Key - * A unique encryption key + * Code Search Result Item + * Code Search Result Item */ -export interface GpgKey { - /** @example true */ - can_certify: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - /** @example true */ - can_sign: boolean; - /** - * @format date-time - * @example "2016-03-24T11:31:04-06:00" - */ - created_at: string; - /** @example [{"email":"mastahyeti@users.noreply.github.com","verified":true}] */ - emails: { - email?: string; - verified?: boolean; - }[]; +export interface CodeSearchResultItem { + file_size?: number; + /** @format uri */ + git_url: string; + /** @format uri */ + html_url: string; + language?: string | null; /** @format date-time */ - expires_at: string | null; - /** @example 3 */ - id: number; - /** @example "3262EFF25BA0D270" */ - key_id: string; - primary_key_id: number | null; - /** @example "xsBNBFayYZ..." */ - public_key: string; - raw_key: string | null; - /** @example [{"id":4,"primary_key_id":3,"key_id":"4A595D4C72EE49C7","public_key":"zsBNBFayYZ...","emails":[],"subkeys":[],"can_sign":false,"can_encrypt_comms":true,"can_encrypt_storage":true,"can_certify":false,"created_at":"2016-03-24T11:31:04-06:00","expires_at":null}] */ - subkeys: { - can_certify?: boolean; - can_encrypt_comms?: boolean; - can_encrypt_storage?: boolean; - can_sign?: boolean; - created_at?: string; - emails?: any[]; - expires_at?: string | null; - id?: number; - key_id?: string; - primary_key_id?: number; - public_key?: string; - raw_key?: string | null; - subkeys?: any[]; - }[]; + last_modified_at?: string; + /** @example ["73..77","77..78"] */ + line_numbers?: string[]; + name: string; + path: string; + /** Minimal Repository */ + repository: MinimalRepository; + score: number; + sha: string; + text_matches?: SearchResultTextMatches; + /** @format uri */ + url: string; } /** - * GroupMapping - * External Groups to be mapped to a team for membership + * Collaborator + * Collaborator */ -export interface GroupMapping { - /** - * a description of the group - * @example "A group of Developers working on AzureAD SAML SSO" - */ - group_description?: string; - /** - * The ID of the group - * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" - */ - group_id?: string; - /** - * The name of the group - * @example "saml-azuread-test" - */ - group_name?: string; +export interface Collaborator { /** - * Array of groups to be mapped to this team - * @example [{"group_id":"111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa","group_name":"saml-azuread-test","group_description":"A group of Developers working on AzureAD SAML SSO"},{"group_id":"2bb2bb2b-bb22-22bb-2bb2-bb2bbb2bb2b2","group_name":"saml-azuread-test2","group_description":"Another group of Developers working on AzureAD SAML SSO"}] + * @format uri + * @example "https://github.com/images/error/octocat_happy.gif" */ - groups?: { - /** - * a description of the group - * @example "A group of Developers working on AzureAD SAML SSO" - */ - group_description: string; - /** - * The ID of the group - * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" - */ - group_id: string; - /** - * The name of the group - * @example "saml-azuread-test" - */ - group_name: string; - }[]; + avatar_url: string; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; /** - * synchronization status for this group mapping - * @example "unsynced" + * @format uri + * @example "https://api.github.com/users/octocat/followers" */ - status?: string; + followers_url: string; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; /** - * the time of the last sync for this group-mapping - * @example "2019-06-03 22:27:15:000 -700" + * @format uri + * @example "https://github.com/octocat" */ - synced_at?: string; -} - -/** - * Webhook - * Webhooks for repositories. - */ -export interface Hook { + html_url: string; + /** @example 1 */ + id: number; + /** @example "octocat" */ + login: string; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; /** - * Determines whether the hook is actually triggered on pushes. - * @example true + * @format uri + * @example "https://api.github.com/users/octocat/orgs" */ - active: boolean; - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** @example ""sha256"" */ - digest?: string; - /** @example ""foo@bar.com"" */ - email?: string; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""foo"" */ - password?: string; - /** @example ""roomer"" */ - room?: string; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** @example ""foo"" */ - subdomain?: string; - /** @example ""abc"" */ - token?: string; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; + organizations_url: string; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; }; /** - * @format date-time - * @example "2011-09-06T17:26:27Z" - */ - created_at: string; - /** - * Determines what events the hook is triggered for. Default: ['push']. - * @example ["push","pull_request"] - */ - events: string[]; - /** - * Unique identifier of the webhook. - * @example 42 - */ - id: number; - last_response: HookResponse; - /** - * The name of a valid service, use 'web' for a webhook. - * @example "web" + * @format uri + * @example "https://api.github.com/users/octocat/received_events" */ - name: string; + received_events_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings" + * @example "https://api.github.com/users/octocat/repos" */ - ping_url: string; + repos_url: string; + site_admin: boolean; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/test" + * @example "https://api.github.com/users/octocat/subscriptions" */ - test_url: string; + subscriptions_url: string; + /** @example "User" */ type: string; - /** - * @format date-time - * @example "2011-09-06T20:39:23Z" - */ - updated_at: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1" + * @example "https://api.github.com/users/octocat" */ url: string; } -/** Hook Response */ -export interface HookResponse { - code: number | null; - message: string | null; - status: string | null; +export interface CombinedBillingUsage { + /** Numbers of days left in billing cycle. */ + days_left_in_billing_cycle: number; + /** Estimated storage space (GB) used in billing cycle. */ + estimated_paid_storage_for_month: number; + /** Estimated sum of free and paid storage space (GB) used in billing cycle. */ + estimated_storage_for_month: number; } /** - * Hovercard - * Hovercard + * Combined Commit Status + * Combined Commit Status */ -export interface Hovercard { - contexts: { - message: string; - octicon: string; - }[]; +export interface CombinedCommitStatus { + /** @format uri */ + commit_url: string; + /** Minimal Repository */ + repository: MinimalRepository; + sha: string; + state: string; + statuses: SimpleCommitStatus[]; + total_count: number; + /** @format uri */ + url: string; } /** - * Import - * A repository import from an external source. + * Commit + * Commit */ -export interface Import { - authors_count?: number | null; - /** @format uri */ - authors_url: string; - commit_count?: number | null; - error_message?: string | null; - failed_step?: string | null; - has_large_files?: boolean; - /** @format uri */ - html_url: string; - import_percent?: number | null; - large_files_count?: number; - large_files_size?: number; - message?: string; - project_choices?: { - human_name?: string; - tfvc_project?: string; - vcs?: string; - }[]; - push_percent?: number | null; - /** @format uri */ - repository_url: string; - status: - | "auth" - | "error" - | "none" - | "detecting" - | "choose" - | "auth_failed" - | "importing" - | "mapping" - | "waiting_to_push" - | "pushing" - | "complete" - | "setup" - | "unknown" - | "detection_found_multiple" - | "detection_found_nothing" - | "detection_needs_auth"; - status_text?: string | null; - svc_root?: string; - svn_root?: string; - tfvc_project?: string; - /** @format uri */ - url: string; - use_lfs?: string; - vcs: string | null; - /** The URL of the originating repository. */ - vcs_url: string; -} - -/** - * Installation - * Installation - */ -export interface Installation { +export interface Commit { + author: SimpleUser | null; /** * @format uri - * @example "https://api.github.com/installations/1/access_tokens" + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments" */ - access_tokens_url: string; - account: SimpleUser | Enterprise | null; - /** @example 1 */ - app_id: number; - /** @example "github-actions" */ - app_slug: string; - /** @example ""test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"" */ - contact_email?: string | null; - /** @format date-time */ - created_at: string; - events: string[]; - /** @example true */ - has_multiple_single_files?: boolean; + comments_url: string; + commit: { + author: GitUser | null; + /** @example 0 */ + comment_count: number; + committer: GitUser | null; + /** @example "Fix all the bugs" */ + message: string; + tree: { + /** @example "827efc6d56897b048c772eb4087f854f46256132" */ + sha: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" + */ + url: string; + }; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + url: string; + verification?: Verification; + }; + committer: SimpleUser | null; + files?: { + additions?: number; + blob_url?: string; + changes?: number; + /** @example ""https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573"" */ + contents_url?: string; + deletions?: number; + filename?: string; + patch?: string; + /** @example ""subdir/before_name.txt"" */ + previous_filename?: string; + raw_url?: string; + /** @example ""1e8e60ce9733d5283f7836fa602b6365a66b2567"" */ + sha?: string; + status?: string; + }[]; /** * @format uri - * @example "https://github.com/organizations/github/settings/installations/1" + * @example "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ html_url: string; - /** - * The ID of the installation. - * @example 1 - */ - id: number; - /** @example {"issues":"read","deployments":"write"} */ - permissions: { - checks?: string; - contents?: string; - deployments?: string; - /** @example ""read"" */ - issues?: string; - metadata?: string; - /** @example ""read"" */ - organization_administration?: string; - pull_requests?: string; - statuses?: string; + /** @example "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==" */ + node_id: string; + parents: { + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd" + */ + html_url?: string; + /** @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ + sha: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd" + */ + url: string; + }[]; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + sha: string; + stats?: { + additions?: number; + deletions?: number; + total?: number; }; /** * @format uri - * @example "https://api.github.com/installation/repositories" + * @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - repositories_url: string; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection: "all" | "selected"; - /** @example "config.yaml" */ - single_file_name: string | null; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; - /** @format date-time */ - suspended_at?: string | null; - suspended_by?: SimpleUser | null; - /** The ID of the user or organization this token is being scoped to. */ - target_id: number; - /** @example "Organization" */ - target_type: string; - /** @format date-time */ - updated_at: string; + url: string; } /** - * Installation Token - * Authentication token for a GitHub App installed on a user or org. + * Commit Activity + * Commit Activity */ -export interface InstallationToken { - expires_at: string; - /** @example true */ - has_multiple_single_files?: boolean; - permissions?: { - contents?: string; - issues?: string; - /** @example "read" */ - metadata?: string; - /** @example "read" */ - single_file?: string; - }; - repositories?: Repository[]; - repository_selection?: "all" | "selected"; - /** @example "README.md" */ - single_file?: string; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; - token: string; +export interface CommitActivity { + /** @example [0,3,26,20,39,1,0] */ + days: number[]; + /** @example 89 */ + total: number; + /** @example 1336280400 */ + week: number; } /** - * GitHub app - * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + * Commit Comment + * Commit Comment */ -export interface Integration { - /** @example ""Iv1.25b5d1e65ffc4022"" */ - client_id?: string; - /** @example ""1d4b2097ac622ba702d19de498f005747a8b21d3"" */ - client_secret?: string; - /** - * @format date-time - * @example "2017-07-08T16:18:44-04:00" - */ +export interface CommitComment { + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + body: string; + commit_id: string; + /** @format date-time */ created_at: string; - /** @example "The description of the app." */ - description: string | null; - /** - * The list of events for the GitHub app - * @example ["label","deployment"] - */ - events: string[]; + /** @format uri */ + html_url: string; + id: number; + line: number | null; + node_id: string; + path: string | null; + position: number | null; + reactions?: ReactionRollup; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + user: SimpleUser | null; +} + +/** + * Commit Comparison + * Commit Comparison + */ +export interface CommitComparison { + /** @example 4 */ + ahead_by: number; + /** Commit */ + base_commit: Commit; + /** @example 5 */ + behind_by: number; + commits: Commit[]; /** * @format uri - * @example "https://example.com" + * @example "https://github.com/octocat/Hello-World/compare/master...topic.diff" */ - external_url: string; + diff_url: string; + files: DiffEntry[]; /** * @format uri - * @example "https://github.com/apps/super-ci" + * @example "https://github.com/octocat/Hello-World/compare/master...topic" */ html_url: string; + /** Commit */ + merge_base_commit: Commit; /** - * Unique identifier of the GitHub app - * @example 37 + * @format uri + * @example "https://github.com/octocat/Hello-World/compare/master...topic.patch" */ - id: number; - /** - * The number of installations associated with the GitHub app - * @example 5 - */ - installations_count?: number; - /** - * The name of the GitHub app - * @example "Probot Owners" - */ - name: string; - /** @example "MDExOkludGVncmF0aW9uMQ==" */ - node_id: string; - owner: SimpleUser | null; - /** @example ""-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\n-----END RSA PRIVATE KEY-----\\n"" */ - pem?: string; - /** - * The set of permissions for the GitHub app - * @example {"issues":"read","deployments":"write"} - */ - permissions: { - checks?: string; - contents?: string; - deployments?: string; - issues?: string; - metadata?: string; - [key: string]: any; - }; + patch_url: string; /** - * The slug name of the GitHub app - * @example "probot-owners" + * @format uri + * @example "https://github.com/octocat/Hello-World/compare/octocat:bbcd538c8e72b8c175046e27cc8f907076331401...octocat:0328041d1152db8ae77652d1618a02e57f745f17" */ - slug?: string; + permalink_url: string; + /** @example "ahead" */ + status: "diverged" | "ahead" | "behind" | "identical"; + /** @example 6 */ + total_commits: number; /** - * @format date-time - * @example "2017-07-08T16:18:44-04:00" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/compare/master...topic" */ - updated_at: string; - /** @example ""6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b"" */ - webhook_secret?: string; - [key: string]: any; -} - -/** - * The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. - * @example "one_month" - */ -export enum InteractionExpiry { - OneDay = "one_day", - ThreeDays = "three_days", - OneWeek = "one_week", - OneMonth = "one_month", - SixMonths = "six_months", + url: string; } /** - * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. - * @example "collaborators_only" + * Commit Search Result Item + * Commit Search Result Item */ -export enum InteractionGroup { - ExistingUsers = "existing_users", - ContributorsOnly = "contributors_only", - CollaboratorsOnly = "collaborators_only", +export interface CommitSearchResultItem { + author: SimpleUser | null; + /** @format uri */ + comments_url: string; + commit: { + author: { + /** @format date-time */ + date: string; + email: string; + name: string; + }; + comment_count: number; + committer: GitUser | null; + message: string; + tree: { + sha: string; + /** @format uri */ + url: string; + }; + /** @format uri */ + url: string; + verification?: Verification; + }; + committer: GitUser | null; + /** @format uri */ + html_url: string; + node_id: string; + parents: { + html_url?: string; + sha?: string; + url?: string; + }[]; + /** Minimal Repository */ + repository: MinimalRepository; + score: number; + sha: string; + text_matches?: SearchResultTextMatches; + /** @format uri */ + url: string; } -/** - * Interaction Restrictions - * Limit interactions to a specific type of user for a specified duration - */ -export interface InteractionLimit { - /** The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. */ - expiry?: InteractionExpiry; - /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ - limit: InteractionGroup; +/** Community Health File */ +export interface CommunityHealthFile { + /** @format uri */ + html_url: string; + /** @format uri */ + url: string; } /** - * Interaction Limits - * Interaction limit settings. + * Community Profile + * Community Profile */ -export interface InteractionLimitResponse { +export interface CommunityProfile { + /** @example true */ + content_reports_enabled?: boolean; + /** @example "My first repository on GitHub!" */ + description: string | null; + /** @example "example.com" */ + documentation: string | null; + files: { + code_of_conduct: CodeOfConductSimple | null; + contributing: CommunityHealthFile | null; + issue_template: CommunityHealthFile | null; + license: LicenseSimple | null; + pull_request_template: CommunityHealthFile | null; + readme: CommunityHealthFile | null; + }; + /** @example 100 */ + health_percentage: number; /** * @format date-time - * @example "2018-08-17T04:18:39Z" + * @example "2017-02-28T19:09:29Z" */ - expires_at: string; - /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ - limit: InteractionGroup; - /** @example "repository" */ - origin: string; + updated_at: string | null; } /** - * Issue - * Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + * Content Directory + * A list of directory items */ -export interface Issue { - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** - * Contents of the issue - * @example "It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?" - */ - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - closed_by?: SimpleUser | null; - comments: number; +export type ContentDirectory = { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content?: string; /** @format uri */ - comments_url: string; - /** @format date-time */ - created_at: string; + download_url: string | null; /** @format uri */ - events_url: string; + git_url: string | null; /** @format uri */ - html_url: string; - id: number; - /** - * Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository - * @example ["bug","registration"] - */ - labels: ( - | string - | { - color?: string | null; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - /** @format uri */ - url?: string; - } - )[]; - labels_url: string; - locked: boolean; - milestone: Milestone | null; - node_id: string; - /** - * Number uniquely identifying the issue within its repository - * @example 42 - */ - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { - /** @format uri */ - diff_url: string | null; + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; + /** @format uri */ + url: string; +}[]; + +/** + * Content File + * Content File + */ +export interface ContentFile { + _links: { /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; + git: string | null; /** @format uri */ - patch_url: string | null; + html: string | null; /** @format uri */ - url: string | null; + self: string; }; - reactions?: ReactionRollup; - /** A git repository */ - repository?: Repository; + content: string; /** @format uri */ - repository_url: string; - /** - * State of the issue; either 'open' or 'closed' - * @example "open" - */ - state: string; + download_url: string | null; + encoding: string; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + /** @example ""git://example.com/defunkt/dotjs.git"" */ + submodule_git_url?: string; + /** @example ""actual/actual.md"" */ + target?: string; + type: string; /** @format uri */ - timeline_url?: string; - /** - * Title of the issue - * @example "Widget creation fails in Safari on OS X 10.8" - */ - title: string; - /** @format date-time */ - updated_at: string; - /** - * URL for the issue - * @format uri - * @example "https://api.github.com/repositories/42/issues/1" - */ url: string; - user: SimpleUser | null; } /** - * Issue Comment - * Comments provide a way for people to collaborate on an issue. + * ContentReferenceAttachment + * Content Reference attachments allow you to provide context around URLs posted in comments */ -export interface IssueComment { - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** - * Contents of the issue comment - * @example "What version of Safari were you using when you observed this bug?" - */ - body?: string; - body_html?: string; - body_text?: string; +export interface ContentReferenceAttachment { /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * The body of the attachment + * @maxLength 262144 + * @example "Body of the attachment" */ - created_at: string; - /** @format uri */ - html_url: string; + body: string; /** - * Unique identifier of the issue comment - * @example 42 + * The ID of the attachment + * @example 21 */ id: number; - /** @format uri */ - issue_url: string; - node_id: string; - performed_via_github_app?: Integration | null; - reactions?: ReactionRollup; /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * The node_id of the content attachment + * @example "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=" */ - updated_at: string; + node_id?: string; /** - * URL for the issue comment - * @format uri - * @example "https://api.github.com/repositories/42/issues/comments/1" + * The title of the attachment + * @maxLength 1024 + * @example "Title of the attachment" */ - url: string; - user: SimpleUser | null; + title: string; } /** - * Issue Event - * Issue Event + * Symlink Content + * An object describing a symlink */ -export interface IssueEvent { - actor: SimpleUser | null; - assignee?: SimpleUser | null; - assigner?: SimpleUser | null; - /** How the author is associated with the repository. */ - author_association?: AuthorAssociation; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_id: string | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_url: string | null; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - created_at: string; - dismissed_review?: IssueEventDismissedReview; - /** @example "closed" */ - event: string; - /** @example 1 */ - id: number; - /** Issue Simple */ - issue?: IssueSimple; - /** Issue Event Label */ - label?: IssueEventLabel; - lock_reason?: string | null; - /** Issue Event Milestone */ - milestone?: IssueEventMilestone; - /** @example "MDEwOklzc3VlRXZlbnQx" */ - node_id: string; - /** Issue Event Project Card */ - project_card?: IssueEventProjectCard; - /** Issue Event Rename */ - rename?: IssueEventRename; - requested_reviewer?: SimpleUser | null; - /** Groups of organization members that gives permissions on specified repositories. */ - requested_team?: Team; - review_requester?: SimpleUser | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/events/1" - */ +export interface ContentSubmodule { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + /** @format uri */ + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + /** @format uri */ + submodule_git_url: string; + type: string; + /** @format uri */ url: string; } -/** Issue Event Dismissed Review */ -export interface IssueEventDismissedReview { - dismissal_commit_id?: string | null; - dismissal_message: string | null; - review_id: number; - state: string; -} - -/** - * Issue Event for Issue - * Issue Event for Issue - */ -export interface IssueEventForIssue { - /** Simple User */ - actor?: SimpleUser; - /** How the author is associated with the repository. */ - author_association?: AuthorAssociation; - /** @example "":+1:"" */ - body?: string; - /** @example ""

Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam.

"" */ - body_html?: string; - /** @example ""Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam."" */ - body_text?: string; - commit_id?: string | null; - commit_url?: string | null; - created_at?: string; - event?: string; - /** @example ""https://github.com/owner-3906e11a33a3d55ba449d63f/BBB_Private_Repo/commit/480d4f47447129f015cb327536c522ca683939a1"" */ - html_url?: string; - id?: number; - /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/issues/1"" */ - issue_url?: string; - /** @example ""off-topic"" */ - lock_reason?: string; - /** @example ""add a bunch of files"" */ - message?: string; - node_id?: string; - /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/pulls/2"" */ - pull_request_url?: string; - /** @example ""480d4f47447129f015cb327536c522ca683939a1"" */ - sha?: string; - /** @example ""commented"" */ - state?: string; - /** @example ""2020-07-09T00:17:51Z"" */ - submitted_at?: string; - /** @example ""2020-07-09T00:17:36Z"" */ - updated_at?: string; - url?: string; -} - -/** - * Issue Event Label - * Issue Event Label - */ -export interface IssueEventLabel { - color: string | null; - name: string | null; -} - -/** - * Issue Event Milestone - * Issue Event Milestone - */ -export interface IssueEventMilestone { - title: string; -} - /** - * Issue Event Project Card - * Issue Event Project Card + * Symlink Content + * An object describing a symlink */ -export interface IssueEventProjectCard { - column_name: string; - id: number; - previous_column_name?: string; - project_id: number; +export interface ContentSymlink { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; /** @format uri */ - project_url: string; + download_url: string | null; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + target: string; + type: string; /** @format uri */ url: string; } /** - * Issue Event Rename - * Issue Event Rename + * Content Traffic + * Content Traffic */ -export interface IssueEventRename { - from: string; - to: string; +export interface ContentTraffic { + /** @example 3542 */ + count: number; + /** @example "/github/hubot" */ + path: string; + /** @example "github/hubot: A customizable life embetterment robot." */ + title: string; + /** @example 2225 */ + uniques: number; } /** - * Issue Search Result Item - * Issue Search Result Item + * Content Tree + * Content Tree */ -export interface IssueSearchResultItem { - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - comments: number; - /** @format uri */ - comments_url: string; - /** @format date-time */ - created_at: string; - draft?: boolean; - /** @format uri */ - events_url: string; +export interface ContentTree { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; /** @format uri */ - html_url: string; - id: number; - labels: { - color?: string; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; - labels_url: string; - locked: boolean; - milestone: Milestone | null; - node_id: string; - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { + download_url: string | null; + entries?: { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content?: string; /** @format uri */ - diff_url: string | null; + download_url: string | null; /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; + git_url: string | null; /** @format uri */ - patch_url: string | null; + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; /** @format uri */ - url: string | null; - }; - /** A git repository */ - repository?: Repository; + url: string; + }[]; /** @format uri */ - repository_url: string; - score: number; - state: string; - text_matches?: SearchResultTextMatches; + git_url: string | null; /** @format uri */ - timeline_url?: string; - title: string; - /** @format date-time */ - updated_at: string; + html_url: string | null; + name: string; + path: string; + sha: string; + size: number; + type: string; /** @format uri */ url: string; - user: SimpleUser | null; } /** - * Issue Simple - * Issue Simple + * Contributor + * Contributor */ -export interface IssueSimple { - /** @example "too heated" */ - active_lock_reason?: string | null; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** @example "I'm having a problem with this." */ - body?: string; - body_html?: string; - body_text?: string; - /** @format date-time */ - closed_at: string | null; - /** @example 0 */ - comments: number; +export interface Contributor { + /** @format uri */ + avatar_url?: string; + contributions: number; + email?: string; + events_url?: string; + /** @format uri */ + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string | null; + /** @format uri */ + html_url?: string; + id?: number; + login?: string; + name?: string; + node_id?: string; + /** @format uri */ + organizations_url?: string; + /** @format uri */ + received_events_url?: string; + /** @format uri */ + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + /** @format uri */ + subscriptions_url?: string; + type: string; + /** @format uri */ + url?: string; +} + +/** + * Contributor Activity + * Contributor Activity + */ +export interface ContributorActivity { + author: SimpleUser | null; + /** @example 135 */ + total: number; + /** @example [{"w":"1367712000","a":6898,"d":77,"c":10}] */ + weeks: { + a?: number; + c?: number; + d?: number; + w?: string; + }[]; +} + +/** + * Credential Authorization + * Credential Authorization + */ +export interface CredentialAuthorization { + /** @example 12345678 */ + authorized_credential_id?: number | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + * The note given to the token. This will only be present when the credential is a token. + * @example "my token" */ - comments_url: string; + authorized_credential_note?: string | null; + /** + * The title given to the ssh key. This will only be present when the credential is an ssh key. + * @example "my ssh key" + */ + authorized_credential_title?: string | null; /** + * Date when the credential was last accessed. May be null if it was never accessed * @format date-time - * @example "2011-04-22T13:33:48Z" + * @example "2011-01-26T19:06:43Z" */ - created_at: string; + credential_accessed_at?: string | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/events" + * Date when the credential was authorized for use. + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - events_url: string; + credential_authorized_at: string; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/issues/1347" + * Unique identifier for the credential. + * @example 1 */ - html_url: string; - /** @example 1 */ - id: number; - labels: Label[]; - /** @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}" */ - labels_url: string; - /** @example true */ - locked: boolean; - milestone: Milestone | null; - /** @example "MDU6SXNzdWUx" */ - node_id: string; - /** @example 1347 */ - number: number; - performed_via_github_app?: Integration | null; - pull_request?: { - /** @format uri */ - diff_url: string | null; - /** @format uri */ - html_url: string | null; - /** @format date-time */ - merged_at?: string | null; - /** @format uri */ - patch_url: string | null; - /** @format uri */ - url: string | null; - }; - /** A git repository */ - repository?: Repository; + credential_id: number; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" + * Human-readable description of the credential type. + * @example "SSH Key" */ - repository_url: string; - /** @example "open" */ - state: string; - /** @format uri */ - timeline_url?: string; - /** @example "Found a bug" */ - title: string; + credential_type: string; /** - * @format date-time - * @example "2011-04-22T13:33:48Z" + * Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. + * @example "jklmnop12345678" */ - updated_at: string; + fingerprint?: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" + * User login that owns the underlying credential. + * @example "monalisa" */ - url: string; - user: SimpleUser | null; -} - -/** - * Job - * Information of a job execution in a workflow run - */ -export interface Job { - /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ - check_run_url: string; - /** - * The time that the job finished, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" - */ - completed_at: string | null; - /** - * The outcome of the job. - * @example "success" - */ - conclusion: string | null; - /** - * The SHA of the commit that is being run. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" - */ - head_sha: string; - /** @example "https://github.com/github/hello-world/runs/4" */ - html_url: string | null; - /** - * The id of the job. - * @example 21 - */ - id: number; - /** - * The name of the job. - * @example "test-coverage" - */ - name: string; - /** @example "MDg6Q2hlY2tSdW40" */ - node_id: string; - /** - * The id of the associated workflow run. - * @example 5 - */ - run_id: number; - /** @example "https://api.github.com/repos/github/hello-world/actions/runs/5" */ - run_url: string; + login: string; /** - * The time that the job started, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" + * List of oauth scopes the token has been granted. + * @example ["user","repo"] */ - started_at: string; + scopes?: string[]; /** - * The phase of the lifecycle that the job is currently in. - * @example "queued" + * Last eight characters of the credential. Only included in responses with credential_type of personal access token. + * @example "12345678" */ - status: "queued" | "in_progress" | "completed"; - /** Steps in this job. */ - steps?: { - /** - * The time that the job finished, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" - */ - completed_at?: string | null; - /** - * The outcome of the job. - * @example "success" - */ - conclusion: string | null; - /** - * The name of the job. - * @example "test-coverage" - */ - name: string; - /** @example 1 */ - number: number; - /** - * The time that the step started, in ISO 8601 format. - * @format date-time - * @example "2019-08-08T08:00:00-07:00" - */ - started_at?: string | null; - /** - * The phase of the lifecycle that the job is currently in. - * @example "queued" - */ - status: "queued" | "in_progress" | "completed"; - }[]; - /** @example "https://api.github.com/repos/github/hello-world/actions/jobs/21" */ - url: string; + token_last_eight?: string; } /** - * Key - * Key + * Deploy Key + * An SSH key granting access to a single repository. */ -export interface Key { - /** @format date-time */ +export interface DeployKey { created_at: string; id: number; key: string; - key_id: string; read_only: boolean; title: string; url: string; @@ -12335,8522 +11667,7289 @@ export interface Key { } /** - * Key Simple - * Key Simple - */ -export interface KeySimple { - id: number; - key: string; -} - -/** - * Label - * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + * Deployment + * A request for a specific ref(branch,sha,tag) to be deployed */ -export interface Label { +export interface Deployment { /** - * 6-character hex code, without the leading #, identifying the color - * @example "FFFFFF" + * @format date-time + * @example "2012-07-20T01:19:13Z" */ - color: string; - /** @example true */ - default: boolean; - /** @example "Something isn't working" */ + created_at: string; + creator: SimpleUser | null; + /** @example "Deploy request from hubot" */ description: string | null; - /** @example 208045946 */ - id: number; /** - * The name of the label. - * @example "bug" + * Name for the target deployment environment. + * @example "production" */ - name: string; - /** @example "MDU6TGFiZWwyMDgwNDU5NDY=" */ - node_id: string; + environment: string; /** - * URL for the label - * @format uri - * @example "https://api.github.com/repositories/42/labels/bug" + * Unique identifier of the deployment + * @example 42 */ - url: string; -} - -/** - * Label Search Result Item - * Label Search Result Item - */ -export interface LabelSearchResultItem { - color: string; - default: boolean; - description: string | null; id: number; - name: string; + /** @example "MDEwOkRlcGxveW1lbnQx" */ node_id: string; - score: number; - text_matches?: SearchResultTextMatches; - /** @format uri */ - url: string; -} - -/** - * Language - * Language - */ -export type Language = Record; - -/** - * License - * License - */ -export interface License { + /** @example "staging" */ + original_environment?: string; + payload: object; + performed_via_github_app?: Integration | null; /** - * @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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * 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. - * " + * Specifies if the given environment is one that end-users directly interact with. Default: false. + * @example true */ - body: string; - /** @example ["include-copyright"] */ - conditions: string[]; - /** @example "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty." */ - description: string; - /** @example true */ - featured: boolean; + production_environment?: boolean; + /** + * The ref to deploy. This can be a branch, tag, or sha. + * @example "topic-branch" + */ + ref: string; /** * @format uri - * @example "http://choosealicense.com/licenses/mit/" + * @example "https://api.github.com/repos/octocat/example" */ - html_url: string; - /** @example "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders." */ - implementation: string; - /** @example "mit" */ - key: string; - /** @example ["no-liability"] */ - limitations: string[]; - /** @example "MIT License" */ - name: string; - /** @example "MDc6TGljZW5zZW1pdA==" */ - node_id: string; - /** @example ["commercial-use","modifications","distribution","sublicense","private-use"] */ - permissions: string[]; - /** @example "MIT" */ - spdx_id: string | null; + repository_url: string; + /** @example "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d" */ + sha: string; /** * @format uri - * @example "https://api.github.com/licenses/mit" + * @example "https://api.github.com/repos/octocat/example/deployments/1/statuses" */ - url: string | null; + statuses_url: string; + /** + * Parameter to specify a task to execute + * @example "deploy" + */ + task: string; + /** + * Specifies if the given environment is will no longer exist at some point in the future. Default: false. + * @example true + */ + transient_environment?: boolean; + /** + * @format date-time + * @example "2012-07-20T01:19:13Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/deployments/1" + */ + url: string; } /** - * License Content - * License Content - */ -export interface LicenseContent { - _links: { - /** @format uri */ - git: string | null; - /** @format uri */ - html: string | null; - /** @format uri */ - self: string; - }; - content: string; - /** @format uri */ - download_url: string | null; - encoding: string; - /** @format uri */ - git_url: string | null; - /** @format uri */ - html_url: string | null; - license: LicenseSimple | null; - name: string; - path: string; - sha: string; - size: number; - type: string; - /** @format uri */ - url: string; -} - -/** - * License Simple - * License Simple + * Deployment Status + * The status of a deployment. */ -export interface LicenseSimple { - /** @format uri */ - html_url?: string; - /** @example "mit" */ - key: string; - /** @example "MIT License" */ - name: string; - /** @example "MDc6TGljZW5zZW1pdA==" */ - node_id: string; - /** @example "MIT" */ - spdx_id: string | null; +export interface DeploymentStatus { /** - * @format uri - * @example "https://api.github.com/licenses/mit" + * @format date-time + * @example "2012-07-20T01:19:13Z" */ - url: string | null; -} - -/** - * Link - * Hypermedia Link - */ -export interface Link { - href: string; -} - -/** - * Link With Type - * Hypermedia Link with Type - */ -export interface LinkWithType { - href: string; - type: string; -} - -/** Marketplace Account */ -export interface MarketplaceAccount { - /** @format email */ - email?: string | null; - id: number; - login: string; - node_id?: string; - /** @format email */ - organization_billing_email?: string | null; - type: string; - /** @format uri */ - url: string; -} - -/** - * Marketplace Listing Plan - * Marketplace Listing Plan - */ -export interface MarketplaceListingPlan { + created_at: string; + creator: SimpleUser | null; /** * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313/accounts" + * @example "https://api.github.com/repos/octocat/example/deployments/42" + */ + deployment_url: string; + /** + * A short description of the status. + * @maxLength 140 + * @default "" + * @example "Deployment finished successfully." */ - accounts_url: string; - /** @example ["Up to 25 private repositories","11 concurrent builds"] */ - bullets: string[]; - /** @example "A professional-grade CI solution" */ description: string; - /** @example true */ - has_free_trial: boolean; - /** @example 1313 */ - id: number; - /** @example 1099 */ - monthly_price_in_cents: number; - /** @example "Pro" */ - name: string; - /** @example 3 */ - number: number; - /** @example "flat-rate" */ - price_model: string; - /** @example "published" */ - state: string; - unit_name: string | null; /** + * The environment of the deployment that the status is for. + * @default "" + * @example "production" + */ + environment?: string; + /** + * The URL for accessing your environment. * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313" + * @default "" + * @example "https://staging.example.com/" */ - url: string; - /** @example 11870 */ - yearly_price_in_cents: number; -} - -/** - * Marketplace Purchase - * Marketplace Purchase - */ -export interface MarketplacePurchase { + environment_url?: string; + /** @example 1 */ id: number; - login: string; - marketplace_pending_change?: { - effective_date?: string; - id?: number; - is_installed?: boolean; - /** Marketplace Listing Plan */ - plan?: MarketplaceListingPlan; - unit_count?: number | null; - } | null; - marketplace_purchase: { - billing_cycle?: string; - free_trial_ends_on?: string | null; - is_installed?: boolean; - next_billing_date?: string | null; - on_free_trial?: boolean; - /** Marketplace Listing Plan */ - plan?: MarketplaceListingPlan; - unit_count?: number | null; - updated_at?: string; - }; - organization_billing_email?: string; - type: string; - url: string; -} - -/** - * Migration - * A migration. - */ -export interface Migration { - /** @format uri */ - archive_url?: string; /** - * @format date-time - * @example "2015-07-06T15:33:38-07:00" + * The URL to associate with this status. + * @format uri + * @default "" + * @example "https://example.com/deployment/42/output" */ - created_at: string; - exclude?: any[]; - exclude_attachments: boolean; - /** @example "0b989ba4-242f-11e5-81e1-c7b6966d2516" */ - guid: string; - /** @example 79 */ - id: number; - /** @example true */ - lock_repositories: boolean; + log_url?: string; + /** @example "MDE2OkRlcGxveW1lbnRTdGF0dXMx" */ node_id: string; - owner: SimpleUser | null; - repositories: Repository[]; - /** @example "pending" */ - state: string; + performed_via_github_app?: Integration | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example" + */ + repository_url: string; + /** + * The state of the status. + * @example "success" + */ + state: + | "error" + | "failure" + | "inactive" + | "pending" + | "success" + | "queued" + | "in_progress"; + /** + * Deprecated: the URL to associate with this status. + * @format uri + * @default "" + * @example "https://example.com/deployment/42/output" + */ + target_url: string; /** * @format date-time - * @example "2015-07-06T15:33:38-07:00" + * @example "2012-07-20T01:19:13Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/orgs/octo-org/migrations/79" + * @example "https://api.github.com/repos/octocat/example/deployments/42/statuses/1" */ url: string; } /** - * Milestone - * A collection of related issues and pull requests. + * Diff Entry + * Diff Entry */ -export interface Milestone { - /** - * @format date-time - * @example "2013-02-12T13:22:01Z" - */ - closed_at: string | null; - /** @example 8 */ - closed_issues: number; - /** - * @format date-time - * @example "2011-04-10T20:09:31Z" - */ - created_at: string; - creator: SimpleUser | null; - /** @example "Tracking milestone for version 1.0" */ - description: string | null; +export interface DiffEntry { + /** @example 103 */ + additions: number; /** - * @format date-time - * @example "2012-10-09T23:39:01Z" + * @format uri + * @example "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" */ - due_on: string | null; + blob_url: string; + /** @example 124 */ + changes: number; /** * @format uri - * @example "https://github.com/octocat/Hello-World/milestones/v1.0" + * @example "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - html_url: string; - /** @example 1002604 */ - id: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" - */ - labels_url: string; - /** @example "MDk6TWlsZXN0b25lMTAwMjYwNA==" */ - node_id: string; - /** - * The number of the milestone. - * @example 42 - */ - number: number; - /** @example 4 */ - open_issues: number; - /** - * The state of the milestone. - * @default "open" - * @example "open" - */ - state: "open" | "closed"; - /** - * The title of the milestone. - * @example "v1.0" - */ - title: string; - /** - * @format date-time - * @example "2014-03-03T18:58:10Z" - */ - updated_at: string; + contents_url: string; + /** @example 21 */ + deletions: number; + /** @example "file1.txt" */ + filename: string; + /** @example "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" */ + patch?: string; + /** @example "file.txt" */ + previous_filename?: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1" + * @example "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" */ - url: string; + raw_url: string; + /** @example "bbcd538c8e72b8c175046e27cc8f907076331401" */ + sha: string; + /** @example "added" */ + status: string; } /** - * Minimal Repository - * Minimal Repository + * Email + * Email */ -export interface MinimalRepository { - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - archived?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - clone_url?: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; +export interface Email { /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" + * @format email + * @example "octocat@github.com" */ - contributors_url: string; + email: string; + /** @example true */ + primary: boolean; + /** @example true */ + verified: boolean; + /** @example "public" */ + visibility: string | null; +} + +/** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ +export enum EnabledOrganizations { + All = "all", + None = "none", + Selected = "selected", +} + +/** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ +export enum EnabledRepositories { + All = "all", + None = "none", + Selected = "selected", +} + +/** + * Enterprise + * An enterprise account + */ +export interface Enterprise { + /** @format uri */ + avatar_url: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at?: string | null; - default_branch?: string; - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - disabled?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" - */ - events_url: string; - fork: boolean; - /** @example 0 */ - forks?: number; - forks_count?: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - git_url?: string; - has_downloads?: boolean; - has_issues?: boolean; - has_pages?: boolean; - has_projects?: boolean; - has_wiki?: boolean; - homepage?: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @example "2019-01-26T19:01:12Z" */ - hooks_url: string; + created_at: string | null; + /** A short description of the enterprise. */ + description?: string | null; /** * @format uri - * @example "https://github.com/octocat/Hello-World" + * @example "https://github.com/enterprises/octo-business" */ html_url: string; - /** @example 1296269 */ - id: number; - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language?: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" + * Unique identifier of the enterprise + * @example 42 */ - languages_url: string; - license?: { - key?: string; - name?: string; - node_id?: string; - spdx_id?: string; - url?: string; - } | null; + id: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" + * The name of the enterprise. + * @example "Octo Business" */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; - mirror_url?: string | null; - /** @example "Hello-World" */ name: string; - network_count?: number; /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - /** @example 0 */ - open_issues?: number; - open_issues_count?: number; - owner: SimpleUser | null; - permissions?: { - admin?: boolean; - pull?: boolean; - push?: boolean; - }; - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; - /** - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - pushed_at?: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - size?: number; - ssh_url?: string; - stargazers_count?: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" - */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + * The slug url identifier for the enterprise. + * @example "octo-business" */ - subscribers_url: string; + slug: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + * @format date-time + * @example "2019-01-26T19:14:43Z" */ - subscription_url: string; - svn_url?: string; + updated_at: string | null; /** + * The enterprise's website URL. * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: Repository | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at?: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - url: string; - visibility?: string; - /** @example 0 */ - watchers?: number; - watchers_count?: number; + website_url?: string | null; } /** - * Org Hook - * Org Hook + * Event + * Event */ -export interface OrgHook { - /** @example true */ - active: boolean; - config: { - /** @example ""form"" */ - content_type?: string; - /** @example ""0"" */ - insecure_ssl?: string; - /** @example ""********"" */ - secret?: string; - /** @example ""http://example.com/2"" */ +export interface Event { + /** Actor */ + actor: Actor; + /** @format date-time */ + created_at: string | null; + id: string; + /** Actor */ + org?: Actor; + payload: { + action: string; + /** Comments provide a way for people to collaborate on an issue. */ + comment?: IssueComment; + /** Issue Simple */ + issue?: IssueSimple; + pages?: { + action?: string; + html_url?: string; + page_name?: string; + sha?: string; + summary?: string | null; + title?: string; + }[]; + }; + public: boolean; + repo: { + id: number; + name: string; + /** @format uri */ + url: string; + }; + type: string | null; +} + +/** + * Feed + * Feed + */ +export interface Feed { + _links: { + /** Hypermedia Link with Type */ + current_user?: LinkWithType; + /** Hypermedia Link with Type */ + current_user_actor?: LinkWithType; + /** Hypermedia Link with Type */ + current_user_organization?: LinkWithType; + current_user_organizations?: LinkWithType[]; + /** Hypermedia Link with Type */ + current_user_public?: LinkWithType; + /** Hypermedia Link with Type */ + security_advisories?: LinkWithType; + /** Hypermedia Link with Type */ + timeline: LinkWithType; + /** Hypermedia Link with Type */ + user: LinkWithType; + }; + /** @example "https://github.com/octocat.private.actor?token=abc123" */ + current_user_actor_url?: string; + /** @example "https://github.com/octocat-org" */ + current_user_organization_url?: string; + /** @example ["https://github.com/organizations/github/octocat.private.atom?token=abc123"] */ + current_user_organization_urls?: string[]; + /** @example "https://github.com/octocat" */ + current_user_public_url?: string; + /** @example "https://github.com/octocat.private?token=abc123" */ + current_user_url?: string; + /** @example "https://github.com/security-advisories" */ + security_advisories_url?: string; + /** @example "https://github.com/timeline" */ + timeline_url: string; + /** @example "https://github.com/{user}" */ + user_url: string; +} + +/** + * File Commit + * File Commit + */ +export interface FileCommit { + commit: { + author?: { + date?: string; + email?: string; + name?: string; + }; + committer?: { + date?: string; + email?: string; + name?: string; + }; + html_url?: string; + message?: string; + node_id?: string; + parents?: { + html_url?: string; + sha?: string; + url?: string; + }[]; + sha?: string; + tree?: { + sha?: string; + url?: string; + }; url?: string; + verification?: { + payload?: string | null; + reason?: string; + signature?: string | null; + verified?: boolean; + }; }; + content: { + _links?: { + git?: string; + html?: string; + self?: string; + }; + download_url?: string; + git_url?: string; + html_url?: string; + name?: string; + path?: string; + sha?: string; + size?: number; + type?: string; + url?: string; + } | null; +} + +/** + * Full Repository + * Full Repository + */ +export interface FullRepository { + /** @example true */ + allow_merge_commit?: boolean; + /** @example true */ + allow_rebase_merge?: boolean; + /** @example true */ + allow_squash_merge?: boolean; /** - * @format date-time - * @example "2011-09-06T17:26:27Z" + * Whether anonymous git access is allowed. + * @default true */ - created_at: string; - /** @example ["push","pull_request"] */ - events: string[]; - /** @example 1 */ - id: number; - /** @example "web" */ - name: string; + anonymous_access_enabled?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** * @format uri - * @example "https://api.github.com/orgs/octocat/hooks/1/pings" + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - ping_url: string; - type: string; + contributors_url: string; /** * @format date-time - * @example "2011-09-06T20:39:23Z" + * @example "2011-01-26T19:01:12Z" */ - updated_at: string; + created_at: string; + /** @example "master" */ + default_branch: string; + /** @example false */ + delete_branch_on_merge?: boolean; /** * @format uri - * @example "https://api.github.com/orgs/octocat/hooks/1" + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - url: string; -} - -/** - * Org Membership - * Org Membership - */ -export interface OrgMembership { - /** Organization Simple */ - organization: OrganizationSimple; + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; /** * @format uri - * @example "https://api.github.com/orgs/octocat" + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - organization_url: string; - permissions?: { - can_create_repository: boolean; - }; - /** @example "admin" */ - role: string; - /** @example "active" */ - state: string; + downloads_url: string; /** * @format uri - * @example "https://api.github.com/orgs/octocat/memberships/defunkt" + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - url: string; - user: SimpleUser | null; -} - -/** - * Actions Secret for an Organization - * Secrets for GitHub Actions for an organization. - */ -export interface OrganizationActionsSecret { - /** @format date-time */ - created_at: string; - /** - * The name of the secret. - * @example "SECRET_TOKEN" - */ - name: string; + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** * @format uri - * @example "https://api.github.com/organizations/org/secrets/my_secret/repositories" - */ - selected_repositories_url?: string; - /** @format date-time */ - updated_at: string; - /** Visibility of a secret */ - visibility: "all" | "private" | "selected"; -} - -/** - * Organization Full - * Organization Full - */ -export interface OrganizationFull { - /** @example "https://github.com/images/error/octocat_happy.gif" */ - avatar_url: string; - /** - * @format email - * @example "org@example.com" + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - billing_email?: string | null; + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; + /** @example true */ + has_downloads: boolean; + /** @example true */ + has_issues: boolean; + has_pages: boolean; + /** @example true */ + has_projects: boolean; + /** @example true */ + has_wiki: boolean; /** * @format uri - * @example "https://github.com/blog" - */ - blog?: string; - /** @example 8 */ - collaborators?: number | null; - /** @example "GitHub" */ - company?: string; - /** - * @format date-time - * @example "2008-01-14T04:33:35Z" - */ - created_at: string; - default_repository_permission?: string | null; - /** @example "A great organization" */ - description: string | null; - /** @example 10000 */ - disk_usage?: number | null; - /** - * @format email - * @example "octocat@github.com" + * @example "https://github.com" */ - email?: string; + homepage: string | null; /** * @format uri - * @example "https://api.github.com/orgs/github/events" + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - events_url: string; - /** @example 20 */ - followers: number; - /** @example 0 */ - following: number; - /** @example true */ - has_organization_projects: boolean; - /** @example true */ - has_repository_projects: boolean; - /** @example "https://api.github.com/orgs/github/hooks" */ hooks_url: string; /** * @format uri - * @example "https://github.com/octocat" + * @example "https://github.com/octocat/Hello-World" */ html_url: string; - /** @example 1 */ + /** @example 1296269 */ id: number; /** @example true */ - is_verified?: boolean; - /** @example "https://api.github.com/orgs/github/issues" */ + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ issues_url: string; - /** @example "San Francisco" */ - location?: string; - /** @example "github" */ - login: string; - /** @example "all" */ - members_allowed_repository_creation_type?: string; - /** @example true */ - members_can_create_internal_repositories?: boolean; - /** @example true */ - members_can_create_pages?: boolean; - /** @example true */ - members_can_create_private_repositories?: boolean; - /** @example true */ - members_can_create_public_repositories?: boolean; - /** @example true */ - members_can_create_repositories?: boolean | null; - /** @example "https://api.github.com/orgs/github/members{/member}" */ - members_url: string; - /** @example "github" */ - name?: string; - /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ - node_id: string; - /** @example 100 */ - owned_private_repos?: number; - plan?: { - filled_seats?: number; - name: string; - private_repos: number; - seats?: number; - space: number; - }; - /** @example 81 */ - private_gists?: number | null; - /** @example 1 */ - public_gists: number; - /** @example "https://api.github.com/orgs/github/public_members{/member}" */ - public_members_url: string; - /** @example 2 */ - public_repos: number; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; /** * @format uri - * @example "https://api.github.com/orgs/github/repos" + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - repos_url: string; - /** @example 100 */ - total_private_repos?: number; - /** @example "github" */ - twitter_username?: string | null; - /** @example true */ - two_factor_requirement_enabled?: boolean | null; - /** @example "Organization" */ - type: string; - /** @format date-time */ - updated_at: string; + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; /** * @format uri - * @example "https://api.github.com/orgs/github" + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - url: string; -} - -/** - * Organization Invitation - * Organization Invitation - */ -export interface OrganizationInvitation { - created_at: string; - email: string | null; - failed_at?: string; - failed_reason?: string; - id: number; - invitation_team_url: string; - /** @example ""https://api.github.com/organizations/16/invitations/1/teams"" */ - invitation_teams_url?: string; - /** Simple User */ - inviter: SimpleUser; - login: string | null; - /** @example ""MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x"" */ - node_id: string; - role: string; - team_count: number; -} - -/** - * Organization Simple - * Organization Simple - */ -export interface OrganizationSimple { - /** @example "https://github.com/images/error/octocat_happy.gif" */ - avatar_url: string; - /** @example "A great organization" */ - description: string | null; + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; /** * @format uri - * @example "https://api.github.com/orgs/github/events" + * @example "git:git.example.com/octocat/Hello-World" */ - events_url: string; - /** @example "https://api.github.com/orgs/github/hooks" */ - hooks_url: string; - /** @example 1 */ - id: number; - /** @example "https://api.github.com/orgs/github/issues" */ - issues_url: string; - /** @example "github" */ - login: string; - /** @example "https://api.github.com/orgs/github/members{/member}" */ - members_url: string; - /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ + mirror_url: string | null; + /** @example "Hello-World" */ + name: string; + /** @example 0 */ + network_count: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ node_id: string; - /** @example "https://api.github.com/orgs/github/public_members{/member}" */ - public_members_url: string; - /** - * @format uri - * @example "https://api.github.com/orgs/github/repos" - */ - repos_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + organization?: SimpleUser | null; + owner: SimpleUser | null; + /** A git repository */ + parent?: Repository; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * @format uri - * @example "https://api.github.com/orgs/github" + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - url: string; -} - -export interface PackagesBillingUsage { - /** Free storage space (GB) for GitHub Packages. */ - included_gigabytes_bandwidth: number; - /** Sum of the free and paid storage space (GB) for GitHuub Packages. */ - total_gigabytes_bandwidth_used: number; - /** Total paid storage space (GB) for GitHuub Packages. */ - total_paid_gigabytes_bandwidth_used: number; -} - -/** - * GitHub Pages - * The configuration for GitHub Pages for a repository. - */ -export interface Page { + pushed_at: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** A git repository */ + source?: Repository; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; /** - * Whether the Page has a custom 404 page. - * @default false - * @example false + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - custom_404: boolean; + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + /** @example 42 */ + subscribers_count: number; /** - * The Pages site's custom domain - * @example "example.com" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - cname: string | null; + subscribers_url: string; /** - * The web address the Page can be accessed from. * @format uri - * @example "https://example.com" + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - html_url?: string; + subscription_url: string; /** - * Whether the GitHub Pages site is publicly visible. If set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. - * @example true + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" */ - public: boolean; - source?: PagesSourceHash; + svn_url: string; /** - * The status of the most recent build of the Page. - * @example "built" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - status: "built" | "building" | "errored" | null; + tags_url: string; /** - * The API address for accessing this Page resource. * @format uri - * @example "https://api.github.com/repos/github/hello-world/pages" + * @example "http://api.github.com/repos/octocat/Hello-World/teams" + */ + teams_url: string; + temp_clone_token?: string | null; + template_repository?: Repository | null; + /** @example ["octocat","atom","electron","API"] */ + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; + /** + * @format date-time + * @example "2011-01-26T19:14:43Z" */ - url: string; -} - -/** - * Page Build - * Page Build - */ -export interface PageBuild { - commit: string; - /** @format date-time */ - created_at: string; - duration: number; - error: { - message: string | null; - }; - pusher: SimpleUser | null; - status: string; - /** @format date-time */ updated_at: string; - /** @format uri */ - url: string; -} - -/** - * Page Build Status - * Page Build Status - */ -export interface PageBuildStatus { - /** @example "queued" */ - status: string; /** * @format uri - * @example "https://api.github.com/repos/github/hello-world/pages/builds/latest" + * @example "https://api.github.com/repos/octocat/Hello-World" */ url: string; -} - -/** Pages Source Hash */ -export interface PagesSourceHash { - branch: string; - path: string; -} - -/** Participation Stats */ -export interface ParticipationStats { - all: number[]; - owner: number[]; -} - -/** - * Porter Author - * Porter Author - */ -export interface PorterAuthor { - email: string; - id: number; - /** @format uri */ - import_url: string; - name: string; - remote_id: string; - remote_name: string; - /** @format uri */ - url: string; -} - -/** - * Porter Large File - * Porter Large File - */ -export interface PorterLargeFile { - oid: string; - path: string; - ref_name: string; - size: number; + /** + * The repository visibility: public, private, or internal. + * @example "public" + */ + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; } /** - * Private User - * Private User + * Gist Comment + * A comment made to a gist. */ -export interface PrivateUser { +export interface GistComment { + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; /** - * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" */ - avatar_url: string; - /** @example "There once was..." */ - bio: string | null; - /** @example "https://github.com/blog" */ - blog: string | null; - business_plus?: boolean; - /** @example 8 */ - collaborators: number; - /** @example "GitHub" */ - company: string | null; + body: string; /** * @format date-time - * @example "2008-01-14T04:33:35Z" + * @example "2011-04-18T23:23:56Z" */ created_at: string; - /** @example 10000 */ - disk_usage: number; - /** - * @format email - * @example "octocat@github.com" - */ - email: string | null; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ - events_url: string; - /** @example 20 */ - followers: number; - /** - * @format uri - * @example "https://api.github.com/users/octocat/followers" - */ - followers_url: string; - /** @example 0 */ - following: number; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; - hireable: boolean | null; - /** - * @format uri - * @example "https://github.com/octocat" - */ - html_url: string; /** @example 1 */ id: number; - ldap_dn?: string; - /** @example "San Francisco" */ - location: string | null; - /** @example "octocat" */ - login: string; - /** @example "monalisa octocat" */ - name: string | null; - /** @example "MDQ6VXNlcjE=" */ + /** @example "MDExOkdpc3RDb21tZW50MQ==" */ node_id: string; + /** + * @format date-time + * @example "2011-04-18T23:23:56Z" + */ + updated_at: string; /** * @format uri - * @example "https://api.github.com/users/octocat/orgs" + * @example "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1" */ - organizations_url: string; - /** @example 100 */ - owned_private_repos: number; - plan?: { - collaborators: number; - name: string; - private_repos: number; - space: number; + url: string; + user: SimpleUser | null; +} + +/** + * Gist Commit + * Gist Commit + */ +export interface GistCommit { + change_status: { + additions?: number; + deletions?: number; + total?: number; }; - /** @example 81 */ - private_gists: number; - /** @example 1 */ - public_gists: number; - /** @example 2 */ - public_repos: number; /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" + * @format date-time + * @example "2010-04-14T02:15:15Z" */ - received_events_url: string; + committed_at: string; /** * @format uri - * @example "https://api.github.com/users/octocat/repos" - */ - repos_url: string; - site_admin: boolean; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" - */ - subscriptions_url: string; - /** @format date-time */ - suspended_at?: string | null; - /** @example 100 */ - total_private_repos: number; - /** @example "monalisa" */ - twitter_username?: string | null; - /** @example true */ - two_factor_authentication: boolean; - /** @example "User" */ - type: string; - /** - * @format date-time - * @example "2008-01-14T04:33:35Z" - */ - updated_at: string; - /** - * @format uri - * @example "https://api.github.com/users/octocat" + * @example "https://api.github.com/gists/aa5a315d61ae9438b18d/57a7f021a713b1c5a6a199b54cc514735d2d462f" */ url: string; + user: SimpleUser | null; + /** @example "57a7f021a713b1c5a6a199b54cc514735d2d462f" */ + version: string; } /** - * Project - * Projects are a way to organize columns and cards of work. + * Gist Simple + * Gist Simple */ -export interface Project { - /** - * Body of the project - * @example "This project represents the sprint of the first week in January" - */ - body: string | null; - /** - * @format uri - * @example "https://api.github.com/projects/1002604/columns" - */ - columns_url: string; - /** - * @format date-time - * @example "2011-04-10T20:09:31Z" - */ - created_at: string; - creator: SimpleUser | null; - /** - * @format uri - * @example "https://github.com/api-playground/projects-test/projects/12" - */ +export interface GistSimple { + comments?: number; + comments_url?: string; + commits_url?: string; + created_at?: string; + description?: string | null; + files?: Record< + string, + { + content?: string; + filename?: string; + language?: string; + raw_url?: string; + size?: number; + truncated?: boolean; + type?: string; + } | null + >; + forks_url?: string; + git_pull_url?: string; + git_push_url?: string; + html_url?: string; + id?: string; + node_id?: string; + /** Simple User */ + owner?: SimpleUser; + public?: boolean; + truncated?: boolean; + updated_at?: string; + url?: string; + user?: string | null; +} + +/** + * Git Commit + * Low-level Git commit operations within a repository + */ +export interface GitCommit { + /** Identifying information for the git-user */ + author: { + /** + * Timestamp of the commit + * @format date-time + * @example "2014-08-09T08:02:04+12:00" + */ + date: string; + /** + * Git email address of the user + * @example "monalisa.octocat@example.com" + */ + email: string; + /** + * Name of the git user + * @example "Monalisa Octocat" + */ + name: string; + }; + /** Identifying information for the git-user */ + committer: { + /** + * Timestamp of the commit + * @format date-time + * @example "2014-08-09T08:02:04+12:00" + */ + date: string; + /** + * Git email address of the user + * @example "monalisa.octocat@example.com" + */ + email: string; + /** + * Name of the git user + * @example "Monalisa Octocat" + */ + name: string; + }; + /** @format uri */ html_url: string; - /** @example 1002604 */ - id: number; /** - * Name of the project - * @example "Week One Sprint" + * Message describing the purpose of the commit + * @example "Fix #42" */ - name: string; - /** @example "MDc6UHJvamVjdDEwMDI2MDQ=" */ + message: string; node_id: string; - /** @example 1 */ - number: number; - /** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ - organization_permission?: "read" | "write" | "admin" | "none"; + parents: { + /** @format uri */ + html_url: string; + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + /** @format uri */ + url: string; + }[]; /** - * @format uri - * @example "https://api.github.com/repos/api-playground/projects-test" + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" */ - owner_url: string; - /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ - private?: boolean; + sha: string; + tree: { + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + /** @format uri */ + url: string; + }; + /** @format uri */ + url: string; + verification: { + payload: string | null; + reason: string; + signature: string | null; + verified: boolean; + }; +} + +/** + * Git Reference + * Git references within a repository + */ +export interface GitRef { + node_id: string; + object: { + /** + * SHA for the reference + * @minLength 40 + * @maxLength 40 + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + type: string; + /** @format uri */ + url: string; + }; + ref: string; + /** @format uri */ + url: string; +} + +/** + * Git Tag + * Metadata for a Git tag + */ +export interface GitTag { /** - * State of the project; either 'open' or 'closed' - * @example "open" + * Message describing the purpose of the tag + * @example "Initial public release" */ - state: string; + message: string; + /** @example "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==" */ + node_id: string; + object: { + sha: string; + type: string; + /** @format uri */ + url: string; + }; + /** @example "940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ + sha: string; /** - * @format date-time - * @example "2014-03-03T18:58:10Z" + * Name of the tag + * @example "v0.0.1" */ - updated_at: string; + tag: string; + tagger: { + date: string; + email: string; + name: string; + }; /** + * URL for the tag * @format uri - * @example "https://api.github.com/projects/1002604" + * @example "https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ url: string; + verification?: Verification; } /** - * Project Card - * Project cards represent a scope of work. + * Git Tree + * The hierarchy between files in a Git repository. */ -export interface ProjectCard { +export interface GitTree { + sha: string; /** - * Whether or not the card is archived - * @example false + * Objects specifying a tree structure + * @example [{"path":"file.rb","mode":"100644","type":"blob","size":30,"sha":"44b4fc6d56897b048c772eb4087f854f46256132","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132","properties":{"path":{"type":"string"},"mode":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"sha":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"]}] */ - archived?: boolean; - /** - * @format uri - * @example "https://api.github.com/projects/columns/367" - */ - column_url: string; + tree: { + /** @example "040000" */ + mode?: string; + /** @example "test/file.rb" */ + path?: string; + /** @example "23f6827669e43831def8a7ad935069c8bd418261" */ + sha?: string; + /** @example 12 */ + size?: number; + /** @example "tree" */ + type?: string; + /** @example "https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261" */ + url?: string; + }[]; + truncated: boolean; + /** @format uri */ + url: string; +} + +/** + * Git User + * Metaproperties for Git author/committer information. + */ +export interface GitUser { + /** @example ""2007-10-29T02:42:39.000-07:00"" */ + date?: string; + /** @example ""chris@ozmm.org"" */ + email?: string; + /** @example ""Chris Wanstrath"" */ + name?: string; +} + +/** + * Gitignore Template + * Gitignore Template + */ +export interface GitignoreTemplate { + /** @example "C" */ + name: string; /** - * @format uri - * @example "https://api.github.com/repos/api-playground/projects-test/issues/3" + * @example "# Object files + * *.o + * + * # Libraries + * *.lib + * *.a + * + * # Shared objects (inc. Windows DLLs) + * *.dll + * *.so + * *.so.* + * *.dylib + * + * # Executables + * *.exe + * *.out + * *.app + * " */ - content_url?: string; + source: string; +} + +/** + * GPG Key + * A unique encryption key + */ +export interface GpgKey { + /** @example true */ + can_certify: boolean; + can_encrypt_comms: boolean; + can_encrypt_storage: boolean; + /** @example true */ + can_sign: boolean; /** * @format date-time - * @example "2016-09-05T14:21:06Z" + * @example "2016-03-24T11:31:04-06:00" */ created_at: string; - creator: SimpleUser | null; + /** @example [{"email":"mastahyeti@users.noreply.github.com","verified":true}] */ + emails: { + email?: string; + verified?: boolean; + }[]; + /** @format date-time */ + expires_at: string | null; + /** @example 3 */ + id: number; + /** @example "3262EFF25BA0D270" */ + key_id: string; + primary_key_id: number | null; + /** @example "xsBNBFayYZ..." */ + public_key: string; + raw_key: string | null; + /** @example [{"id":4,"primary_key_id":3,"key_id":"4A595D4C72EE49C7","public_key":"zsBNBFayYZ...","emails":[],"subkeys":[],"can_sign":false,"can_encrypt_comms":true,"can_encrypt_storage":true,"can_certify":false,"created_at":"2016-03-24T11:31:04-06:00","expires_at":null}] */ + subkeys: { + can_certify?: boolean; + can_encrypt_comms?: boolean; + can_encrypt_storage?: boolean; + can_sign?: boolean; + created_at?: string; + emails?: any[]; + expires_at?: string | null; + id?: number; + key_id?: string; + primary_key_id?: number; + public_key?: string; + raw_key?: string | null; + subkeys?: any[]; + }[]; +} + +/** + * GroupMapping + * External Groups to be mapped to a team for membership + */ +export interface GroupMapping { /** - * The project card's ID - * @example 42 + * a description of the group + * @example "A group of Developers working on AzureAD SAML SSO" */ - id: number; - /** @example "MDExOlByb2plY3RDYXJkMTQ3OA==" */ - node_id: string; - /** @example "Add payload for delete Project column" */ - note: string | null; + group_description?: string; /** - * @format uri - * @example "https://api.github.com/projects/120" + * The ID of the group + * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" */ - project_url: string; + group_id?: string; /** - * @format date-time - * @example "2016-09-05T14:20:22Z" + * The name of the group + * @example "saml-azuread-test" */ - updated_at: string; + group_name?: string; /** - * @format uri - * @example "https://api.github.com/projects/columns/cards/1478" + * Array of groups to be mapped to this team + * @example [{"group_id":"111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa","group_name":"saml-azuread-test","group_description":"A group of Developers working on AzureAD SAML SSO"},{"group_id":"2bb2bb2b-bb22-22bb-2bb2-bb2bbb2bb2b2","group_name":"saml-azuread-test2","group_description":"Another group of Developers working on AzureAD SAML SSO"}] */ - url: string; + groups?: { + /** + * a description of the group + * @example "A group of Developers working on AzureAD SAML SSO" + */ + group_description: string; + /** + * The ID of the group + * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" + */ + group_id: string; + /** + * The name of the group + * @example "saml-azuread-test" + */ + group_name: string; + }[]; + /** + * synchronization status for this group mapping + * @example "unsynced" + */ + status?: string; + /** + * the time of the last sync for this group-mapping + * @example "2019-06-03 22:27:15:000 -700" + */ + synced_at?: string; } /** - * Project Column - * Project columns contain cards of work. + * Webhook + * Webhooks for repositories. */ -export interface ProjectColumn { +export interface Hook { /** - * @format uri - * @example "https://api.github.com/projects/columns/367/cards" + * Determines whether the hook is actually triggered on pushes. + * @example true */ - cards_url: string; + active: boolean; + config: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** @example ""sha256"" */ + digest?: string; + /** @example ""foo@bar.com"" */ + email?: string; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""foo"" */ + password?: string; + /** @example ""roomer"" */ + room?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** @example ""foo"" */ + subdomain?: string; + /** @example ""abc"" */ + token?: string; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; + }; /** * @format date-time - * @example "2016-09-05T14:18:44Z" + * @example "2011-09-06T17:26:27Z" */ created_at: string; /** - * The unique identifier of the project column + * Determines what events the hook is triggered for. Default: ['push']. + * @example ["push","pull_request"] + */ + events: string[]; + /** + * Unique identifier of the webhook. * @example 42 */ id: number; + last_response: HookResponse; /** - * Name of the project column - * @example "Remaining tasks" + * The name of a valid service, use 'web' for a webhook. + * @example "web" */ name: string; - /** @example "MDEzOlByb2plY3RDb2x1bW4zNjc=" */ - node_id: string; /** * @format uri - * @example "https://api.github.com/projects/120" + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings" */ - project_url: string; + ping_url: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1/test" + */ + test_url: string; + type: string; /** * @format date-time - * @example "2016-09-05T14:22:28Z" + * @example "2011-09-06T20:39:23Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/projects/columns/367" + * @example "https://api.github.com/repos/octocat/Hello-World/hooks/1" */ url: string; } +/** Hook Response */ +export interface HookResponse { + code: number | null; + message: string | null; + status: string | null; +} + /** - * Protected Branch - * Branch protections protect branches + * Hovercard + * Hovercard */ -export interface ProtectedBranch { - allow_deletions?: { - enabled: boolean; - }; - allow_force_pushes?: { - enabled: boolean; - }; - enforce_admins?: { - enabled: boolean; - /** @format uri */ - url: string; - }; - required_linear_history?: { - enabled: boolean; - }; - required_pull_request_reviews?: { - dismiss_stale_reviews?: boolean; - dismissal_restrictions?: { - teams: Team[]; - /** @format uri */ - teams_url: string; - /** @format uri */ - url: string; - users: SimpleUser[]; - /** @format uri */ - users_url: string; - }; - require_code_owner_reviews?: boolean; - required_approving_review_count?: number; - /** @format uri */ - url: string; - }; - required_signatures?: { - /** @example true */ - enabled: boolean; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" - */ - url: string; - }; - /** Status Check Policy */ - required_status_checks?: StatusCheckPolicy; - /** Branch Restriction Policy */ - restrictions?: BranchRestrictionPolicy; - /** @format uri */ - url: string; +export interface Hovercard { + contexts: { + message: string; + octicon: string; + }[]; } /** - * Protected Branch Admin Enforced - * Protected Branch Admin Enforced + * Import + * A repository import from an external source. */ -export interface ProtectedBranchAdminEnforced { - /** @example true */ - enabled: boolean; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" - */ +export interface Import { + authors_count?: number | null; + /** @format uri */ + authors_url: string; + commit_count?: number | null; + error_message?: string | null; + failed_step?: string | null; + has_large_files?: boolean; + /** @format uri */ + html_url: string; + import_percent?: number | null; + large_files_count?: number; + large_files_size?: number; + message?: string; + project_choices?: { + human_name?: string; + tfvc_project?: string; + vcs?: string; + }[]; + push_percent?: number | null; + /** @format uri */ + repository_url: string; + status: + | "auth" + | "error" + | "none" + | "detecting" + | "choose" + | "auth_failed" + | "importing" + | "mapping" + | "waiting_to_push" + | "pushing" + | "complete" + | "setup" + | "unknown" + | "detection_found_multiple" + | "detection_found_nothing" + | "detection_needs_auth"; + status_text?: string | null; + svc_root?: string; + svn_root?: string; + tfvc_project?: string; + /** @format uri */ url: string; + use_lfs?: string; + vcs: string | null; + /** The URL of the originating repository. */ + vcs_url: string; } /** - * Protected Branch Pull Request Review - * Protected Branch Pull Request Review + * Installation + * Installation */ -export interface ProtectedBranchPullRequestReview { - /** @example true */ - dismiss_stale_reviews: boolean; - dismissal_restrictions?: { - /** The list of teams with review dismissal access. */ - teams?: Team[]; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams"" */ - teams_url?: string; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions"" */ - url?: string; - /** The list of users with review dismissal access. */ - users?: SimpleUser[]; - /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"" */ - users_url?: string; - }; - /** @example true */ - require_code_owner_reviews: boolean; - /** - * @min 1 - * @max 6 - * @example 2 - */ - required_approving_review_count?: number; +export interface Installation { /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" + * @example "https://api.github.com/installations/1/access_tokens" */ - url?: string; -} - -/** - * Public User - * Public User - */ -export interface PublicUser { - /** @format uri */ - avatar_url: string; - bio: string | null; - blog: string | null; - /** @example 3 */ - collaborators?: number; - company: string | null; + access_tokens_url: string; + account: SimpleUser | Enterprise | null; + /** @example 1 */ + app_id: number; + /** @example "github-actions" */ + app_slug: string; + /** @example ""test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com"" */ + contact_email?: string | null; /** @format date-time */ created_at: string; - /** @example 1 */ - disk_usage?: number; - /** @format email */ - email: string | null; - events_url: string; - followers: number; - /** @format uri */ - followers_url: string; - following: number; - following_url: string; - gists_url: string; - gravatar_id: string | null; - hireable: boolean | null; - /** @format uri */ + events: string[]; + /** @example true */ + has_multiple_single_files?: boolean; + /** + * @format uri + * @example "https://github.com/organizations/github/settings/installations/1" + */ html_url: string; + /** + * The ID of the installation. + * @example 1 + */ id: number; - location: string | null; - login: string; - name: string | null; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @example 2 */ - owned_private_repos?: number; - plan?: { - collaborators: number; - name: string; - private_repos: number; - space: number; + /** @example {"issues":"read","deployments":"write"} */ + permissions: { + checks?: string; + contents?: string; + deployments?: string; + /** @example ""read"" */ + issues?: string; + metadata?: string; + /** @example ""read"" */ + organization_administration?: string; + pull_requests?: string; + statuses?: string; }; - /** @example 1 */ - private_gists?: number; - public_gists: number; - public_repos: number; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; + /** + * @format uri + * @example "https://api.github.com/installation/repositories" + */ + repositories_url: string; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: "all" | "selected"; + /** @example "config.yaml" */ + single_file_name: string | null; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; /** @format date-time */ suspended_at?: string | null; - /** @example 2 */ - total_private_repos?: number; - twitter_username?: string | null; - type: string; + suspended_by?: SimpleUser | null; + /** The ID of the user or organization this token is being scoped to. */ + target_id: number; + /** @example "Organization" */ + target_type: string; /** @format date-time */ updated_at: string; - /** @format uri */ - url: string; } /** - * Pull Request - * Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. + * Installation Token + * Authentication token for a GitHub App installed on a user or org. */ -export interface PullRequest { - _links: { - /** Hypermedia Link */ - comments: Link; - /** Hypermedia Link */ - commits: Link; - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - issue: Link; - /** Hypermedia Link */ - review_comment: Link; - /** Hypermedia Link */ - review_comments: Link; - /** Hypermedia Link */ - self: Link; - /** Hypermedia Link */ - statuses: Link; - }; - /** @example "too heated" */ - active_lock_reason?: string | null; - /** @example 100 */ - additions: number; - assignee: SimpleUser | null; - assignees?: SimpleUser[] | null; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** The status of auto merging a pull request. */ - auto_merge: AutoMerge; - base: { - label: string; - ref: string; - repo: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - /** @format uri */ - contributors_url: string; - /** @format date-time */ - created_at: string; - default_branch: string; - /** @format uri */ - deployments_url: string; - description: string | null; - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ - events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; - /** @format uri */ - hooks_url: string; - /** @format uri */ - html_url: string; - id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; - node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - size: number; - ssh_url: string; - stargazers_count: number; - /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; - /** @format uri */ - subscription_url: string; - /** @format uri */ - svn_url: string; - /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - topics?: string[]; - trees_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - watchers: number; - watchers_count: number; - }; - sha: string; - user: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; +export interface InstallationToken { + expires_at: string; + /** @example true */ + has_multiple_single_files?: boolean; + permissions?: { + contents?: string; + issues?: string; + /** @example "read" */ + metadata?: string; + /** @example "read" */ + single_file?: string; }; - /** @example "Please pull these awesome changes" */ - body: string | null; - /** @example 5 */ - changed_files: number; + repositories?: Repository[]; + repository_selection?: "all" | "selected"; + /** @example "README.md" */ + single_file?: string; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; + token: string; +} + +/** + * GitHub app + * GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + */ +export interface Integration { + /** @example ""Iv1.25b5d1e65ffc4022"" */ + client_id?: string; + /** @example ""1d4b2097ac622ba702d19de498f005747a8b21d3"" */ + client_secret?: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" + * @example "2017-07-08T16:18:44-04:00" */ - closed_at: string | null; - /** @example 10 */ - comments: number; + created_at: string; + /** @example "The description of the app." */ + description: string | null; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + * The list of events for the GitHub app + * @example ["label","deployment"] */ - comments_url: string; - /** @example 3 */ - commits: number; + events: string[]; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + * @example "https://example.com" */ - commits_url: string; + external_url: string; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * @format uri + * @example "https://github.com/apps/super-ci" */ - created_at: string; - /** @example 3 */ - deletions: number; + html_url: string; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + * Unique identifier of the GitHub app + * @example 37 */ - diff_url: string; + id: number; /** - * Indicates whether or not the pull request is a draft. - * @example false + * The number of installations associated with the GitHub app + * @example 5 */ - draft?: boolean; - head: { - label: string; - ref: string; - repo: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - /** @format uri */ - contributors_url: string; - /** @format date-time */ - created_at: string; - default_branch: string; - /** @format uri */ - deployments_url: string; - description: string | null; - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ - events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; - /** @format uri */ - hooks_url: string; - /** @format uri */ - html_url: string; - id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: { - key: string; - name: string; - node_id: string; - spdx_id: string | null; - /** @format uri */ - url: string | null; - } | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; - node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - size: number; - ssh_url: string; - stargazers_count: number; - /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; - /** @format uri */ - subscription_url: string; - /** @format uri */ - svn_url: string; - /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - topics?: string[]; - trees_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - watchers: number; - watchers_count: number; - }; - sha: string; - user: { - /** @format uri */ - avatar_url: string; - events_url: string; - /** @format uri */ - followers_url: string; - following_url: string; - gists_url: string; - gravatar_id: string | null; - /** @format uri */ - html_url: string; - id: number; - login: string; - node_id: string; - /** @format uri */ - organizations_url: string; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - type: string; - /** @format uri */ - url: string; - }; - }; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347" - */ - html_url: string; - /** @example 1 */ - id: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" - */ - issue_url: string; - labels: { - color?: string; - default?: boolean; - description?: string | null; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; - /** @example true */ - locked: boolean; - /** - * Indicates whether maintainers can modify the pull request. - * @example true - */ - maintainer_can_modify: boolean; - /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ - merge_commit_sha: string | null; - /** @example true */ - mergeable: boolean | null; - /** @example "clean" */ - mergeable_state: string; - merged: boolean; + installations_count?: number; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * The name of the GitHub app + * @example "Probot Owners" */ - merged_at: string | null; - merged_by: SimpleUser | null; - milestone: Milestone | null; - /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + name: string; + /** @example "MDExOkludGVncmF0aW9uMQ==" */ node_id: string; + owner: SimpleUser | null; + /** @example ""-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\\n-----END RSA PRIVATE KEY-----\\n"" */ + pem?: string; /** - * Number uniquely identifying the pull request within its repository. - * @example 42 + * The set of permissions for the GitHub app + * @example {"issues":"read","deployments":"write"} */ - number: number; + permissions: { + checks?: string; + contents?: string; + deployments?: string; + issues?: string; + metadata?: string; + [key: string]: any; + }; /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + * The slug name of the GitHub app + * @example "probot-owners" */ - patch_url: string; - /** @example true */ - rebaseable?: boolean | null; - requested_reviewers?: SimpleUser[] | null; - requested_teams?: TeamSimple[] | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ - review_comment_url: string; - /** @example 0 */ - review_comments: number; + slug?: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" - */ - review_comments_url: string; - /** - * State of this Pull Request. Either \`open\` or \`closed\`. - * @example "open" - */ - state: "open" | "closed"; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - statuses_url: string; - /** - * The title of the pull request. - * @example "Amazing new feature" - */ - title: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * @format date-time + * @example "2017-07-08T16:18:44-04:00" */ updated_at: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" - */ - url: string; - user: SimpleUser | null; + /** @example ""6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b"" */ + webhook_secret?: string; + [key: string]: any; } /** - * Pull Request Merge Result - * Pull Request Merge Result + * The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. + * @example "one_month" */ -export interface PullRequestMergeResult { - merged: boolean; - message: string; - sha: string; +export enum InteractionExpiry { + OneDay = "one_day", + ThreeDays = "three_days", + OneWeek = "one_week", + OneMonth = "one_month", + SixMonths = "six_months", } -/** Pull Request Minimal */ -export interface PullRequestMinimal { - base: { - ref: string; - repo: { - id: number; - name: string; - url: string; - }; - sha: string; - }; - head: { - ref: string; - repo: { - id: number; - name: string; - url: string; - }; - sha: string; - }; - id: number; - number: number; - url: string; +/** + * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. + * @example "collaborators_only" + */ +export enum InteractionGroup { + ExistingUsers = "existing_users", + ContributorsOnly = "contributors_only", + CollaboratorsOnly = "collaborators_only", } /** - * Pull Request Review - * Pull Request Reviews are reviews on pull requests. + * Interaction Restrictions + * Limit interactions to a specific type of user for a specified duration */ -export interface PullRequestReview { - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; +export interface InteractionLimit { + /** The duration of the interaction restriction. Can be one of: \`one_day\`, \`three_days\`, \`one_week\`, \`one_month\`, \`six_months\`. Default: \`one_day\`. */ + expiry?: InteractionExpiry; + /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ + limit: InteractionGroup; +} + +/** + * Interaction Limits + * Interaction limit settings. + */ +export interface InteractionLimitResponse { + /** + * @format date-time + * @example "2018-08-17T04:18:39Z" + */ + expires_at: string; + /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: \`existing_users\`, \`contributors_only\`, \`collaborators_only\`. */ + limit: InteractionGroup; + /** @example "repository" */ + origin: string; +} + +/** + * Issue + * Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + */ +export interface Issue { + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; /** How the author is associated with the repository. */ author_association: AuthorAssociation; /** - * The text of the review. - * @example "This looks great." + * Contents of the issue + * @example "It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?" */ - body: string; + body?: string; body_html?: string; body_text?: string; + /** @format date-time */ + closed_at: string | null; + closed_by?: SimpleUser | null; + comments: number; + /** @format uri */ + comments_url: string; + /** @format date-time */ + created_at: string; + /** @format uri */ + events_url: string; + /** @format uri */ + html_url: string; + id: number; /** - * A commit SHA for the review. - * @example "54bb654c9e6025347f57900a4a5c2313a96b8035" - */ - commit_id: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" + * Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + * @example ["bug","registration"] */ - html_url: string; + labels: ( + | string + | { + color?: string | null; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + /** @format uri */ + url?: string; + } + )[]; + labels_url: string; + locked: boolean; + milestone: Milestone | null; + node_id: string; /** - * Unique identifier of the review + * Number uniquely identifying the issue within its repository * @example 42 */ - id: number; - /** @example "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" */ - node_id: string; + number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; + }; + reactions?: ReactionRollup; + /** A git repository */ + repository?: Repository; + /** @format uri */ + repository_url: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/12" + * State of the issue; either 'open' or 'closed' + * @example "open" */ - pull_request_url: string; - /** @example "CHANGES_REQUESTED" */ state: string; + /** @format uri */ + timeline_url?: string; + /** + * Title of the issue + * @example "Widget creation fails in Safari on OS X 10.8" + */ + title: string; /** @format date-time */ - submitted_at?: string; + updated_at: string; + /** + * URL for the issue + * @format uri + * @example "https://api.github.com/repositories/42/issues/1" + */ + url: string; user: SimpleUser | null; } /** - * Pull Request Review Comment - * Pull Request Review Comments are comments on a portion of the Pull Request's diff. + * Issue Comment + * Comments provide a way for people to collaborate on an issue. */ -export interface PullRequestReviewComment { - _links: { - html: { - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" - */ - href: string; - }; - pull_request: { - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" - */ - href: string; - }; - self: { - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" - */ - href: string; - }; - }; +export interface IssueComment { /** How the author is associated with the repository. */ author_association: AuthorAssociation; /** - * The text of the comment. - * @example "We should probably include a check for null values here." + * Contents of the issue comment + * @example "What version of Safari were you using when you observed this bug?" */ - body: string; - /** @example ""

comment body

"" */ + body?: string; body_html?: string; - /** @example ""comment body"" */ body_text?: string; - /** - * The SHA of the commit to which the comment applies. - * @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - commit_id: string; /** * @format date-time * @example "2011-04-14T16:00:49Z" */ created_at: string; + /** @format uri */ + html_url: string; /** - * The diff of the line that the comment refers to. - * @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." - */ - diff_hunk: string; - /** - * HTML URL for the pull request review comment. - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" - */ - html_url: string; - /** - * The ID of the pull request review comment. - * @example 1 + * Unique identifier of the issue comment + * @example 42 */ id: number; - /** - * The comment ID to reply to. - * @example 8 - */ - in_reply_to_id?: number; - /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - line?: number; - /** - * The node ID of the pull request review comment. - * @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" - */ + /** @format uri */ + issue_url: string; node_id: string; - /** - * The SHA of the original commit to which the comment applies. - * @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" - */ - original_commit_id: string; - /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 - */ - original_line?: number; - /** - * The index of the original line in the diff to which the comment applies. - * @example 4 - */ - original_position: number; - /** - * The first line of the range for a multi-line comment. - * @example 2 - */ - original_start_line?: number | null; - /** - * The relative path of the file to which the comment applies. - * @example "config/database.yaml" - */ - path: string; - /** - * The line index in the diff to which the comment applies. - * @example 1 - */ - position: number; - /** - * The ID of the pull request review to which the comment belongs. - * @example 42 - */ - pull_request_review_id: number | null; - /** - * URL for the pull request that the review comment belongs to. - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" - */ - pull_request_url: string; + performed_via_github_app?: Integration | null; reactions?: ReactionRollup; /** - * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - * @default "RIGHT" - */ - side?: "LEFT" | "RIGHT"; - /** - * The first line of the range for a multi-line comment. - * @example 2 + * @format date-time + * @example "2011-04-14T16:00:49Z" */ - start_line?: number | null; + updated_at: string; /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * URL for the issue comment + * @format uri + * @example "https://api.github.com/repositories/42/issues/comments/1" */ - start_side?: "LEFT" | "RIGHT" | null; + url: string; + user: SimpleUser | null; +} + +/** + * Issue Event + * Issue Event + */ +export interface IssueEvent { + actor: SimpleUser | null; + assignee?: SimpleUser | null; + assigner?: SimpleUser | null; + /** How the author is associated with the repository. */ + author_association?: AuthorAssociation; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_id: string | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_url: string | null; /** * @format date-time * @example "2011-04-14T16:00:49Z" */ - updated_at: string; + created_at: string; + dismissed_review?: IssueEventDismissedReview; + /** @example "closed" */ + event: string; + /** @example 1 */ + id: number; + /** Issue Simple */ + issue?: IssueSimple; + /** Issue Event Label */ + label?: IssueEventLabel; + lock_reason?: string | null; + /** Issue Event Milestone */ + milestone?: IssueEventMilestone; + /** @example "MDEwOklzc3VlRXZlbnQx" */ + node_id: string; + /** Issue Event Project Card */ + project_card?: IssueEventProjectCard; + /** Issue Event Rename */ + rename?: IssueEventRename; + requested_reviewer?: SimpleUser | null; + /** Groups of organization members that gives permissions on specified repositories. */ + requested_team?: Team; + review_requester?: SimpleUser | null; /** - * URL for the pull request review comment - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/events/1" */ url: string; +} + +/** Issue Event Dismissed Review */ +export interface IssueEventDismissedReview { + dismissal_commit_id?: string | null; + dismissal_message: string | null; + review_id: number; + state: string; +} + +/** + * Issue Event for Issue + * Issue Event for Issue + */ +export interface IssueEventForIssue { /** Simple User */ - user: SimpleUser; + actor?: SimpleUser; + /** How the author is associated with the repository. */ + author_association?: AuthorAssociation; + /** @example "":+1:"" */ + body?: string; + /** @example ""

Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam.

"" */ + body_html?: string; + /** @example ""Accusantium fugiat cumque. Autem qui nostrum. Atque quae ullam."" */ + body_text?: string; + commit_id?: string | null; + commit_url?: string | null; + created_at?: string; + event?: string; + /** @example ""https://github.com/owner-3906e11a33a3d55ba449d63f/BBB_Private_Repo/commit/480d4f47447129f015cb327536c522ca683939a1"" */ + html_url?: string; + id?: number; + /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/issues/1"" */ + issue_url?: string; + /** @example ""off-topic"" */ + lock_reason?: string; + /** @example ""add a bunch of files"" */ + message?: string; + node_id?: string; + /** @example ""https://api.github.com/repos/owner-3906e11a33a3d55ba449d63f/AAA_Public_Repo/pulls/2"" */ + pull_request_url?: string; + /** @example ""480d4f47447129f015cb327536c522ca683939a1"" */ + sha?: string; + /** @example ""commented"" */ + state?: string; + /** @example ""2020-07-09T00:17:51Z"" */ + submitted_at?: string; + /** @example ""2020-07-09T00:17:36Z"" */ + updated_at?: string; + url?: string; } /** - * Pull Request Review Request - * Pull Request Review Request + * Issue Event Label + * Issue Event Label */ -export interface PullRequestReviewRequest { - teams: TeamSimple[]; - users: SimpleUser[]; +export interface IssueEventLabel { + color: string | null; + name: string | null; } /** - * Pull Request Simple - * Pull Request Simple + * Issue Event Milestone + * Issue Event Milestone */ -export interface PullRequestSimple { - _links: { - /** Hypermedia Link */ - comments: Link; - /** Hypermedia Link */ - commits: Link; - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - issue: Link; - /** Hypermedia Link */ - review_comment: Link; - /** Hypermedia Link */ - review_comments: Link; - /** Hypermedia Link */ - self: Link; - /** Hypermedia Link */ - statuses: Link; - }; - /** @example "too heated" */ +export interface IssueEventMilestone { + title: string; +} + +/** + * Issue Event Project Card + * Issue Event Project Card + */ +export interface IssueEventProjectCard { + column_name: string; + id: number; + previous_column_name?: string; + project_id: number; + /** @format uri */ + project_url: string; + /** @format uri */ + url: string; +} + +/** + * Issue Event Rename + * Issue Event Rename + */ +export interface IssueEventRename { + from: string; + to: string; +} + +/** + * Issue Search Result Item + * Issue Search Result Item + */ +export interface IssueSearchResultItem { active_lock_reason?: string | null; assignee: SimpleUser | null; assignees?: SimpleUser[] | null; /** How the author is associated with the repository. */ author_association: AuthorAssociation; - /** The status of auto merging a pull request. */ - auto_merge: AutoMerge; - base: { - label: string; - ref: string; - /** A git repository */ - repo: Repository; - sha: string; - user: SimpleUser | null; + body?: string; + body_html?: string; + body_text?: string; + /** @format date-time */ + closed_at: string | null; + comments: number; + /** @format uri */ + comments_url: string; + /** @format date-time */ + created_at: string; + draft?: boolean; + /** @format uri */ + events_url: string; + /** @format uri */ + html_url: string; + id: number; + labels: { + color?: string; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + url?: string; + }[]; + labels_url: string; + locked: boolean; + milestone: Milestone | null; + node_id: string; + number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; }; - /** @example "Please pull these awesome changes" */ - body: string | null; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ + /** A git repository */ + repository?: Repository; + /** @format uri */ + repository_url: string; + score: number; + state: string; + text_matches?: SearchResultTextMatches; + /** @format uri */ + timeline_url?: string; + title: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + user: SimpleUser | null; +} + +/** + * Issue Simple + * Issue Simple + */ +export interface IssueSimple { + /** @example "too heated" */ + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** @example "I'm having a problem with this." */ + body?: string; + body_html?: string; + body_text?: string; + /** @format date-time */ closed_at: string | null; + /** @example 0 */ + comments: number; /** * @format uri * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" */ comments_url: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" - */ - commits_url: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" + * @example "2011-04-22T13:33:48Z" */ created_at: string; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" - */ - diff_url: string; - /** - * Indicates whether or not the pull request is a draft. - * @example false + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/events" */ - draft?: boolean; - head: { - label: string; - ref: string; - /** A git repository */ - repo: Repository; - sha: string; - user: SimpleUser | null; - }; + events_url: string; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347" + * @example "https://github.com/octocat/Hello-World/issues/1347" */ html_url: string; /** @example 1 */ id: number; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" - */ - issue_url: string; - labels: { - color?: string; - default?: boolean; - description?: string; - id?: number; - name?: string; - node_id?: string; - url?: string; - }[]; + labels: Label[]; + /** @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}" */ + labels_url: string; /** @example true */ locked: boolean; - /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ - merge_commit_sha: string | null; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - merged_at: string | null; milestone: Milestone | null; - /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + /** @example "MDU6SXNzdWUx" */ node_id: string; /** @example 1347 */ number: number; + performed_via_github_app?: Integration | null; + pull_request?: { + /** @format uri */ + diff_url: string | null; + /** @format uri */ + html_url: string | null; + /** @format date-time */ + merged_at?: string | null; + /** @format uri */ + patch_url: string | null; + /** @format uri */ + url: string | null; + }; + /** A git repository */ + repository?: Repository; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.patch" - */ - patch_url: string; - requested_reviewers?: SimpleUser[] | null; - requested_teams?: TeamSimple[] | null; - /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ - review_comment_url: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + * @example "https://api.github.com/repos/octocat/Hello-World" */ - review_comments_url: string; + repository_url: string; /** @example "open" */ state: string; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - statuses_url: string; - /** @example "new-feature" */ + /** @format uri */ + timeline_url?: string; + /** @example "Found a bug" */ title: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" + * @example "2011-04-22T13:33:48Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" */ url: string; user: SimpleUser | null; } -/** Rate Limit */ -export interface RateLimit { - limit: number; - remaining: number; - reset: number; -} - -/** - * Rate Limit Overview - * Rate Limit Overview - */ -export interface RateLimitOverview { - rate: RateLimit; - resources: { - code_scanning_upload?: RateLimit; - core: RateLimit; - graphql?: RateLimit; - integration_manifest?: RateLimit; - search: RateLimit; - source_import?: RateLimit; - }; -} - /** - * Reaction - * Reactions to conversations provide a way to help people express their feelings more simply and effectively. + * Job + * Information of a job execution in a workflow run */ -export interface Reaction { +export interface Job { + /** @example "https://api.github.com/repos/github/hello-world/check-runs/4" */ + check_run_url: string; /** - * The reaction to use - * @example "heart" + * The time that the job finished, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + completed_at: string | null; /** - * @format date-time - * @example "2016-05-20T20:09:31Z" + * The outcome of the job. + * @example "success" + */ + conclusion: string | null; + /** + * The SHA of the commit that is being run. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + */ + head_sha: string; + /** @example "https://github.com/github/hello-world/runs/4" */ + html_url: string | null; + /** + * The id of the job. + * @example 21 */ - created_at: string; - /** @example 1 */ id: number; - /** @example "MDg6UmVhY3Rpb24x" */ + /** + * The name of the job. + * @example "test-coverage" + */ + name: string; + /** @example "MDg6Q2hlY2tSdW40" */ node_id: string; - user: SimpleUser | null; -} - -/** Reaction Rollup */ -export interface ReactionRollup { - "+1": number; - "-1": number; - confused: number; - eyes: number; - heart: number; - hooray: number; - laugh: number; - rocket: number; - total_count: number; - /** @format uri */ + /** + * The id of the associated workflow run. + * @example 5 + */ + run_id: number; + /** @example "https://api.github.com/repos/github/hello-world/actions/runs/5" */ + run_url: string; + /** + * The time that the job started, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" + */ + started_at: string; + /** + * The phase of the lifecycle that the job is currently in. + * @example "queued" + */ + status: "queued" | "in_progress" | "completed"; + /** Steps in this job. */ + steps?: { + /** + * The time that the job finished, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" + */ + completed_at?: string | null; + /** + * The outcome of the job. + * @example "success" + */ + conclusion: string | null; + /** + * The name of the job. + * @example "test-coverage" + */ + name: string; + /** @example 1 */ + number: number; + /** + * The time that the step started, in ISO 8601 format. + * @format date-time + * @example "2019-08-08T08:00:00-07:00" + */ + started_at?: string | null; + /** + * The phase of the lifecycle that the job is currently in. + * @example "queued" + */ + status: "queued" | "in_progress" | "completed"; + }[]; + /** @example "https://api.github.com/repos/github/hello-world/actions/jobs/21" */ url: string; } /** - * Referrer Traffic - * Referrer Traffic + * Key + * Key */ -export interface ReferrerTraffic { - /** @example 4 */ - count: number; - /** @example "Google" */ - referrer: string; - /** @example 3 */ - uniques: number; +export interface Key { + /** @format date-time */ + created_at: string; + id: number; + key: string; + key_id: string; + read_only: boolean; + title: string; + url: string; + verified: boolean; } /** - * Release - * A release. + * Key Simple + * Key Simple */ -export interface Release { - assets: ReleaseAsset[]; - /** @format uri */ - assets_url: string; - /** Simple User */ - author: SimpleUser; - body?: string | null; - body_html?: string; - body_text?: string; - /** @format date-time */ - created_at: string; - /** - * true to create a draft (unpublished) release, false to create a published one. - * @example false - */ - draft: boolean; - /** @format uri */ - html_url: string; +export interface KeySimple { id: number; - name: string | null; - node_id: string; + key: string; +} + +/** + * Label + * Color-coded labels help you categorize and filter your issues (just like labels in Gmail). + */ +export interface Label { /** - * Whether to identify the release as a prerelease or a full release. - * @example false + * 6-character hex code, without the leading #, identifying the color + * @example "FFFFFF" */ - prerelease: boolean; - /** @format date-time */ - published_at: string | null; + color: string; + /** @example true */ + default: boolean; + /** @example "Something isn't working" */ + description: string | null; + /** @example 208045946 */ + id: number; /** - * The name of the tag. - * @example "v1.0.0" + * The name of the label. + * @example "bug" */ - tag_name: string; - /** @format uri */ - tarball_url: string | null; + name: string; + /** @example "MDU6TGFiZWwyMDgwNDU5NDY=" */ + node_id: string; /** - * Specifies the commitish value that determines where the Git tag is created from. - * @example "master" + * URL for the label + * @format uri + * @example "https://api.github.com/repositories/42/labels/bug" */ - target_commitish: string; - upload_url: string; - /** @format uri */ url: string; - /** @format uri */ - zipball_url: string | null; } /** - * Release Asset - * Data related to a release. + * Label Search Result Item + * Label Search Result Item */ -export interface ReleaseAsset { - /** @format uri */ - browser_download_url: string; - content_type: string; - /** @format date-time */ - created_at: string; - download_count: number; +export interface LabelSearchResultItem { + color: string; + default: boolean; + description: string | null; id: number; - label: string | null; - /** - * The file name of the asset. - * @example "Team Environment" - */ name: string; node_id: string; - size: number; - /** State of the release asset. */ - state: "uploaded" | "open"; - /** @format date-time */ - updated_at: string; - uploader: SimpleUser | null; + score: number; + text_matches?: SearchResultTextMatches; /** @format uri */ url: string; } /** - * Repo Search Result Item - * Repo Search Result Item + * Language + * Language */ -export interface RepoSearchResultItem { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url: string; - archived: boolean; - assignees_url: string; - blobs_url: string; - branches_url: string; - clone_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - /** @format uri */ - contributors_url: string; - /** @format date-time */ - created_at: string; - default_branch: string; - delete_branch_on_merge?: boolean; - /** @format uri */ - deployments_url: string; - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** @format uri */ - downloads_url: string; - /** @format uri */ - events_url: string; - fork: boolean; - forks: number; - forks_count: number; - /** @format uri */ - forks_url: string; - full_name: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - has_downloads: boolean; - has_issues: boolean; - has_pages: boolean; - has_projects: boolean; - has_wiki: boolean; - /** @format uri */ - homepage: string | null; - /** @format uri */ - hooks_url: string; - /** @format uri */ - html_url: string; - id: number; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - language: string | null; - /** @format uri */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** @format uri */ - merges_url: string; - milestones_url: string; - /** @format uri */ - mirror_url: string | null; - name: string; - node_id: string; - notifications_url: string; - open_issues: number; - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - pull: boolean; - push: boolean; - }; - private: boolean; - pulls_url: string; - /** @format date-time */ - pushed_at: string; - releases_url: string; - score: number; - size: number; - ssh_url: string; - stargazers_count: number; - /** @format uri */ - stargazers_url: string; - statuses_url: string; - /** @format uri */ - subscribers_url: string; - /** @format uri */ - subscription_url: string; - /** @format uri */ - svn_url: string; - /** @format uri */ - tags_url: string; - /** @format uri */ - teams_url: string; - temp_clone_token?: string; - text_matches?: SearchResultTextMatches; - topics?: string[]; - trees_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; - watchers: number; - watchers_count: number; -} +export type Language = Record; /** - * Repository - * A git repository + * License + * License */ -export interface Repository { - /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true - */ - allow_merge_commit?: boolean; - /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true - */ - allow_rebase_merge?: boolean; - /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true - */ - allow_squash_merge?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - /** - * Whether the repository is archived. - * @default false - */ - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at: string | null; - /** - * The default branch of the repository. - * @example "master" - */ - default_branch: string; +export interface License { /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false + * @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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * 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. + * " */ - delete_branch_on_merge?: boolean; + body: string; + /** @example ["include-copyright"] */ + conditions: string[]; + /** @example "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty." */ + description: string; + /** @example true */ + featured: boolean; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" + * @example "http://choosealicense.com/licenses/mit/" */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; + html_url: string; + /** @example "Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders." */ + implementation: string; + /** @example "mit" */ + key: string; + /** @example ["no-liability"] */ + limitations: string[]; + /** @example "MIT License" */ + name: string; + /** @example "MDc6TGljZW5zZW1pdA==" */ + node_id: string; + /** @example ["commercial-use","modifications","distribution","sublicense","private-use"] */ + permissions: string[]; + /** @example "MIT" */ + spdx_id: string | null; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" + * @example "https://api.github.com/licenses/mit" */ - downloads_url: string; + url: string | null; +} + +/** + * License Content + * License Content + */ +export interface LicenseContent { + _links: { + /** @format uri */ + git: string | null; + /** @format uri */ + html: string | null; + /** @format uri */ + self: string; + }; + content: string; + /** @format uri */ + download_url: string | null; + encoding: string; + /** @format uri */ + git_url: string | null; + /** @format uri */ + html_url: string | null; + license: LicenseSimple | null; + name: string; + path: string; + sha: string; + size: number; + type: string; + /** @format uri */ + url: string; +} + +/** + * License Simple + * License Simple + */ +export interface LicenseSimple { + /** @format uri */ + html_url?: string; + /** @example "mit" */ + key: string; + /** @example "MIT License" */ + name: string; + /** @example "MDc6TGljZW5zZW1pdA==" */ + node_id: string; + /** @example "MIT" */ + spdx_id: string | null; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" + * @example "https://api.github.com/licenses/mit" */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; + url: string | null; +} + +/** + * Link + * Hypermedia Link + */ +export interface Link { + href: string; +} + +/** + * Link With Type + * Hypermedia Link with Type + */ +export interface LinkWithType { + href: string; + type: string; +} + +/** Marketplace Account */ +export interface MarketplaceAccount { + /** @format email */ + email?: string | null; + id: number; + login: string; + node_id?: string; + /** @format email */ + organization_billing_email?: string | null; + type: string; + /** @format uri */ + url: string; +} + +/** + * Marketplace Listing Plan + * Marketplace Listing Plan + */ +export interface MarketplaceListingPlan { /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" + * @example "https://api.github.com/marketplace_listing/plans/1313/accounts" */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** - * Whether downloads are enabled. - * @default true - * @example true - */ - has_downloads: boolean; - /** - * Whether issues are enabled. - * @default true - * @example true - */ - has_issues: boolean; - has_pages: boolean; - /** - * Whether projects are enabled. - * @default true - * @example true - */ - has_projects: boolean; + accounts_url: string; + /** @example ["Up to 25 private repositories","11 concurrent builds"] */ + bullets: string[]; + /** @example "A professional-grade CI solution" */ + description: string; + /** @example true */ + has_free_trial: boolean; + /** @example 1313 */ + id: number; + /** @example 1099 */ + monthly_price_in_cents: number; + /** @example "Pro" */ + name: string; + /** @example 3 */ + number: number; + /** @example "flat-rate" */ + price_model: string; + /** @example "published" */ + state: string; + unit_name: string | null; /** - * Whether the wiki is enabled. - * @default true - * @example true + * @format uri + * @example "https://api.github.com/marketplace_listing/plans/1313" */ - has_wiki: boolean; + url: string; + /** @example 11870 */ + yearly_price_in_cents: number; +} + +/** + * Marketplace Purchase + * Marketplace Purchase + */ +export interface MarketplacePurchase { + id: number; + login: string; + marketplace_pending_change?: { + effective_date?: string; + id?: number; + is_installed?: boolean; + /** Marketplace Listing Plan */ + plan?: MarketplaceListingPlan; + unit_count?: number | null; + } | null; + marketplace_purchase: { + billing_cycle?: string; + free_trial_ends_on?: string | null; + is_installed?: boolean; + next_billing_date?: string | null; + on_free_trial?: boolean; + /** Marketplace Listing Plan */ + plan?: MarketplaceListingPlan; + unit_count?: number | null; + updated_at?: string; + }; + organization_billing_email?: string; + type: string; + url: string; +} + +/** + * Migration + * A migration. + */ +export interface Migration { + /** @format uri */ + archive_url?: string; /** - * @format uri - * @example "https://github.com" + * @format date-time + * @example "2015-07-06T15:33:38-07:00" */ - homepage: string | null; + created_at: string; + exclude?: any[]; + exclude_attachments: boolean; + /** @example "0b989ba4-242f-11e5-81e1-c7b6966d2516" */ + guid: string; + /** @example 79 */ + id: number; + /** @example true */ + lock_repositories: boolean; + node_id: string; + owner: SimpleUser | null; + repositories: Repository[]; + /** @example "pending" */ + state: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @format date-time + * @example "2015-07-06T15:33:38-07:00" */ - hooks_url: string; + updated_at: string; /** * @format uri - * @example "https://github.com/octocat/Hello-World" + * @example "https://api.github.com/orgs/octo-org/migrations/79" */ - html_url: string; + url: string; +} + +/** + * Milestone + * A collection of related issues and pull requests. + */ +export interface Milestone { /** - * Unique identifier of the repository - * @example 42 + * @format date-time + * @example "2013-02-12T13:22:01Z" */ - id: number; + closed_at: string | null; + /** @example 8 */ + closed_issues: number; /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true + * @format date-time + * @example "2011-04-10T20:09:31Z" */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; + created_at: string; + creator: SimpleUser | null; + /** @example "Tracking milestone for version 1.0" */ + description: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" + * @format date-time + * @example "2012-10-09T23:39:01Z" */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; + due_on: string | null; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" + * @example "https://github.com/octocat/Hello-World/milestones/v1.0" */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; + html_url: string; + /** @example 1002604 */ + id: number; /** * @format uri - * @example "git:git.example.com/octocat/Hello-World" - */ - mirror_url: string | null; - /** - * The name of the repository. - * @example "Team Environment" + * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" */ - name: string; - network_count?: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + labels_url: string; + /** @example "MDk6TWlsZXN0b25lMTAwMjYwNA==" */ node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - maintain?: boolean; - pull: boolean; - push: boolean; - triage?: boolean; - }; - /** - * Whether the repository is private or public. - * @default false - */ - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; /** - * @format date-time - * @example "2011-01-26T19:06:43Z" + * The number of the milestone. + * @example 42 */ - pushed_at: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; + number: number; + /** @example 4 */ + open_issues: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + * The state of the milestone. + * @default "open" + * @example "open" */ - stargazers_url: string; - /** @example ""2020-07-09T00:17:42Z"" */ - starred_at?: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; + state: "open" | "closed"; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + * The title of the milestone. + * @example "v1.0" */ - subscribers_url: string; + title: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + * @format date-time + * @example "2014-03-03T18:58:10Z" */ - subscription_url: string; + updated_at: string; /** * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: { - allow_merge_commit?: boolean; - allow_rebase_merge?: boolean; - allow_squash_merge?: boolean; - archive_url?: string; - archived?: boolean; - assignees_url?: string; - blobs_url?: string; - branches_url?: string; - clone_url?: string; - collaborators_url?: string; - comments_url?: string; - commits_url?: string; - compare_url?: string; - contents_url?: string; - contributors_url?: string; - created_at?: string; - default_branch?: string; - delete_branch_on_merge?: boolean; - deployments_url?: string; - description?: string; - disabled?: boolean; - downloads_url?: string; - events_url?: string; - fork?: boolean; - forks_count?: number; - forks_url?: string; - full_name?: string; - git_commits_url?: string; - git_refs_url?: string; - git_tags_url?: string; - git_url?: string; - has_downloads?: boolean; - has_issues?: boolean; - has_pages?: boolean; - has_projects?: boolean; - has_wiki?: boolean; - homepage?: string; - hooks_url?: string; - html_url?: string; - id?: number; - is_template?: boolean; - issue_comment_url?: string; - issue_events_url?: string; - issues_url?: string; - keys_url?: string; - labels_url?: string; - language?: string; - languages_url?: string; - merges_url?: string; - milestones_url?: string; - mirror_url?: string; - name?: string; - network_count?: number; - node_id?: string; - notifications_url?: string; - open_issues_count?: number; - owner?: { - avatar_url?: string; - events_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - gravatar_id?: string; - html_url?: string; - id?: number; - login?: string; - node_id?: string; - organizations_url?: string; - received_events_url?: string; - repos_url?: string; - site_admin?: boolean; - starred_url?: string; - subscriptions_url?: string; - type?: string; - url?: string; - }; - permissions?: { - admin?: boolean; - pull?: boolean; - push?: boolean; - }; - private?: boolean; - pulls_url?: string; - pushed_at?: string; - releases_url?: string; - size?: number; - ssh_url?: string; - stargazers_count?: number; - stargazers_url?: string; - statuses_url?: string; - subscribers_count?: number; - subscribers_url?: string; - subscription_url?: string; - svn_url?: string; - tags_url?: string; - teams_url?: string; - temp_clone_token?: string; - topics?: string[]; - trees_url?: string; - updated_at?: string; - url?: string; - visibility?: string; - watchers_count?: number; - } | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" + * @example "https://api.github.com/repos/octocat/Hello-World/milestones/1" */ url: string; - /** - * The repository visibility: public, private, or internal. - * @default "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; -} - -/** - * Repository Collaborator Permission - * Repository Collaborator Permission - */ -export interface RepositoryCollaboratorPermission { - permission: string; - user: SimpleUser | null; } /** - * Repository Invitation - * Repository invitations let you manage who you collaborate with. + * Minimal Repository + * Minimal Repository */ -export interface RepositoryInvitation { +export interface MinimalRepository { + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + archived?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + clone_url?: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; /** - * @format date-time - * @example "2016-06-13T14:52:50-05:00" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - created_at: string; - /** Whether or not the invitation has expired */ - expired?: boolean; - /** @example "https://github.com/octocat/Hello-World/invitations" */ - html_url: string; + contributors_url: string; /** - * Unique identifier of the repository invitation. - * @example 42 + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - id: number; - invitee: SimpleUser | null; - inviter: SimpleUser | null; - node_id: string; + created_at?: string | null; + default_branch?: string; + delete_branch_on_merge?: boolean; /** - * The permission associated with the invitation. - * @example "read" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - permissions: "read" | "write" | "admin"; - /** Minimal Repository */ - repository: MinimalRepository; + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + disabled?: boolean; /** - * URL for the repository invitation - * @example "https://api.github.com/user/repository-invitations/1" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - url: string; -} - -/** - * Repository Invitation - * Repository invitations let you manage who you collaborate with. - */ -export interface RepositorySubscription { + downloads_url: string; /** - * @format date-time - * @example "2012-10-06T21:34:12Z" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - created_at: string; - /** Determines if all notifications should be blocked from this repository. */ - ignored: boolean; - reason: string | null; + events_url: string; + fork: boolean; + /** @example 0 */ + forks?: number; + forks_count?: number; /** * @format uri - * @example "https://api.github.com/repos/octocat/example" + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - repository_url: string; + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + git_url?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_pages?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + homepage?: string | null; /** - * Determines if notifications should be received from this repository. - * @example true + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - subscribed: boolean; + hooks_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/example/subscription" + * @example "https://github.com/octocat/Hello-World" */ - url: string; -} - -/** - * Legacy Review Comment - * Legacy Review Comment - */ -export interface ReviewComment { - _links: { - /** Hypermedia Link */ - html: Link; - /** Hypermedia Link */ - pull_request: Link; - /** Hypermedia Link */ - self: Link; - }; - /** How the author is associated with the repository. */ - author_association: AuthorAssociation; - /** @example "Great stuff" */ - body: string; - body_html?: string; - body_text?: string; - /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - commit_id: string; - /** - * @format date-time - * @example "2011-04-14T16:00:49Z" - */ - created_at: string; - /** @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." */ - diff_hunk: string; + html_url: string; + /** @example 1296269 */ + id: number; + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language?: string | null; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + * @example "http://api.github.com/repos/octocat/Hello-World/languages" */ - html_url: string; - /** @example 10 */ - id: number; - /** @example 8 */ - in_reply_to_id?: number; + languages_url: string; + license?: { + key?: string; + name?: string; + node_id?: string; + spdx_id?: string; + url?: string; + } | null; /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - line?: number; - /** @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" */ + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; + mirror_url?: string | null; + /** @example "Hello-World" */ + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ node_id: string; - /** @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" */ - original_commit_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + /** @example 0 */ + open_issues?: number; + open_issues_count?: number; + owner: SimpleUser | null; + permissions?: { + admin?: boolean; + pull?: boolean; + push?: boolean; + }; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - original_line?: number; - /** @example 4 */ - original_position: number; + pushed_at?: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + size?: number; + ssh_url?: string; + stargazers_count?: number; /** - * The original first line of the range for a multi-line comment. - * @example 2 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - original_start_line?: number | null; - /** @example "file1.txt" */ - path: string; - /** @example 1 */ - position: number | null; - /** @example 42 */ - pull_request_review_id: number | null; + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - pull_request_url: string; + subscribers_url: string; /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - side?: "LEFT" | "RIGHT"; + subscription_url: string; + svn_url?: string; /** - * The first line of the range for a multi-line comment. - * @example 2 + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - start_line?: number | null; + tags_url: string; /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" */ - start_side?: "LEFT" | "RIGHT" | null; + teams_url: string; + temp_clone_token?: string; + template_repository?: Repository | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; /** * @format date-time - * @example "2011-04-14T16:00:49Z" + * @example "2011-01-26T19:14:43Z" */ - updated_at: string; + updated_at?: string | null; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + * @example "https://api.github.com/repos/octocat/Hello-World" */ url: string; - user: SimpleUser | null; + visibility?: string; + /** @example 0 */ + watchers?: number; + watchers_count?: number; } /** - * Self hosted runners - * A self hosted runner + * Org Hook + * Org Hook */ -export interface Runner { - busy: boolean; +export interface OrgHook { + /** @example true */ + active: boolean; + config: { + /** @example ""form"" */ + content_type?: string; + /** @example ""0"" */ + insecure_ssl?: string; + /** @example ""********"" */ + secret?: string; + /** @example ""http://example.com/2"" */ + url?: string; + }; /** - * The id of the runner. - * @example 5 + * @format date-time + * @example "2011-09-06T17:26:27Z" */ + created_at: string; + /** @example ["push","pull_request"] */ + events: string[]; + /** @example 1 */ id: number; - labels: { - /** Unique identifier of the label. */ - id?: number; - /** Name of the label. */ - name?: string; - /** The type of label. Read-only labels are applied automatically when the runner is configured. */ - type?: "read-only" | "custom"; - }[]; + /** @example "web" */ + name: string; /** - * The name of the runner. - * @example "iMac" + * @format uri + * @example "https://api.github.com/orgs/octocat/hooks/1/pings" */ - name: string; + ping_url: string; + type: string; /** - * The Operating System of the runner. - * @example "macos" + * @format date-time + * @example "2011-09-06T20:39:23Z" */ - os: string; + updated_at: string; /** - * The status of the runner. - * @example "online" + * @format uri + * @example "https://api.github.com/orgs/octocat/hooks/1" */ - status: string; + url: string; } /** - * Runner Application - * Runner Application + * Org Membership + * Org Membership */ -export interface RunnerApplication { - architecture: string; - download_url: string; - filename: string; - os: string; +export interface OrgMembership { + /** Organization Simple */ + organization: OrganizationSimple; + /** + * @format uri + * @example "https://api.github.com/orgs/octocat" + */ + organization_url: string; + permissions?: { + can_create_repository: boolean; + }; + /** @example "admin" */ + role: string; + /** @example "active" */ + state: string; + /** + * @format uri + * @example "https://api.github.com/orgs/octocat/memberships/defunkt" + */ + url: string; + user: SimpleUser | null; } -export interface RunnerGroupsEnterprise { - allows_public_repositories: boolean; - default: boolean; - id: number; +/** + * Actions Secret for an Organization + * Secrets for GitHub Actions for an organization. + */ +export interface OrganizationActionsSecret { + /** @format date-time */ + created_at: string; + /** + * The name of the secret. + * @example "SECRET_TOKEN" + */ name: string; - runners_url: string; - selected_organizations_url?: string; - visibility: string; -} - -export interface RunnerGroupsOrg { - allows_public_repositories: boolean; - default: boolean; - id: number; - inherited: boolean; - inherited_allows_public_repositories?: boolean; - name: string; - runners_url: string; - /** Link to the selected repositories resource for this runner group. Not present unless visibility was set to \`selected\` */ + /** + * @format uri + * @example "https://api.github.com/organizations/org/secrets/my_secret/repositories" + */ selected_repositories_url?: string; - visibility: string; -} - -export interface ScimEnterpriseGroup { - displayName?: string; - externalId?: string | null; - id: string; - members?: { - $ref?: string; - display?: string; - value?: string; - }[]; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - schemas: string[]; -} - -export interface ScimEnterpriseUser { - active?: boolean; - emails?: { - primary?: boolean; - type?: string; - value?: string; - }[]; - externalId?: string; - groups?: { - value?: string; - }[]; - id: string; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - name?: { - familyName?: string; - givenName?: string; - }; - schemas: string[]; - userName?: string; -} - -/** - * Scim Error - * Scim Error - */ -export interface ScimError { - detail?: string | null; - documentation_url?: string | null; - message?: string | null; - schemas?: string[]; - scimType?: string | null; - status?: number; -} - -export interface ScimGroupListEnterprise { - Resources: { - displayName?: string; - externalId?: string | null; - id: string; - members?: { - $ref?: string; - display?: string; - value?: string; - }[]; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - schemas: string[]; - }[]; - itemsPerPage: number; - schemas: string[]; - startIndex: number; - totalResults: number; + /** @format date-time */ + updated_at: string; + /** Visibility of a secret */ + visibility: "all" | "private" | "selected"; } /** - * SCIM /Users - * SCIM /Users provisioning endpoints + * Organization Full + * Organization Full */ -export interface ScimUser { - /** - * The active status of the User. - * @example true - */ - active: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string | null; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - value: string; - }[]; +export interface OrganizationFull { + /** @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; /** - * The ID of the User. - * @example "a7b0f98395" + * @format email + * @example "org@example.com" */ - externalId: string | null; - /** associated groups */ - groups?: { - display?: string; - value?: string; - }[]; + billing_email?: string | null; /** - * Unique identifier of an external identity - * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" + * @format uri + * @example "https://github.com/blog" */ - id: string; - meta: { - /** - * @format date-time - * @example "2019-01-24T22:45:36.000Z" - */ - created?: string; - /** - * @format date-time - * @example "2019-01-24T22:45:36.000Z" - */ - lastModified?: string; - /** - * @format uri - * @example "https://api.github.com/scim/v2/organizations/myorg-123abc55141bfd8f/Users/c42772b5-2029-11e9-8543-9264a97dec8d" - */ - location?: string; - /** @example "User" */ - resourceType?: string; - }; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string | null; - formatted?: string | null; - givenName: string | null; - }; + blog?: string; + /** @example 8 */ + collaborators?: number | null; + /** @example "GitHub" */ + company?: string; /** - * Set of operations to be performed - * @minItems 1 - * @example [{"op":"replace","value":{"active":false}}] + * @format date-time + * @example "2008-01-14T04:33:35Z" */ - operations?: { - op: "add" | "remove" | "replace"; - path?: string; - value?: string | object | any[]; - }[]; - /** The ID of the organization. */ - organization_id?: number; + created_at: string; + default_repository_permission?: string | null; + /** @example "A great organization" */ + description: string | null; + /** @example 10000 */ + disk_usage?: number | null; /** - * SCIM schema used. - * @minItems 1 + * @format email + * @example "octocat@github.com" */ - schemas: string[]; + email?: string; /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" + * @format uri + * @example "https://api.github.com/orgs/github/events" */ - userName: string | null; -} - -/** - * SCIM User List - * SCIM User List - */ -export interface ScimUserList { - Resources: ScimUser[]; - /** @example 10 */ - itemsPerPage: number; + events_url: string; + /** @example 20 */ + followers: number; + /** @example 0 */ + following: number; + /** @example true */ + has_organization_projects: boolean; + /** @example true */ + has_repository_projects: boolean; + /** @example "https://api.github.com/orgs/github/hooks" */ + hooks_url: string; /** - * SCIM schema used. - * @minItems 1 + * @format uri + * @example "https://github.com/octocat" */ - schemas: string[]; + html_url: string; /** @example 1 */ - startIndex: number; - /** @example 3 */ - totalResults: number; -} - -export interface ScimUserListEnterprise { - Resources: { - active?: boolean; - emails?: { - primary?: boolean; - type?: string; - value?: string; - }[]; - externalId?: string; - groups?: { - value?: string; - }[]; - id: string; - meta?: { - created?: string; - lastModified?: string; - location?: string; - resourceType?: string; - }; - name?: { - familyName?: string; - givenName?: string; - }; - schemas: string[]; - userName?: string; - }[]; - itemsPerPage: number; - schemas: string[]; - startIndex: number; - totalResults: number; -} - -/** Scoped Installation */ -export interface ScopedInstallation { - /** Simple User */ - account: SimpleUser; + id: number; /** @example true */ - has_multiple_single_files?: boolean; - /** The permissions granted to the user-to-server access token. */ - permissions: AppPermissions; + is_verified?: boolean; + /** @example "https://api.github.com/orgs/github/issues" */ + issues_url: string; + /** @example "San Francisco" */ + location?: string; + /** @example "github" */ + login: string; + /** @example "all" */ + members_allowed_repository_creation_type?: string; + /** @example true */ + members_can_create_internal_repositories?: boolean; + /** @example true */ + members_can_create_pages?: boolean; + /** @example true */ + members_can_create_private_repositories?: boolean; + /** @example true */ + members_can_create_public_repositories?: boolean; + /** @example true */ + members_can_create_repositories?: boolean | null; + /** @example "https://api.github.com/orgs/github/members{/member}" */ + members_url: string; + /** @example "github" */ + name?: string; + /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ + node_id: string; + /** @example 100 */ + owned_private_repos?: number; + plan?: { + filled_seats?: number; + name: string; + private_repos: number; + seats?: number; + space: number; + }; + /** @example 81 */ + private_gists?: number | null; + /** @example 1 */ + public_gists: number; + /** @example "https://api.github.com/orgs/github/public_members{/member}" */ + public_members_url: string; + /** @example 2 */ + public_repos: number; /** * @format uri - * @example "https://api.github.com/users/octocat/repos" + * @example "https://api.github.com/orgs/github/repos" */ - repositories_url: string; - /** Describe whether all repositories have been selected or there's a selection involved */ - repository_selection: "all" | "selected"; - /** @example "config.yaml" */ - single_file_name: string | null; - /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ - single_file_paths?: string[]; -} - -/** Search Result Text Matches */ -export type SearchResultTextMatches = { - fragment?: string; - matches?: { - indices?: number[]; - text?: string; - }[]; - object_type?: string | null; - object_url?: string; - property?: string; -}[]; - -export interface SecretScanningAlert { - /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - created_at?: AlertCreatedAt; - /** The GitHub URL of the alert resource. */ - html_url?: AlertHtmlUrl; - /** The security alert number. */ - number?: AlertNumber; - /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ - resolution?: SecretScanningAlertResolution; + repos_url: string; + /** @example 100 */ + total_private_repos?: number; + /** @example "github" */ + twitter_username?: string | null; + /** @example true */ + two_factor_requirement_enabled?: boolean | null; + /** @example "Organization" */ + type: string; + /** @format date-time */ + updated_at: string; /** - * The time that the alert was resolved in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date-time + * @format uri + * @example "https://api.github.com/orgs/github" */ - resolved_at?: string | null; - /** Simple User */ - resolved_by?: SimpleUser; - /** The secret that was detected. */ - secret?: string; - /** The type of secret that secret scanning detected. */ - secret_type?: string; - /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ - state?: SecretScanningAlertState; - /** The REST API URL of the alert resource. */ - url?: AlertUrl; -} - -/** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ -export type SecretScanningAlertResolution = - | "false_positive" - | "wont_fix" - | "revoked" - | "used_in_tests" - | null; - -/** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ -export enum SecretScanningAlertState { - Open = "open", - Resolved = "resolved", -} - -export interface SelectedActions { - /** Whether GitHub-owned actions are allowed. For example, this includes the actions in the \`actions\` organization. */ - github_owned_allowed: boolean; - /** Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, \`monalisa/octocat@*\`, \`monalisa/octocat@v2\`, \`monalisa/*\`." */ - patterns_allowed: string[]; - /** Whether actions in GitHub Marketplace from verified creators are allowed. Set to \`true\` to allow all GitHub Marketplace actions by verified creators. */ - verified_allowed: boolean; -} - -/** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ -export type SelectedActionsUrl = string; - -/** - * Short Blob - * Short Blob - */ -export interface ShortBlob { - sha: string; url: string; } /** - * Short Branch - * Short Branch - */ -export interface ShortBranch { - commit: { - sha: string; - /** @format uri */ - url: string; - }; - name: string; - protected: boolean; - /** Branch Protection */ - protection?: BranchProtection; - /** @format uri */ - protection_url?: string; -} - -/** - * Simple Commit - * Simple Commit + * Organization Invitation + * Organization Invitation */ -export interface SimpleCommit { - author: { - email: string; - name: string; - } | null; - committer: { - email: string; - name: string; - } | null; - id: string; - message: string; - /** @format date-time */ - timestamp: string; - tree_id: string; -} - -/** Simple Commit Status */ -export interface SimpleCommitStatus { - /** @format uri */ - avatar_url: string | null; - context: string; - /** @format date-time */ +export interface OrganizationInvitation { created_at: string; - description: string | null; + email: string | null; + failed_at?: string; + failed_reason?: string; id: number; + invitation_team_url: string; + /** @example ""https://api.github.com/organizations/16/invitations/1/teams"" */ + invitation_teams_url?: string; + /** Simple User */ + inviter: SimpleUser; + login: string | null; + /** @example ""MDIyOk9yZ2FuaXphdGlvbkludml0YXRpb24x"" */ node_id: string; - required?: boolean | null; - state: string; - /** @format uri */ - target_url: string; - /** @format date-time */ - updated_at: string; - /** @format uri */ - url: string; + role: string; + team_count: number; } /** - * Simple User - * Simple User + * Organization Simple + * Organization Simple */ -export type SimpleUser = { +export interface OrganizationSimple { + /** @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; + /** @example "A great organization" */ + description: string | null; /** * @format uri - * @example "https://github.com/images/error/octocat_happy.gif" + * @example "https://api.github.com/orgs/github/events" */ - avatar_url: string; - /** @example "https://api.github.com/users/octocat/events{/privacy}" */ events_url: string; + /** @example "https://api.github.com/orgs/github/hooks" */ + hooks_url: string; + /** @example 1 */ + id: number; + /** @example "https://api.github.com/orgs/github/issues" */ + issues_url: string; + /** @example "github" */ + login: string; + /** @example "https://api.github.com/orgs/github/members{/member}" */ + members_url: string; + /** @example "MDEyOk9yZ2FuaXphdGlvbjE=" */ + node_id: string; + /** @example "https://api.github.com/orgs/github/public_members{/member}" */ + public_members_url: string; /** * @format uri - * @example "https://api.github.com/users/octocat/followers" + * @example "https://api.github.com/orgs/github/repos" */ - followers_url: string; - /** @example "https://api.github.com/users/octocat/following{/other_user}" */ - following_url: string; - /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ - gists_url: string; - /** @example "41d064eb2195891e12d0413f63227ea7" */ - gravatar_id: string | null; + repos_url: string; /** * @format uri - * @example "https://github.com/octocat" + * @example "https://api.github.com/orgs/github" */ - html_url: string; - /** @example 1 */ - id: number; - /** @example "octocat" */ - login: string; - /** @example "MDQ6VXNlcjE=" */ - node_id: string; + url: string; +} + +export interface PackagesBillingUsage { + /** Free storage space (GB) for GitHub Packages. */ + included_gigabytes_bandwidth: number; + /** Sum of the free and paid storage space (GB) for GitHuub Packages. */ + total_gigabytes_bandwidth_used: number; + /** Total paid storage space (GB) for GitHuub Packages. */ + total_paid_gigabytes_bandwidth_used: number; +} + +/** + * GitHub Pages + * The configuration for GitHub Pages for a repository. + */ +export interface Page { /** - * @format uri - * @example "https://api.github.com/users/octocat/orgs" + * Whether the Page has a custom 404 page. + * @default false + * @example false */ - organizations_url: string; + custom_404: boolean; /** - * @format uri - * @example "https://api.github.com/users/octocat/received_events" + * The Pages site's custom domain + * @example "example.com" */ - received_events_url: string; + cname: string | null; /** + * The web address the Page can be accessed from. * @format uri - * @example "https://api.github.com/users/octocat/repos" + * @example "https://example.com" */ - repos_url: string; - site_admin: boolean; - /** @example ""2020-07-09T00:17:55Z"" */ - starred_at?: string; - /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ - starred_url: string; + html_url?: string; /** - * @format uri - * @example "https://api.github.com/users/octocat/subscriptions" + * Whether the GitHub Pages site is publicly visible. If set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. + * @example true */ - subscriptions_url: string; - /** @example "User" */ - type: string; + public: boolean; + source?: PagesSourceHash; + /** + * The status of the most recent build of the Page. + * @example "built" + */ + status: "built" | "building" | "errored" | null; /** + * The API address for accessing this Page resource. * @format uri - * @example "https://api.github.com/users/octocat" + * @example "https://api.github.com/repos/github/hello-world/pages" */ url: string; -} | null; - -/** - * Stargazer - * Stargazer - */ -export interface Stargazer { - /** @format date-time */ - starred_at: string; - user: SimpleUser | null; } /** - * Starred Repository - * Starred Repository + * Page Build + * Page Build */ -export interface StarredRepository { - /** A git repository */ - repo: Repository; +export interface PageBuild { + commit: string; /** @format date-time */ - starred_at: string; -} - -/** - * Status - * The status of a commit. - */ -export interface Status { - avatar_url: string | null; - context: string; created_at: string; - /** Simple User */ - creator: SimpleUser; - description: string; - id: number; - node_id: string; - state: string; - target_url: string; + duration: number; + error: { + message: string | null; + }; + pusher: SimpleUser | null; + status: string; + /** @format date-time */ updated_at: string; + /** @format uri */ url: string; } /** - * Status Check Policy - * Status Check Policy + * Page Build Status + * Page Build Status */ -export interface StatusCheckPolicy { - /** @example ["continuous-integration/travis-ci"] */ - contexts: string[]; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts" - */ - contexts_url: string; - /** @example true */ - strict: boolean; +export interface PageBuildStatus { + /** @example "queued" */ + status: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks" + * @example "https://api.github.com/repos/github/hello-world/pages/builds/latest" */ url: string; } -/** - * Tag - * Tag - */ -export interface Tag { - commit: { - sha: string; - /** @format uri */ - url: string; - }; - /** @example "v0.1" */ - name: string; - node_id: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/tarball/v0.1" - */ - tarball_url: string; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/zipball/v0.1" - */ - zipball_url: string; +/** Pages Source Hash */ +export interface PagesSourceHash { + branch: string; + path: string; +} + +/** Participation Stats */ +export interface ParticipationStats { + all: number[]; + owner: number[]; } /** - * Team - * Groups of organization members that gives permissions on specified repositories. + * Porter Author + * Porter Author */ -export interface Team { - description: string | null; - /** - * @format uri - * @example "https://github.com/orgs/rails/teams/core" - */ - html_url: string; +export interface PorterAuthor { + email: string; id: number; - members_url: string; - name: string; - node_id: string; - parent?: TeamSimple | null; - permission: string; - privacy?: string; /** @format uri */ - repositories_url: string; - slug: string; + import_url: string; + name: string; + remote_id: string; + remote_name: string; /** @format uri */ url: string; } /** - * Team Discussion - * A team discussion is a persistent record of a free-form conversation within a team. + * Porter Large File + * Porter Large File */ -export interface TeamDiscussion { - author: SimpleUser | null; - /** - * The main text of the discussion. - * @example "Please suggest improvements to our workflow in comments." - */ - body: string; - /** @example "

Hi! This is an area for us to collaborate as a team

" */ - body_html: string; - /** - * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - * @example "0307116bbf7ced493b8d8a346c650b71" - */ - body_version: string; - /** @example 0 */ - comments_count: number; +export interface PorterLargeFile { + oid: string; + path: string; + ref_name: string; + size: number; +} + +/** + * Private User + * Private User + */ +export interface PrivateUser { /** * @format uri - * @example "https://api.github.com/organizations/1/team/2343027/discussions/1/comments" + * @example "https://github.com/images/error/octocat_happy.gif" */ - comments_url: string; + avatar_url: string; + /** @example "There once was..." */ + bio: string | null; + /** @example "https://github.com/blog" */ + blog: string | null; + business_plus?: boolean; + /** @example 8 */ + collaborators: number; + /** @example "GitHub" */ + company: string | null; /** * @format date-time - * @example "2018-01-25T18:56:31Z" + * @example "2008-01-14T04:33:35Z" */ created_at: string; + /** @example 10000 */ + disk_usage: number; /** - * @format uri - * @example "https://github.com/orgs/github/teams/justice-league/discussions/1" + * @format email + * @example "octocat@github.com" */ - html_url: string; - /** @format date-time */ - last_edited_at: string | null; - /** @example "MDE0OlRlYW1EaXNjdXNzaW9uMQ==" */ - node_id: string; + email: string | null; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; + /** @example 20 */ + followers: number; /** - * The unique sequence number of a team discussion. - * @example 42 + * @format uri + * @example "https://api.github.com/users/octocat/followers" */ - number: number; + followers_url: string; + /** @example 0 */ + following: number; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; + hireable: boolean | null; /** - * Whether or not this discussion should be pinned for easy retrieval. - * @example true + * @format uri + * @example "https://github.com/octocat" */ - pinned: boolean; + html_url: string; + /** @example 1 */ + id: number; + ldap_dn?: string; + /** @example "San Francisco" */ + location: string | null; + /** @example "octocat" */ + login: string; + /** @example "monalisa octocat" */ + name: string | null; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; /** - * Whether or not this discussion should be restricted to team members and organization administrators. - * @example true + * @format uri + * @example "https://api.github.com/users/octocat/orgs" */ - private: boolean; - reactions?: ReactionRollup; + organizations_url: string; + /** @example 100 */ + owned_private_repos: number; + plan?: { + collaborators: number; + name: string; + private_repos: number; + space: number; + }; + /** @example 81 */ + private_gists: number; + /** @example 1 */ + public_gists: number; + /** @example 2 */ + public_repos: number; /** * @format uri - * @example "https://api.github.com/organizations/1/team/2343027" + * @example "https://api.github.com/users/octocat/received_events" */ - team_url: string; + received_events_url: string; /** - * The title of the discussion. - * @example "How can we improve our workflow?" + * @format uri + * @example "https://api.github.com/users/octocat/repos" */ - title: string; + repos_url: string; + site_admin: boolean; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/subscriptions" + */ + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + /** @example 100 */ + total_private_repos: number; + /** @example "monalisa" */ + twitter_username?: string | null; + /** @example true */ + two_factor_authentication: boolean; + /** @example "User" */ + type: string; /** * @format date-time - * @example "2018-01-25T18:56:31Z" + * @example "2008-01-14T04:33:35Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/organizations/1/team/2343027/discussions/1" + * @example "https://api.github.com/users/octocat" */ url: string; } /** - * Team Discussion Comment - * A reply to a discussion within a team. + * Project + * Projects are a way to organize columns and cards of work. */ -export interface TeamDiscussionComment { - author: SimpleUser | null; +export interface Project { /** - * The main text of the comment. - * @example "I agree with this suggestion." + * Body of the project + * @example "This project represents the sprint of the first week in January" */ - body: string; - /** @example "

Do you like apples?

" */ - body_html: string; + body: string | null; /** - * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. - * @example "0307116bbf7ced493b8d8a346c650b71" + * @format uri + * @example "https://api.github.com/projects/1002604/columns" */ - body_version: string; + columns_url: string; /** * @format date-time - * @example "2018-01-15T23:53:58Z" + * @example "2011-04-10T20:09:31Z" */ created_at: string; + creator: SimpleUser | null; /** * @format uri - * @example "https://api.github.com/organizations/1/team/2403582/discussions/1" + * @example "https://github.com/api-playground/projects-test/projects/12" */ - discussion_url: string; + html_url: string; + /** @example 1002604 */ + id: number; /** - * @format uri - * @example "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1" + * Name of the project + * @example "Week One Sprint" */ - html_url: string; - /** @format date-time */ - last_edited_at: string | null; - /** @example "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=" */ + name: string; + /** @example "MDc6UHJvamVjdDEwMDI2MDQ=" */ node_id: string; + /** @example 1 */ + number: number; + /** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ + organization_permission?: "read" | "write" | "admin" | "none"; /** - * The unique sequence number of a team discussion comment. - * @example 42 + * @format uri + * @example "https://api.github.com/repos/api-playground/projects-test" */ - number: number; - reactions?: ReactionRollup; + owner_url: string; + /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ + private?: boolean; + /** + * State of the project; either 'open' or 'closed' + * @example "open" + */ + state: string; /** * @format date-time - * @example "2018-01-15T23:53:58Z" + * @example "2014-03-03T18:58:10Z" */ updated_at: string; /** * @format uri - * @example "https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1" + * @example "https://api.github.com/projects/1002604" */ url: string; } /** - * Full Team - * Groups of organization members that gives permissions on specified repositories. + * Project Card + * Project cards represent a scope of work. */ -export interface TeamFull { +export interface ProjectCard { /** - * @format date-time - * @example "2017-07-14T16:53:42Z" + * Whether or not the card is archived + * @example false */ - created_at: string; - /** @example "A great team." */ - description: string | null; + archived?: boolean; /** * @format uri - * @example "https://github.com/orgs/rails/teams/core" + * @example "https://api.github.com/projects/columns/367" */ - html_url: string; + column_url: string; /** - * Unique identifier of the team - * @example 42 + * @format uri + * @example "https://api.github.com/repos/api-playground/projects-test/issues/3" */ - id: number; + content_url?: string; /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" + * @format date-time + * @example "2016-09-05T14:21:06Z" */ - ldap_dn?: string; - /** @example 3 */ - members_count: number; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; + created_at: string; + creator: SimpleUser | null; /** - * Name of the team - * @example "Developers" + * The project card's ID + * @example 42 */ - name: string; - /** @example "MDQ6VGVhbTE=" */ + id: number; + /** @example "MDExOlByb2plY3RDYXJkMTQ3OA==" */ node_id: string; - /** Organization Full */ - organization: OrganizationFull; - parent?: TeamSimple | null; - /** - * Permission that the team will have for its repositories - * @example "push" - */ - permission: string; - /** - * The level of privacy this team should have - * @example "closed" - */ - privacy?: "closed" | "secret"; - /** @example 10 */ - repos_count: number; + /** @example "Add payload for delete Project column" */ + note: string | null; /** * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" + * @example "https://api.github.com/projects/120" */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; + project_url: string; /** * @format date-time - * @example "2017-08-17T12:37:15Z" + * @example "2016-09-05T14:20:22Z" */ updated_at: string; /** - * URL for the team * @format uri - * @example "https://api.github.com/organizations/1/team/1" + * @example "https://api.github.com/projects/columns/cards/1478" */ url: string; } /** - * Team Membership - * Team Membership + * Project Column + * Project columns contain cards of work. */ -export interface TeamMembership { +export interface ProjectColumn { /** - * The role of the user in the team. - * @default "member" - * @example "member" + * @format uri + * @example "https://api.github.com/projects/columns/367/cards" + */ + cards_url: string; + /** + * @format date-time + * @example "2016-09-05T14:18:44Z" */ - role: "member" | "maintainer"; - state: string; - /** @format uri */ - url: string; -} - -/** - * Team Project - * A team's access to a project. - */ -export interface TeamProject { - body: string | null; - columns_url: string; created_at: string; - /** Simple User */ - creator: SimpleUser; - html_url: string; + /** + * The unique identifier of the project column + * @example 42 + */ id: number; + /** + * Name of the project column + * @example "Remaining tasks" + */ name: string; + /** @example "MDEzOlByb2plY3RDb2x1bW4zNjc=" */ node_id: string; - number: number; - /** The organization permission for this project. Only present when owner is an organization. */ - organization_permission?: string; - owner_url: string; - permissions: { - admin: boolean; - read: boolean; - write: boolean; - }; - /** Whether the project is private or not. Only present when owner is an organization. */ - private?: boolean; - state: string; - updated_at: string; - url: string; -} - -/** - * Team Repository - * A team's access to a repository. - */ -export interface TeamRepository { - /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true - */ - allow_merge_commit?: boolean; - /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true - */ - allow_rebase_merge?: boolean; - /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true - */ - allow_squash_merge?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ - archive_url: string; - /** - * Whether the repository is archived. - * @default false - */ - archived: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ - assignees_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ - blobs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ - branches_url: string; - /** @example "https://github.com/octocat/Hello-World.git" */ - clone_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ - collaborators_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ - comments_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ - commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ - compare_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ - contents_url: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" + * @example "https://api.github.com/projects/120" */ - contributors_url: string; + project_url: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - created_at: string | null; - /** - * The default branch of the repository. - * @example "master" - */ - default_branch: string; - /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false - */ - delete_branch_on_merge?: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" - */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" - */ - downloads_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" + * @example "2016-09-05T14:22:28Z" */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; + updated_at: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" - */ - forks_url: string; - /** @example "octocat/Hello-World" */ - full_name: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ - git_commits_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ - git_refs_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ - git_tags_url: string; - /** @example "git:github.com/octocat/Hello-World.git" */ - git_url: string; - /** - * Whether downloads are enabled. - * @default true - * @example true - */ - has_downloads: boolean; - /** - * Whether issues are enabled. - * @default true - * @example true - */ - has_issues: boolean; - has_pages: boolean; - /** - * Whether projects are enabled. - * @default true - * @example true - */ - has_projects: boolean; - /** - * Whether the wiki is enabled. - * @default true - * @example true + * @example "https://api.github.com/projects/columns/367" */ - has_wiki: boolean; + url: string; +} + +/** + * Protected Branch + * Branch protections protect branches + */ +export interface ProtectedBranch { + allow_deletions?: { + enabled: boolean; + }; + allow_force_pushes?: { + enabled: boolean; + }; + enforce_admins?: { + enabled: boolean; + /** @format uri */ + url: string; + }; + required_linear_history?: { + enabled: boolean; + }; + required_pull_request_reviews?: { + dismiss_stale_reviews?: boolean; + dismissal_restrictions?: { + teams: Team[]; + /** @format uri */ + teams_url: string; + /** @format uri */ + url: string; + users: SimpleUser[]; + /** @format uri */ + users_url: string; + }; + require_code_owner_reviews?: boolean; + required_approving_review_count?: number; + /** @format uri */ + url: string; + }; + required_signatures?: { + /** @example true */ + enabled: boolean; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" + */ + url: string; + }; + /** Status Check Policy */ + required_status_checks?: StatusCheckPolicy; + /** Branch Restriction Policy */ + restrictions?: BranchRestrictionPolicy; + /** @format uri */ + url: string; +} + +/** + * Protected Branch Admin Enforced + * Protected Branch Admin Enforced + */ +export interface ProtectedBranchAdminEnforced { + /** @example true */ + enabled: boolean; /** * @format uri - * @example "https://github.com" + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" */ - homepage: string | null; + url: string; +} + +/** + * Protected Branch Pull Request Review + * Protected Branch Pull Request Review + */ +export interface ProtectedBranchPullRequestReview { + /** @example true */ + dismiss_stale_reviews: boolean; + dismissal_restrictions?: { + /** The list of teams with review dismissal access. */ + teams?: Team[]; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams"" */ + teams_url?: string; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions"" */ + url?: string; + /** The list of users with review dismissal access. */ + users?: SimpleUser[]; + /** @example ""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"" */ + users_url?: string; + }; + /** @example true */ + require_code_owner_reviews: boolean; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @min 1 + * @max 6 + * @example 2 */ - hooks_url: string; + required_approving_review_count?: number; /** * @format uri - * @example "https://github.com/octocat/Hello-World" - */ - html_url: string; - /** - * Unique identifier of the repository - * @example 42 - */ - id: number; - /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" */ - is_template?: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ - issue_comment_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ - issue_events_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ - issues_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ - keys_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ - labels_url: string; - language: string | null; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" - */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" - */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; - /** - * @format uri - * @example "git:git.example.com/octocat/Hello-World" - */ - mirror_url: string | null; - /** - * The name of the repository. - * @example "Team Environment" - */ - name: string; - network_count?: number; - /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ - node_id: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ - notifications_url: string; - open_issues: number; - /** @example 0 */ - open_issues_count: number; - owner: SimpleUser | null; - permissions?: { - admin: boolean; - maintain?: boolean; - pull: boolean; - push: boolean; - triage?: boolean; - }; - /** - * Whether the repository is private or public. - * @default false - */ - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; - /** - * @format date-time - * @example "2011-01-26T19:06:43Z" - */ - pushed_at: string | null; - /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ - releases_url: string; - /** @example 108 */ - size: number; - /** @example "git@github.com:octocat/Hello-World.git" */ - ssh_url: string; - /** @example 80 */ - stargazers_count: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" - */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" - */ - subscribers_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" - */ - subscription_url: string; - /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" - */ - svn_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" - */ - tags_url: string; - /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" - */ - teams_url: string; - temp_clone_token?: string; - template_repository?: Repository | null; - topics?: string[]; - /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ - trees_url: string; - /** - * @format date-time - * @example "2011-01-26T19:14:43Z" - */ - updated_at: string | null; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" - */ - url: string; - /** - * The repository visibility: public, private, or internal. - * @default "public" - */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; + url?: string; } /** - * Team Simple - * Groups of organization members that gives permissions on specified repositories. + * Public User + * Public User */ -export type TeamSimple = { - /** - * Description of the team - * @example "A great team." - */ - description: string | null; - /** - * @format uri - * @example "https://github.com/orgs/rails/teams/core" - */ +export interface PublicUser { + /** @format uri */ + avatar_url: string; + bio: string | null; + blog: string | null; + /** @example 3 */ + collaborators?: number; + company: string | null; + /** @format date-time */ + created_at: string; + /** @example 1 */ + disk_usage?: number; + /** @format email */ + email: string | null; + events_url: string; + followers: number; + /** @format uri */ + followers_url: string; + following: number; + following_url: string; + gists_url: string; + gravatar_id: string | null; + hireable: boolean | null; + /** @format uri */ html_url: string; - /** - * Unique identifier of the team - * @example 1 - */ id: number; - /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" - */ - ldap_dn?: string; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; - /** - * Name of the team - * @example "Justice League" - */ - name: string; - /** @example "MDQ6VGVhbTE=" */ + location: string | null; + login: string; + name: string | null; node_id: string; - /** - * Permission that the team will have for its repositories - * @example "admin" - */ - permission: string; - /** - * The level of privacy this team should have - * @example "closed" - */ - privacy?: string; - /** - * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" - */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; - /** - * URL for the team - * @format uri - * @example "https://api.github.com/organizations/1/team/1" - */ + /** @format uri */ + organizations_url: string; + /** @example 2 */ + owned_private_repos?: number; + plan?: { + collaborators: number; + name: string; + private_repos: number; + space: number; + }; + /** @example 1 */ + private_gists?: number; + public_gists: number; + public_repos: number; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + /** @example 2 */ + total_private_repos?: number; + twitter_username?: string | null; + type: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ url: string; -} | null; +} /** - * Thread - * Thread + * Pull Request + * Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. */ -export interface Thread { - id: string; - last_read_at: string | null; - reason: string; - /** Minimal Repository */ - repository: MinimalRepository; - subject: { - latest_comment_url: string; - title: string; - type: string; - url: string; +export interface PullRequest { + _links: { + /** Hypermedia Link */ + comments: Link; + /** Hypermedia Link */ + commits: Link; + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + issue: Link; + /** Hypermedia Link */ + review_comment: Link; + /** Hypermedia Link */ + review_comments: Link; + /** Hypermedia Link */ + self: Link; + /** Hypermedia Link */ + statuses: Link; }; - /** @example "https://api.github.com/notifications/threads/2/subscription" */ - subscription_url: string; - unread: boolean; - updated_at: string; - url: string; -} - -/** - * Thread Subscription - * Thread Subscription - */ -export interface ThreadSubscription { + /** @example "too heated" */ + active_lock_reason?: string | null; + /** @example 100 */ + additions: number; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** The status of auto merging a pull request. */ + auto_merge: AutoMerge; + base: { + label: string; + ref: string; + repo: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + /** @format uri */ + deployments_url: string; + description: string | null; + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; + }; + sha: string; + user: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + }; + /** @example "Please pull these awesome changes" */ + body: string | null; + /** @example 5 */ + changed_files: number; /** * @format date-time - * @example "2012-10-06T21:34:12Z" + * @example "2011-01-26T19:01:12Z" */ - created_at: string | null; - ignored: boolean; - reason: string | null; + closed_at: string | null; + /** @example 10 */ + comments: number; /** * @format uri - * @example "https://api.github.com/repos/1" + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" */ - repository_url?: string; - /** @example true */ - subscribed: boolean; + comments_url: string; + /** @example 3 */ + commits: number; /** * @format uri - * @example "https://api.github.com/notifications/threads/1" + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" */ - thread_url?: string; + commits_url: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + created_at: string; + /** @example 3 */ + deletions: number; /** * @format uri - * @example "https://api.github.com/notifications/threads/1/subscription" + * @example "https://github.com/octocat/Hello-World/pull/1347.diff" */ - url: string; -} - -/** - * Topic - * A topic aggregates entities that are related to a subject. - */ -export interface Topic { - names: string[]; -} - -/** - * Topic Search Result Item - * Topic Search Result Item - */ -export interface TopicSearchResultItem { - aliases?: - | { - topic_relation?: { - id?: number; - name?: string; - relation_type?: string; - topic_id?: number; - }; - }[] - | null; - /** @format date-time */ - created_at: string; - created_by: string | null; - curated: boolean; - description: string | null; - display_name: string | null; - featured: boolean; - /** @format uri */ - logo_url?: string | null; - name: string; - related?: - | { - topic_relation?: { - id?: number; - name?: string; - relation_type?: string; - topic_id?: number; - }; - }[] - | null; - released: string | null; - repository_count?: number | null; - score: number; - short_description: string | null; - text_matches?: SearchResultTextMatches; - /** @format date-time */ - updated_at: string; -} - -/** Traffic */ -export interface Traffic { - count: number; - /** @format date-time */ - timestamp: string; - uniques: number; -} - -/** - * User Marketplace Purchase - * User Marketplace Purchase - */ -export interface UserMarketplacePurchase { - account: MarketplaceAccount; - /** @example "monthly" */ - billing_cycle: string; + diff_url: string; /** - * @format date-time - * @example "2017-11-11T00:00:00Z" + * Indicates whether or not the pull request is a draft. + * @example false */ - free_trial_ends_on: string | null; + draft?: boolean; + head: { + label: string; + ref: string; + repo: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + /** @format uri */ + deployments_url: string; + description: string | null; + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: { + key: string; + name: string; + node_id: string; + spdx_id: string | null; + /** @format uri */ + url: string | null; + } | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; + }; + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; + }; + sha: string; + user: { + /** @format uri */ + avatar_url: string; + events_url: string; + /** @format uri */ + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + /** @format uri */ + html_url: string; + id: number; + login: string; + node_id: string; + /** @format uri */ + organizations_url: string; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + type: string; + /** @format uri */ + url: string; + }; + }; /** - * @format date-time - * @example "2017-11-11T00:00:00Z" + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347" */ - next_billing_date: string | null; - /** @example true */ - on_free_trial: boolean; - /** Marketplace Listing Plan */ - plan: MarketplaceListingPlan; - unit_count: number | null; + html_url: string; + /** @example 1 */ + id: number; /** - * @format date-time - * @example "2017-11-02T01:12:12Z" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" */ - updated_at: string | null; -} - -/** - * User Search Result Item - * User Search Result Item - */ -export interface UserSearchResultItem { - /** @format uri */ - avatar_url: string; - bio?: string | null; - blog?: string | null; - company?: string | null; - /** @format date-time */ - created_at?: string; - /** @format email */ - email?: string | null; - events_url: string; - followers?: number; - /** @format uri */ - followers_url: string; - following?: number; - following_url: string; - gists_url: string; - gravatar_id: string | null; - hireable?: boolean | null; - /** @format uri */ - html_url: string; - id: number; - location?: string | null; - login: string; - name?: string | null; - node_id: string; - /** @format uri */ - organizations_url: string; - public_gists?: number; - public_repos?: number; - /** @format uri */ - received_events_url: string; - /** @format uri */ - repos_url: string; - score: number; - site_admin: boolean; - starred_url: string; - /** @format uri */ - subscriptions_url: string; - /** @format date-time */ - suspended_at?: string | null; - text_matches?: SearchResultTextMatches; - type: string; - /** @format date-time */ - updated_at?: string; - /** @format uri */ - url: string; -} - -/** - * Validation Error - * Validation Error - */ -export interface ValidationError { - documentation_url: string; - errors?: { - code: string; - field?: string; - index?: number; - message?: string; - resource?: string; - value?: string | null | number | null | string[] | null; + issue_url: string; + labels: { + color?: string; + default?: boolean; + description?: string | null; + id?: number; + name?: string; + node_id?: string; + url?: string; }[]; - message: string; -} - -/** - * Validation Error Simple - * Validation Error Simple - */ -export interface ValidationErrorSimple { - documentation_url: string; - errors?: string[]; - message: string; -} - -/** Verification */ -export interface Verification { - payload: string | null; - reason: string; - signature: string | null; - verified: boolean; -} - -/** - * View Traffic - * View Traffic - */ -export interface ViewTraffic { - /** @example 14850 */ - count: number; - /** @example 3782 */ - uniques: number; - views: Traffic[]; -} - -/** - * Webhook Configuration - * Configuration object of the webhook - */ -export interface WebhookConfig { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; -} - -/** - * The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. - * @example ""json"" - */ -export type WebhookConfigContentType = string; - -/** - * Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** - * @example ""0"" - */ -export type WebhookConfigInsecureSsl = string; - -/** - * If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). - * @example ""********"" - */ -export type WebhookConfigSecret = string; - -/** - * The URL to which the payloads will be delivered. - * @format uri - * @example "https://example.com/webhook" - */ -export type WebhookConfigUrl = string; - -/** - * Workflow - * A GitHub Actions workflow - */ -export interface Workflow { - /** @example "https://github.com/actions/setup-ruby/workflows/CI/badge.svg" */ - badge_url: string; + /** @example true */ + locked: boolean; /** - * @format date-time - * @example "2019-12-06T14:20:20.000Z" + * Indicates whether maintainers can modify the pull request. + * @example true */ - created_at: string; + maintainer_can_modify: boolean; + /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ + merge_commit_sha: string | null; + /** @example true */ + mergeable: boolean | null; + /** @example "clean" */ + mergeable_state: string; + merged: boolean; /** * @format date-time - * @example "2019-12-06T14:20:20.000Z" + * @example "2011-01-26T19:01:12Z" */ - deleted_at?: string; - /** @example "https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml" */ - html_url: string; - /** @example 5 */ - id: number; - /** @example "CI" */ - name: string; - /** @example "MDg6V29ya2Zsb3cxMg==" */ + merged_at: string | null; + merged_by: SimpleUser | null; + milestone: Milestone | null; + /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ node_id: string; - /** @example "ruby.yaml" */ - path: string; - /** @example "active" */ - state: "active" | "deleted"; /** - * @format date-time - * @example "2019-12-06T14:20:20.000Z" + * Number uniquely identifying the pull request within its repository. + * @example 42 */ - updated_at: string; - /** @example "https://api.github.com/repos/actions/setup-ruby/workflows/5" */ - url: string; -} - -/** - * Workflow Run - * An invocation of a workflow - */ -export interface WorkflowRun { + number: number; /** - * The URL to the artifacts for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.patch" */ - artifacts_url: string; + patch_url: string; + /** @example true */ + rebaseable?: boolean | null; + requested_reviewers?: SimpleUser[] | null; + requested_teams?: TeamSimple[] | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ + review_comment_url: string; + /** @example 0 */ + review_comments: number; /** - * The URL to cancel the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/cancel" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" */ - cancel_url: string; + review_comments_url: string; /** - * The URL to the associated check suite. - * @example "https://api.github.com/repos/github/hello-world/check-suites/12" + * State of this Pull Request. Either \`open\` or \`closed\`. + * @example "open" */ - check_suite_url: string; - /** @example "neutral" */ - conclusion: string | null; - /** @format date-time */ - created_at: string; - /** @example "push" */ - event: string; - /** @example "master" */ - head_branch: string | null; - /** Simple Commit */ - head_commit: SimpleCommit; - /** Minimal Repository */ - head_repository: MinimalRepository; - /** @example 5 */ - head_repository_id?: number; + state: "open" | "closed"; /** - * The SHA of the head commit that points to the version of the worflow being run. - * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" */ - head_sha: string; - /** @example "https://github.com/github/hello-world/suites/4" */ - html_url: string; + statuses_url: string; /** - * The ID of the workflow run. - * @example 5 + * The title of the pull request. + * @example "Amazing new feature" */ - id: number; - /** - * The URL to the jobs for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/jobs" - */ - jobs_url: string; - /** - * The URL to download the logs for the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/logs" - */ - logs_url: string; - /** - * The name of the workflow run. - * @example "Build" - */ - name?: string; - /** @example "MDEwOkNoZWNrU3VpdGU1" */ - node_id: string; - pull_requests: PullRequestMinimal[] | null; - /** Minimal Repository */ - repository: MinimalRepository; - /** - * The URL to rerun the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun" - */ - rerun_url: string; + title: string; /** - * The auto incrementing run number for the workflow run. - * @example 106 + * @format date-time + * @example "2011-01-26T19:01:12Z" */ - run_number: number; - /** @example "completed" */ - status: string | null; - /** @format date-time */ updated_at: string; /** - * The URL to the workflow run. - * @example "https://api.github.com/repos/github/hello-world/actions/runs/5" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" */ url: string; - /** - * The ID of the parent workflow. - * @example 5 - */ - workflow_id: number; - /** - * The URL to the workflow. - * @example "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" - */ - workflow_url: string; + user: SimpleUser | null; } /** - * Workflow Run Usage - * Workflow Run Usage + * Pull Request Merge Result + * Pull Request Merge Result */ -export interface WorkflowRunUsage { - billable: { - MACOS?: { - jobs: number; - total_ms: number; - }; - UBUNTU?: { - jobs: number; - total_ms: number; +export interface PullRequestMergeResult { + merged: boolean; + message: string; + sha: string; +} + +/** Pull Request Minimal */ +export interface PullRequestMinimal { + base: { + ref: string; + repo: { + id: number; + name: string; + url: string; }; - WINDOWS?: { - jobs: number; - total_ms: number; + sha: string; + }; + head: { + ref: string; + repo: { + id: number; + name: string; + url: string; }; + sha: string; }; - run_duration_ms: number; + id: number; + number: number; + url: string; } /** - * Workflow Usage - * Workflow Usage + * Pull Request Review + * Pull Request Reviews are reviews on pull requests. */ -export interface WorkflowUsage { - billable: { - MACOS?: { - total_ms?: number; - }; - UBUNTU?: { - total_ms?: number; +export interface PullRequestReview { + _links: { + html: { + href: string; }; - WINDOWS?: { - total_ms?: number; + pull_request: { + href: string; }; }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** + * The text of the review. + * @example "This looks great." + */ + body: string; + body_html?: string; + body_text?: string; + /** + * A commit SHA for the review. + * @example "54bb654c9e6025347f57900a4a5c2313a96b8035" + */ + commit_id: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" + */ + html_url: string; + /** + * Unique identifier of the review + * @example 42 + */ + id: number; + /** @example "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" */ + node_id: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/12" + */ + pull_request_url: string; + /** @example "CHANGES_REQUESTED" */ + state: string; + /** @format date-time */ + submitted_at?: string; + user: SimpleUser | null; } -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -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; +/** + * Pull Request Review Comment + * Pull Request Review Comments are comments on a portion of the Pull Request's diff. + */ +export interface PullRequestReviewComment { + _links: { + html: { + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + */ + href: string; + }; + pull_request: { + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + */ + href: string; + }; + self: { + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + */ + href: string; + }; }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** + * The text of the comment. + * @example "We should probably include a check for null values here." + */ + body: string; + /** @example ""

comment body

"" */ + body_html?: string; + /** @example ""comment body"" */ + body_text?: string; + /** + * The SHA of the commit to which the comment applies. + * @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + commit_id: string; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + created_at: string; + /** + * The diff of the line that the comment refers to. + * @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." + */ + diff_hunk: string; + /** + * HTML URL for the pull request review comment. + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + */ + html_url: string; + /** + * The ID of the pull request review comment. + * @example 1 + */ + id: number; + /** + * The comment ID to reply to. + * @example 8 + */ + in_reply_to_id?: number; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + line?: number; + /** + * The node ID of the pull request review comment. + * @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" + */ + node_id: string; + /** + * The SHA of the original commit to which the comment applies. + * @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" + */ + original_commit_id: string; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + original_line?: number; + /** + * The index of the original line in the diff to which the comment applies. + * @example 4 + */ + original_position: number; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + original_start_line?: number | null; + /** + * The relative path of the file to which the comment applies. + * @example "config/database.yaml" + */ + path: string; + /** + * The line index in the diff to which the comment applies. + * @example 1 + */ + position: number; + /** + * The ID of the pull request review to which the comment belongs. + * @example 42 + */ + pull_request_review_id: number | null; + /** + * URL for the pull request that the review comment belongs to. + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + */ + pull_request_url: string; + reactions?: ReactionRollup; + /** + * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + * @default "RIGHT" + */ + side?: "LEFT" | "RIGHT"; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + start_line?: number | null; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + start_side?: "LEFT" | "RIGHT" | null; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + updated_at: string; + /** + * URL for the pull request review comment + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + */ + url: string; + /** Simple User */ + user: SimpleUser; +} - 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.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } +/** + * Pull Request Review Request + * Pull Request Review Request + */ +export interface PullRequestReviewRequest { + teams: TeamSimple[]; + users: SimpleUser[]; +} - return 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), +/** + * Pull Request Simple + * Pull Request Simple + */ +export interface PullRequestSimple { + _links: { + /** Hypermedia Link */ + comments: Link; + /** Hypermedia Link */ + commits: Link; + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + issue: Link; + /** Hypermedia Link */ + review_comment: Link; + /** Hypermedia Link */ + review_comments: Link; + /** Hypermedia Link */ + self: Link; + /** Hypermedia Link */ + statuses: Link; }; - - 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; + /** @example "too heated" */ + active_lock_reason?: string | null; + assignee: SimpleUser | null; + assignees?: SimpleUser[] | null; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** The status of auto merging a pull request. */ + auto_merge: AutoMerge; + base: { + label: string; + ref: string; + /** A git repository */ + repo: Repository; + sha: string; + user: SimpleUser | null; }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } + /** @example "Please pull these awesome changes" */ + body: string | null; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + closed_at: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + */ + comments_url: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + */ + commits_url: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + created_at: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + */ + diff_url: string; + /** + * Indicates whether or not the pull request is a draft. + * @example false + */ + draft?: boolean; + head: { + label: string; + ref: string; + /** A git repository */ + repo: Repository; + sha: string; + user: SimpleUser | null; }; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347" + */ + html_url: string; + /** @example 1 */ + id: number; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347" + */ + issue_url: string; + labels: { + color?: string; + default?: boolean; + description?: string; + id?: number; + name?: string; + node_id?: string; + url?: string; + }[]; + /** @example true */ + locked: boolean; + /** @example "e5bd3914e2e596debea16f433f57875b5b90bcd6" */ + merge_commit_sha: string | null; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + merged_at: string | null; + milestone: Milestone | null; + /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + node_id: string; + /** @example 1347 */ + number: number; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + */ + patch_url: string; + requested_reviewers?: SimpleUser[] | null; + requested_teams?: TeamSimple[] | null; + /** @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" */ + review_comment_url: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + */ + review_comments_url: string; + /** @example "open" */ + state: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + */ + statuses_url: string; + /** @example "new-feature" */ + title: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + */ + url: string; + user: SimpleUser | null; +} - 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: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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 responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[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); - } +/** Rate Limit */ +export interface RateLimit { + limit: number; + remaining: number; + reset: number; +} - if (!response.ok) throw data; - return data; - }); +/** + * Rate Limit Overview + * Rate Limit Overview + */ +export interface RateLimitOverview { + rate: RateLimit; + resources: { + code_scanning_upload?: RateLimit; + core: RateLimit; + graphql?: RateLimit; + integration_manifest?: RateLimit; + search: RateLimit; + source_import?: RateLimit; }; } /** - * @title GitHub v3 REST API - * @version 1.1.4 - * @license MIT (https://spdx.org/licenses/MIT) - * @termsOfService https://docs.github.com/articles/github-terms-of-service - * @baseUrl https://api.github.com - * @externalDocs https://docs.github.com/rest/ - * @contact Support (https://support.github.com/contact) - * - * GitHub's v3 REST API. + * Reaction + * Reactions to conversations provide a way to help people express their feelings more simply and effectively. */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { +export interface Reaction { /** - * @description Get Hypermedia links to resources accessible in GitHub's REST API - * - * @tags meta - * @name MetaRoot - * @summary GitHub API Root - * @request GET:/ + * The reaction to use + * @example "heart" */ - metaRoot = (params: RequestParams = {}) => - this.request< - { - /** @format uri */ - authorizations_url: string; - /** @format uri */ - code_search_url: string; - /** @format uri */ - commit_search_url: string; - /** @format uri */ - current_user_authorizations_html_url: string; - /** @format uri */ - current_user_repositories_url: string; - /** @format uri */ - current_user_url: string; - /** @format uri */ - emails_url: string; - /** @format uri */ - emojis_url: string; - /** @format uri */ - events_url: string; - /** @format uri */ - feeds_url: string; - /** @format uri */ - followers_url: string; - /** @format uri */ - following_url: string; - /** @format uri */ - gists_url: string; - /** @format uri */ - hub_url: string; - /** @format uri */ - issue_search_url: string; - /** @format uri */ - issues_url: string; - /** @format uri */ - keys_url: string; - /** @format uri */ - label_search_url: string; - /** @format uri */ - notifications_url: string; - /** @format uri */ - organization_repositories_url: string; - /** @format uri */ - organization_teams_url: string; - /** @format uri */ - organization_url: string; - /** @format uri */ - public_gists_url: string; - /** @format uri */ - rate_limit_url: string; - /** @format uri */ - repository_search_url: string; - /** @format uri */ - repository_url: string; - /** @format uri */ - starred_gists_url: string; - /** @format uri */ - starred_url: string; - /** @format uri */ - topic_search_url?: string; - /** @format uri */ - user_organizations_url: string; - /** @format uri */ - user_repositories_url: string; - /** @format uri */ - user_search_url: string; - /** @format uri */ - user_url: string; - }, - any - >({ - path: \`/\`, - method: "GET", - format: "json", - ...params, - }); - - app = { - /** - * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetAuthenticated - * @summary Get the authenticated app - * @request GET:/app - */ - appsGetAuthenticated: (params: RequestParams = {}) => - this.request({ - path: \`/app\`, - method: "GET", - format: "json", - ...params, - }), + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** + * @format date-time + * @example "2016-05-20T20:09:31Z" + */ + created_at: string; + /** @example 1 */ + id: number; + /** @example "MDg6UmVhY3Rpb24x" */ + node_id: string; + user: SimpleUser | null; +} - /** - * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetWebhookConfigForApp - * @summary Get a webhook configuration for an app - * @request GET:/app/hook/config - */ - appsGetWebhookConfigForApp: (params: RequestParams = {}) => - this.request({ - path: \`/app/hook/config\`, - method: "GET", - format: "json", - ...params, - }), +/** Reaction Rollup */ +export interface ReactionRollup { + "+1": number; + "-1": number; + confused: number; + eyes: number; + heart: number; + hooray: number; + laugh: number; + rocket: number; + total_count: number; + /** @format uri */ + url: string; +} - /** - * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsUpdateWebhookConfigForApp - * @summary Update a webhook configuration for an app - * @request PATCH:/app/hook/config - */ - appsUpdateWebhookConfigForApp: ( - data: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/hook/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +/** + * Referrer Traffic + * Referrer Traffic + */ +export interface ReferrerTraffic { + /** @example 4 */ + count: number; + /** @example "Google" */ + referrer: string; + /** @example 3 */ + uniques: number; +} - /** - * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. - * - * @tags apps - * @name AppsListInstallations - * @summary List installations for the authenticated app - * @request GET:/app/installations - */ - appsListInstallations: ( - query?: { - outdated?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Release + * A release. + */ +export interface Release { + assets: ReleaseAsset[]; + /** @format uri */ + assets_url: string; + /** Simple User */ + author: SimpleUser; + body?: string | null; + body_html?: string; + body_text?: string; + /** @format date-time */ + created_at: string; + /** + * true to create a draft (unpublished) release, false to create a published one. + * @example false + */ + draft: boolean; + /** @format uri */ + html_url: string; + id: number; + name: string | null; + node_id: string; + /** + * Whether to identify the release as a prerelease or a full release. + * @example false + */ + prerelease: boolean; + /** @format date-time */ + published_at: string | null; + /** + * The name of the tag. + * @example "v1.0.0" + */ + tag_name: string; + /** @format uri */ + tarball_url: string | null; + /** + * Specifies the commitish value that determines where the Git tag is created from. + * @example "master" + */ + target_commitish: string; + upload_url: string; + /** @format uri */ + url: string; + /** @format uri */ + zipball_url: string | null; +} - /** - * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsGetInstallation - * @summary Get an installation for the authenticated app - * @request GET:/app/installations/{installation_id} - */ - appsGetInstallation: (installationId: number, params: RequestParams = {}) => - this.request< - Installation, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/app/installations/\${installationId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsDeleteInstallation - * @summary Delete an installation for the authenticated app - * @request DELETE:/app/installations/{installation_id} - */ - appsDeleteInstallation: ( - installationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsCreateInstallationAccessToken - * @summary Create an installation access token for an app - * @request POST:/app/installations/{installation_id}/access_tokens - */ - appsCreateInstallationAccessToken: ( - installationId: number, - data: { - /** The permissions granted to the user-to-server access token. */ - permissions?: AppPermissions; - /** List of repository names that the token should have access to */ - repositories?: string[]; - /** - * List of repository IDs that the token should have access to - * @example [1] - */ - repository_ids?: number[]; - }, - params: RequestParams = {}, - ) => - this.request< - InstallationToken, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/app/installations/\${installationId}/access_tokens\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsSuspendInstallation - * @summary Suspend an app installation - * @request PUT:/app/installations/{installation_id}/suspended - */ - appsSuspendInstallation: ( - installationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}/suspended\`, - method: "PUT", - ...params, - }), +/** + * Release Asset + * Data related to a release. + */ +export interface ReleaseAsset { + /** @format uri */ + browser_download_url: string; + content_type: string; + /** @format date-time */ + created_at: string; + download_count: number; + id: number; + label: string | null; + /** + * The file name of the asset. + * @example "Team Environment" + */ + name: string; + node_id: string; + size: number; + /** State of the release asset. */ + state: "uploaded" | "open"; + /** @format date-time */ + updated_at: string; + uploader: SimpleUser | null; + /** @format uri */ + url: string; +} - /** - * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. - * - * @tags apps - * @name AppsUnsuspendInstallation - * @summary Unsuspend an app installation - * @request DELETE:/app/installations/{installation_id}/suspended - */ - appsUnsuspendInstallation: ( - installationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/app/installations/\${installationId}/suspended\`, - method: "DELETE", - ...params, - }), - }; - appManifests = { - /** - * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. - * - * @tags apps - * @name AppsCreateFromManifest - * @summary Create a GitHub App from a manifest - * @request POST:/app-manifests/{code}/conversions - */ - appsCreateFromManifest: (code: string, params: RequestParams = {}) => - this.request< - Integration & { - client_id: string; - client_secret: string; - pem: string; - webhook_secret: string; - [key: string]: any; - }, - BasicError | ValidationErrorSimple - >({ - path: \`/app-manifests/\${code}/conversions\`, - method: "POST", - format: "json", - ...params, - }), +/** + * Repo Search Result Item + * Repo Search Result Item + */ +export interface RepoSearchResultItem { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url: string; + archived: boolean; + assignees_url: string; + blobs_url: string; + branches_url: string; + clone_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + /** @format uri */ + contributors_url: string; + /** @format date-time */ + created_at: string; + default_branch: string; + delete_branch_on_merge?: boolean; + /** @format uri */ + deployments_url: string; + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** @format uri */ + downloads_url: string; + /** @format uri */ + events_url: string; + fork: boolean; + forks: number; + forks_count: number; + /** @format uri */ + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_pages: boolean; + has_projects: boolean; + has_wiki: boolean; + /** @format uri */ + homepage: string | null; + /** @format uri */ + hooks_url: string; + /** @format uri */ + html_url: string; + id: number; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + language: string | null; + /** @format uri */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** @format uri */ + merges_url: string; + milestones_url: string; + /** @format uri */ + mirror_url: string | null; + name: string; + node_id: string; + notifications_url: string; + open_issues: number; + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + pull: boolean; + push: boolean; }; - applications = { - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. - * - * @tags oauth-authorizations - * @name OauthAuthorizationsListGrants - * @summary List your grants - * @request GET:/applications/grants - * @deprecated - */ - oauthAuthorizationsListGrants: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetGrant - * @summary Get a single grant - * @request GET:/applications/grants/{grant_id} - * @deprecated - */ - oauthAuthorizationsGetGrant: ( - grantId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants/\${grantId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteGrant - * @summary Delete a grant - * @request DELETE:/applications/grants/{grant_id} - * @deprecated - */ - oauthAuthorizationsDeleteGrant: ( - grantId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/grants/\${grantId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). - * - * @tags apps - * @name AppsDeleteAuthorization - * @summary Delete an app authorization - * @request DELETE:/applications/{client_id}/grant - */ - appsDeleteAuthorization: ( - clientId: string, - data: { - /** The OAuth access token used to authenticate to the GitHub API. */ - access_token?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/grant\`, - method: "DELETE", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). - * - * @tags apps - * @name AppsRevokeGrantForApplication - * @summary Revoke a grant for an application - * @request DELETE:/applications/{client_id}/grants/{access_token} - * @deprecated - */ - appsRevokeGrantForApplication: ( - clientId: string, - accessToken: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/grants/\${accessToken}\`, - method: "DELETE", - ...params, - }), - - /** - * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsCheckToken - * @summary Check a token - * @request POST:/applications/{client_id}/token - */ - appsCheckToken: ( - clientId: string, - data: { - /** The access_token of the OAuth application. */ - access_token: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsResetToken - * @summary Reset a token - * @request PATCH:/applications/{client_id}/token - */ - appsResetToken: ( - clientId: string, - data: { - /** The access_token of the OAuth application. */ - access_token: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * - * @tags apps - * @name AppsDeleteToken - * @summary Delete an app token - * @request DELETE:/applications/{client_id}/token - */ - appsDeleteToken: ( - clientId: string, - data: { - /** The OAuth access token used to authenticate to the GitHub API. */ - access_token?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token\`, - method: "DELETE", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsScopeToken - * @summary Create a scoped access token - * @request POST:/applications/{client_id}/token/scoped - */ - appsScopeToken: ( - clientId: string, - data: { - /** - * **Required.** The OAuth access token used to authenticate to the GitHub API. - * @example "e72e16c7e42f292c6912e7710c838347ae178b4a" - */ - access_token?: string; - /** The permissions granted to the user-to-server access token. */ - permissions?: AppPermissions; - /** The list of repository IDs to scope the user-to-server access token to. \`repositories\` may not be specified if \`repository_ids\` is specified. */ - repositories?: string[]; - /** - * The list of repository names to scope the user-to-server access token to. \`repository_ids\` may not be specified if \`repositories\` is specified. - * @example [1] - */ - repository_ids?: number[]; - /** - * The name of the user or organization to scope the user-to-server access token to. **Required** unless \`target_id\` is specified. - * @example "octocat" - */ - target?: string; - /** - * The ID of the user or organization to scope the user-to-server access token to. **Required** unless \`target\` is specified. - * @example 1 - */ - target_id?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/token/scoped\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + private: boolean; + pulls_url: string; + /** @format date-time */ + pushed_at: string; + releases_url: string; + score: number; + size: number; + ssh_url: string; + stargazers_count: number; + /** @format uri */ + stargazers_url: string; + statuses_url: string; + /** @format uri */ + subscribers_url: string; + /** @format uri */ + subscription_url: string; + /** @format uri */ + svn_url: string; + /** @format uri */ + tags_url: string; + /** @format uri */ + teams_url: string; + temp_clone_token?: string; + text_matches?: SearchResultTextMatches; + topics?: string[]; + trees_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; + watchers: number; + watchers_count: number; +} - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsCheckAuthorization - * @summary Check an authorization - * @request GET:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsCheckAuthorization: ( - clientId: string, - accessToken: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. - * - * @tags apps - * @name AppsResetAuthorization - * @summary Reset an authorization - * @request POST:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsResetAuthorization: ( - clientId: string, - accessToken: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "POST", - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. - * - * @tags apps - * @name AppsRevokeAuthorizationForApplication - * @summary Revoke an authorization for an application - * @request DELETE:/applications/{client_id}/tokens/{access_token} - * @deprecated - */ - appsRevokeAuthorizationForApplication: ( - clientId: string, - accessToken: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/applications/\${clientId}/tokens/\${accessToken}\`, - method: "DELETE", - ...params, - }), +/** + * Repository + * A git repository + */ +export interface Repository { + /** + * Whether to allow merge commits for pull requests. + * @default true + * @example true + */ + allow_merge_commit?: boolean; + /** + * Whether to allow rebase merges for pull requests. + * @default true + * @example true + */ + allow_rebase_merge?: boolean; + /** + * Whether to allow squash merges for pull requests. + * @default true + * @example true + */ + allow_squash_merge?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + /** + * Whether the repository is archived. + * @default false + */ + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" + */ + contributors_url: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + created_at: string | null; + /** + * The default branch of the repository. + * @example "master" + */ + default_branch: string; + /** + * Whether to delete head branches when pull requests are merged + * @default false + * @example false + */ + delete_branch_on_merge?: boolean; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" + */ + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" + */ + downloads_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" + */ + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" + */ + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; + /** + * Whether downloads are enabled. + * @default true + * @example true + */ + has_downloads: boolean; + /** + * Whether issues are enabled. + * @default true + * @example true + */ + has_issues: boolean; + has_pages: boolean; + /** + * Whether projects are enabled. + * @default true + * @example true + */ + has_projects: boolean; + /** + * Whether the wiki is enabled. + * @default true + * @example true + */ + has_wiki: boolean; + /** + * @format uri + * @example "https://github.com" + */ + homepage: string | null; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + */ + hooks_url: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World" + */ + html_url: string; + /** + * Unique identifier of the repository + * @example 42 + */ + id: number; + /** + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true + */ + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" + */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" + */ + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; + /** + * @format uri + * @example "git:git.example.com/octocat/Hello-World" + */ + mirror_url: string | null; + /** + * The name of the repository. + * @example "Team Environment" + */ + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + maintain?: boolean; + pull: boolean; + push: boolean; + triage?: boolean; }; - apps = { - /** - * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsGetBySlug - * @summary Get an app - * @request GET:/apps/{app_slug} - */ - appsGetBySlug: (appSlug: string, params: RequestParams = {}) => - this.request< - Integration, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/apps/\${appSlug}\`, - method: "GET", - format: "json", - ...params, - }), - }; - authorizations = { - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsListAuthorizations - * @summary List your authorizations - * @request GET:/authorizations - * @deprecated - */ - oauthAuthorizationsListAuthorizations: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsCreateAuthorization - * @summary Create a new authorization - * @request POST:/authorizations - * @deprecated - */ - oauthAuthorizationsCreateAuthorization: ( - data: { - /** - * The OAuth app client key for which to create the token. - * @maxLength 20 - */ - client_id?: string; - /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 - */ - client_secret?: string; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; - /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" - */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; - /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] - */ - scopes?: string[] | null; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForApp - * @summary Get-or-create an authorization for a specific app - * @request PUT:/authorizations/clients/{client_id} - * @deprecated - */ - oauthAuthorizationsGetOrCreateAuthorizationForApp: ( - clientId: string, - data: { - /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 - */ - client_secret: string; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; - /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" - */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; - /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] - */ - scopes?: string[] | null; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/clients/\${clientId}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint - * @summary Get-or-create an authorization for a specific app and fingerprint - * @request PUT:/authorizations/clients/{client_id}/{fingerprint} - * @deprecated - */ - oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( - clientId: string, - fingerprint: string, - data: { - /** - * The OAuth app client secret for which to create the token. - * @maxLength 40 - */ - client_secret: string; - /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" - */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; - /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] - */ - scopes?: string[] | null; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsGetAuthorization - * @summary Get a single authorization - * @request GET:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsGetAuthorization: ( - authorizationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. - * - * @tags oauth-authorizations - * @name OauthAuthorizationsUpdateAuthorization - * @summary Update an existing authorization - * @request PATCH:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsUpdateAuthorization: ( - authorizationId: number, - data: { - /** A list of scopes to add to this authorization. */ - add_scopes?: string[]; - /** A unique string to distinguish an authorization from others created for the same client ID and user. */ - fingerprint?: string; - /** - * A note to remind you what the OAuth token is for. - * @example "Update all gems" - */ - note?: string; - /** A URL to remind you what app the OAuth token is for. */ - note_url?: string; - /** A list of scopes to remove from this authorization. */ - remove_scopes?: string[]; - /** - * A list of scopes that this authorization is in. - * @example ["public_repo","user"] - */ - scopes?: string[] | null; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). - * - * @tags oauth-authorizations - * @name OauthAuthorizationsDeleteAuthorization - * @summary Delete an authorization - * @request DELETE:/authorizations/{authorization_id} - * @deprecated - */ - oauthAuthorizationsDeleteAuthorization: ( - authorizationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/authorizations/\${authorizationId}\`, - method: "DELETE", - ...params, - }), - }; - codesOfConduct = { - /** - * No description - * - * @tags codes-of-conduct - * @name CodesOfConductGetAllCodesOfConduct - * @summary Get all codes of conduct - * @request GET:/codes_of_conduct - */ - codesOfConductGetAllCodesOfConduct: (params: RequestParams = {}) => - this.request< - CodeOfConduct[], - { - documentation_url: string; - message: string; - } - >({ - path: \`/codes_of_conduct\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @tags codes-of-conduct - * @name CodesOfConductGetConductCode - * @summary Get a code of conduct - * @request GET:/codes_of_conduct/{key} - */ - codesOfConductGetConductCode: (key: string, params: RequestParams = {}) => - this.request< - CodeOfConduct, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/codes_of_conduct/\${key}\`, - method: "GET", - format: "json", - ...params, - }), - }; - contentReferences = { - /** - * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsCreateContentAttachment - * @summary Create a content attachment - * @request POST:/content_references/{content_reference_id}/attachments - */ - appsCreateContentAttachment: ( - contentReferenceId: number, - data: { - /** - * The body of the attachment - * @maxLength 262144 - * @example "Body of the attachment" - */ - body: string; - /** - * The title of the attachment - * @maxLength 1024 - * @example "Title of the attachment" - */ - title: string; - }, - params: RequestParams = {}, - ) => - this.request< - ContentReferenceAttachment, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/content_references/\${contentReferenceId}/attachments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - emojis = { - /** - * @description Lists all the emojis available to use on GitHub. - * - * @tags emojis - * @name EmojisGet - * @summary Get emojis - * @request GET:/emojis - */ - emojisGet: (params: RequestParams = {}) => - this.request, any>({ - path: \`/emojis\`, - method: "GET", - format: "json", - ...params, - }), - }; - enterprises = { - /** - * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise - * @summary Get GitHub Actions permissions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions - */ - enterpriseAdminGetGithubActionsPermissionsEnterprise: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise - * @summary Set GitHub Actions permissions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions - */ - enterpriseAdminSetGithubActionsPermissionsEnterprise: ( - enterprise: string, - data: { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_organizations: EnabledOrganizations; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary List selected organizations enabled for GitHub Actions in an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/organizations - */ - enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise: ( - enterprise: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - organizations: OrganizationSimple[]; - total_count: number; - }, - any - >({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise - * @summary Set selected organizations enabled for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations - */ - enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( - enterprise: string, - data: { - /** List of organization IDs to enable for GitHub Actions. */ - selected_organization_ids: number[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise - * @summary Enable a selected organization for GitHub Actions in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} - */ - enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( - enterprise: string, - orgId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, - method: "PUT", - ...params, - }), - - /** - * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise - * @summary Disable a selected organization for GitHub Actions in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} - */ - enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( - enterprise: string, - orgId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetAllowedActionsEnterprise - * @summary Get allowed actions for an enterprise - * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions - */ - enterpriseAdminGetAllowedActionsEnterprise: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetAllowedActionsEnterprise - * @summary Set allowed actions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions - */ - enterpriseAdminSetAllowedActionsEnterprise: ( - enterprise: string, - data: SelectedActions, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise - * @summary List self-hosted runner groups for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups - */ - enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( - enterprise: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - runner_groups: RunnerGroupsEnterprise[]; - total_count: number; - }, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise - * @summary Create a self-hosted runner group for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runner-groups - */ - enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( - enterprise: string, - data: { - /** Name of the runner group. */ - name: string; - /** List of runner IDs to add to the runner group. */ - runners?: number[]; - /** List of organization IDs that can access the runner group. */ - selected_organization_ids?: number[]; - /** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ - visibility?: "selected" | "all"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise - * @summary Get a self-hosted runner group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise - * @summary Update a self-hosted runner group for an enterprise - * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - data: { - /** Name of the runner group. */ - name?: string; - /** - * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` - * @default "all" - */ - visibility?: "selected" | "all"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise - * @summary Delete a self-hosted runner group from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} - */ - enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( - enterprise: string, - runnerGroupId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary List organization access to a self-hosted runner group in an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - */ - enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - enterprise: string, - runnerGroupId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - organizations: OrganizationSimple[]; - total_count: number; - }, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Set organization access for a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations - */ - enterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - enterprise: string, - runnerGroupId: number, - data: { - /** List of organization IDs that can access the runner group. */ - selected_organization_ids: number[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Add organization access to a self-hosted runner group in an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - */ - enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - enterprise: string, - runnerGroupId: number, - orgId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, - method: "PUT", - ...params, - }), - - /** - * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise - * @summary Remove organization access to a self-hosted runner group in an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} - */ - enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( - enterprise: string, - runnerGroupId: number, - orgId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise - * @summary List self-hosted runners in a group for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - */ - enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - runners: Runner[]; - total_count: number; - }, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise - * @summary Set self-hosted runners in a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners - */ - enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - data: { - /** List of runner IDs to add to the runner group. */ - runners: number[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise - * @summary Add a self-hosted runner to a group for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "PUT", - ...params, - }), - - /** - * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise - * @summary Remove a self-hosted runner from a group for an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( - enterprise: string, - runnerGroupId: number, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListSelfHostedRunnersForEnterprise - * @summary List self-hosted runners for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners - */ - enterpriseAdminListSelfHostedRunnersForEnterprise: ( - enterprise: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - runners?: Runner[]; - total_count?: number; - }, - any - >({ - path: \`/enterprises/\${enterprise}/actions/runners\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminListRunnerApplicationsForEnterprise - * @summary List runner applications for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/downloads - */ - enterpriseAdminListRunnerApplicationsForEnterprise: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, - method: "GET", - format: "json", - ...params, - }), + /** + * Whether the repository is private or public. + * @default false + */ + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; + /** + * @format date-time + * @example "2011-01-26T19:06:43Z" + */ + pushed_at: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + */ + stargazers_url: string; + /** @example ""2020-07-09T00:17:42Z"" */ + starred_at?: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + */ + subscribers_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + */ + subscription_url: string; + /** + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" + */ + svn_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" + */ + tags_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" + */ + teams_url: string; + temp_clone_token?: string; + template_repository?: { + allow_merge_commit?: boolean; + allow_rebase_merge?: boolean; + allow_squash_merge?: boolean; + archive_url?: string; + archived?: boolean; + assignees_url?: string; + blobs_url?: string; + branches_url?: string; + clone_url?: string; + collaborators_url?: string; + comments_url?: string; + commits_url?: string; + compare_url?: string; + contents_url?: string; + contributors_url?: string; + created_at?: string; + default_branch?: string; + delete_branch_on_merge?: boolean; + deployments_url?: string; + description?: string; + disabled?: boolean; + downloads_url?: string; + events_url?: string; + fork?: boolean; + forks_count?: number; + forks_url?: string; + full_name?: string; + git_commits_url?: string; + git_refs_url?: string; + git_tags_url?: string; + git_url?: string; + has_downloads?: boolean; + has_issues?: boolean; + has_pages?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + homepage?: string; + hooks_url?: string; + html_url?: string; + id?: number; + is_template?: boolean; + issue_comment_url?: string; + issue_events_url?: string; + issues_url?: string; + keys_url?: string; + labels_url?: string; + language?: string; + languages_url?: string; + merges_url?: string; + milestones_url?: string; + mirror_url?: string; + name?: string; + network_count?: number; + node_id?: string; + notifications_url?: string; + open_issues_count?: number; + owner?: { + avatar_url?: string; + events_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + gravatar_id?: string; + html_url?: string; + id?: number; + login?: string; + node_id?: string; + organizations_url?: string; + received_events_url?: string; + repos_url?: string; + site_admin?: boolean; + starred_url?: string; + subscriptions_url?: string; + type?: string; + url?: string; + }; + permissions?: { + admin?: boolean; + pull?: boolean; + push?: boolean; + }; + private?: boolean; + pulls_url?: string; + pushed_at?: string; + releases_url?: string; + size?: number; + ssh_url?: string; + stargazers_count?: number; + stargazers_url?: string; + statuses_url?: string; + subscribers_count?: number; + subscribers_url?: string; + subscription_url?: string; + svn_url?: string; + tags_url?: string; + teams_url?: string; + temp_clone_token?: string; + topics?: string[]; + trees_url?: string; + updated_at?: string; + url?: string; + visibility?: string; + watchers_count?: number; + } | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; + /** + * @format date-time + * @example "2011-01-26T19:14:43Z" + */ + updated_at: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" + */ + url: string; + /** + * The repository visibility: public, private, or internal. + * @default "public" + */ + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; +} - /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateRegistrationTokenForEnterprise - * @summary Create a registration token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/registration-token - */ - enterpriseAdminCreateRegistrationTokenForEnterprise: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, - method: "POST", - format: "json", - ...params, - }), +/** + * Repository Collaborator Permission + * Repository Collaborator Permission + */ +export interface RepositoryCollaboratorPermission { + permission: string; + user: SimpleUser | null; +} - /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` - * - * @tags enterprise-admin - * @name EnterpriseAdminCreateRemoveTokenForEnterprise - * @summary Create a remove token for an enterprise - * @request POST:/enterprises/{enterprise}/actions/runners/remove-token - */ - enterpriseAdminCreateRemoveTokenForEnterprise: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, - method: "POST", - format: "json", - ...params, - }), +/** + * Repository Invitation + * Repository invitations let you manage who you collaborate with. + */ +export interface RepositoryInvitation { + /** + * @format date-time + * @example "2016-06-13T14:52:50-05:00" + */ + created_at: string; + /** Whether or not the invitation has expired */ + expired?: boolean; + /** @example "https://github.com/octocat/Hello-World/invitations" */ + html_url: string; + /** + * Unique identifier of the repository invitation. + * @example 42 + */ + id: number; + invitee: SimpleUser | null; + inviter: SimpleUser | null; + node_id: string; + /** + * The permission associated with the invitation. + * @example "read" + */ + permissions: "read" | "write" | "admin"; + /** Minimal Repository */ + repository: MinimalRepository; + /** + * URL for the repository invitation + * @example "https://api.github.com/user/repository-invitations/1" + */ + url: string; +} - /** - * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise - * @summary Get a self-hosted runner for an enterprise - * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} - */ - enterpriseAdminGetSelfHostedRunnerForEnterprise: ( - enterprise: string, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Repository Invitation + * Repository invitations let you manage who you collaborate with. + */ +export interface RepositorySubscription { + /** + * @format date-time + * @example "2012-10-06T21:34:12Z" + */ + created_at: string; + /** Determines if all notifications should be blocked from this repository. */ + ignored: boolean; + reason: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example" + */ + repository_url: string; + /** + * Determines if notifications should be received from this repository. + * @example true + */ + subscribed: boolean; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/example/subscription" + */ + url: string; +} - /** - * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. - * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise - * @summary Delete a self-hosted runner from an enterprise - * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} - */ - enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( - enterprise: string, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), +/** + * Legacy Review Comment + * Legacy Review Comment + */ +export interface ReviewComment { + _links: { + /** Hypermedia Link */ + html: Link; + /** Hypermedia Link */ + pull_request: Link; + /** Hypermedia Link */ + self: Link; + }; + /** How the author is associated with the repository. */ + author_association: AuthorAssociation; + /** @example "Great stuff" */ + body: string; + body_html?: string; + body_text?: string; + /** @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" */ + commit_id: string; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + created_at: string; + /** @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." */ + diff_hunk: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + */ + html_url: string; + /** @example 10 */ + id: number; + /** @example 8 */ + in_reply_to_id?: number; + /** + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + line?: number; + /** @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" */ + node_id: string; + /** @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" */ + original_commit_id: string; + /** + * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 + */ + original_line?: number; + /** @example 4 */ + original_position: number; + /** + * The original first line of the range for a multi-line comment. + * @example 2 + */ + original_start_line?: number | null; + /** @example "file1.txt" */ + path: string; + /** @example 1 */ + position: number | null; + /** @example 42 */ + pull_request_review_id: number | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" + */ + pull_request_url: string; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + side?: "LEFT" | "RIGHT"; + /** + * The first line of the range for a multi-line comment. + * @example 2 + */ + start_line?: number | null; + /** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ + start_side?: "LEFT" | "RIGHT" | null; + /** + * @format date-time + * @example "2011-04-14T16:00:49Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + */ + url: string; + user: SimpleUser | null; +} - /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. - * - * @tags audit-log - * @name AuditLogGetAuditLog - * @summary Get the audit log for an enterprise - * @request GET:/enterprises/{enterprise}/audit-log - */ - auditLogGetAuditLog: ( - enterprise: string, - query?: { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: "web" | "git" | "all"; - /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/audit-log\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Self hosted runners + * A self hosted runner + */ +export interface Runner { + busy: boolean; + /** + * The id of the runner. + * @example 5 + */ + id: number; + labels: { + /** Unique identifier of the label. */ + id?: number; + /** Name of the label. */ + name?: string; + /** The type of label. Read-only labels are applied automatically when the runner is configured. */ + type?: "read-only" | "custom"; + }[]; + /** + * The name of the runner. + * @example "iMac" + */ + name: string; + /** + * The Operating System of the runner. + * @example "macos" + */ + os: string; + /** + * The status of the runner. + * @example "online" + */ + status: string; +} - /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetGithubActionsBillingGhe - * @summary Get GitHub Actions billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/actions - */ - billingGetGithubActionsBillingGhe: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/actions\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Runner Application + * Runner Application + */ +export interface RunnerApplication { + architecture: string; + download_url: string; + filename: string; + os: string; +} - /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetGithubPackagesBillingGhe - * @summary Get GitHub Packages billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/packages - */ - billingGetGithubPackagesBillingGhe: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/packages\`, - method: "GET", - format: "json", - ...params, - }), +export interface RunnerGroupsEnterprise { + allows_public_repositories: boolean; + default: boolean; + id: number; + name: string; + runners_url: string; + selected_organizations_url?: string; + visibility: string; +} - /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. - * - * @tags billing - * @name BillingGetSharedStorageBillingGhe - * @summary Get shared storage billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage - */ - billingGetSharedStorageBillingGhe: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, - method: "GET", - format: "json", - ...params, - }), - }; - events = { - /** - * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. - * - * @tags activity - * @name ActivityListPublicEvents - * @summary List public events - * @request GET:/events - */ - activityListPublicEvents: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - Event[], - | BasicError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - feeds = { - /** - * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. - * - * @tags activity - * @name ActivityGetFeeds - * @summary Get feeds - * @request GET:/feeds - */ - activityGetFeeds: (params: RequestParams = {}) => - this.request({ - path: \`/feeds\`, - method: "GET", - format: "json", - ...params, - }), +export interface RunnerGroupsOrg { + allows_public_repositories: boolean; + default: boolean; + id: number; + inherited: boolean; + inherited_allows_public_repositories?: boolean; + name: string; + runners_url: string; + /** Link to the selected repositories resource for this runner group. Not present unless visibility was set to \`selected\` */ + selected_repositories_url?: string; + visibility: string; +} + +export interface ScimEnterpriseGroup { + displayName?: string; + externalId?: string | null; + id: string; + members?: { + $ref?: string; + display?: string; + value?: string; + }[]; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; }; - gists = { - /** - * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: - * - * @tags gists - * @name GistsList - * @summary List gists for the authenticated user - * @request GET:/gists - */ - gistsList: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + schemas: string[]; +} - /** - * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. - * - * @tags gists - * @name GistsCreate - * @summary Create a gist - * @request POST:/gists - */ - gistsCreate: ( - data: { - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names and content for the files that make up the gist - * @example {"hello.rb":{"content":"puts \\"Hello, World!\\""}} - */ - files: Record< - string, - { - /** Content of the file */ - content: string; - } - >; - /** Flag indicating whether the gist is public */ - public?: boolean | "true" | "false"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +export interface ScimEnterpriseUser { + active?: boolean; + emails?: { + primary?: boolean; + type?: string; + value?: string; + }[]; + externalId?: string; + groups?: { + value?: string; + }[]; + id: string; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + name?: { + familyName?: string; + givenName?: string; + }; + schemas: string[]; + userName?: string; +} - /** - * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. - * - * @tags gists - * @name GistsListPublic - * @summary List public gists - * @request GET:/gists/public - */ - gistsListPublic: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/public\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Scim Error + * Scim Error + */ +export interface ScimError { + detail?: string | null; + documentation_url?: string | null; + message?: string | null; + schemas?: string[]; + scimType?: string | null; + status?: number; +} - /** - * @description List the authenticated user's starred gists: - * - * @tags gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred - */ - gistsListStarred: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/starred\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +export interface ScimGroupListEnterprise { + Resources: { + displayName?: string; + externalId?: string | null; + id: string; + members?: { + $ref?: string; + display?: string; + value?: string; + }[]; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + schemas: string[]; + }[]; + itemsPerPage: number; + schemas: string[]; + startIndex: number; + totalResults: number; +} +/** + * SCIM /Users + * SCIM /Users provisioning endpoints + */ +export interface ScimUser { + /** + * The active status of the User. + * @example true + */ + active: boolean; + /** + * The name of the user, suitable for display to end-users + * @example "Jon Doe" + */ + displayName?: string | null; + /** + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + */ + emails: { + primary?: boolean; + value: string; + }[]; + /** + * The ID of the User. + * @example "a7b0f98395" + */ + externalId: string | null; + /** associated groups */ + groups?: { + display?: string; + value?: string; + }[]; + /** + * Unique identifier of an external identity + * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" + */ + id: string; + meta: { /** - * No description - * - * @tags gists - * @name GistsGet - * @summary Get a gist - * @request GET:/gists/{gist_id} + * @format date-time + * @example "2019-01-24T22:45:36.000Z" */ - gistsGet: (gistId: string, params: RequestParams = {}) => - this.request< - GistSimple, - | { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; - } - | BasicError - >({ - path: \`/gists/\${gistId}\`, - method: "GET", - format: "json", - ...params, - }), - + created?: string; /** - * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. - * - * @tags gists - * @name GistsUpdate - * @summary Update a gist - * @request PATCH:/gists/{gist_id} + * @format date-time + * @example "2019-01-24T22:45:36.000Z" */ - gistsUpdate: ( - gistId: string, - data: null & { - /** - * Description of the gist - * @example "Example Ruby script" - */ - description?: string; - /** - * Names of files to be updated - * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} - */ - files?: Record< - string, - (object | null) & - ({ - /** The new content of the file */ - content?: string; - /** The new filename for the file */ - filename?: string | null; - } | null) - >; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - + lastModified?: string; /** - * No description - * - * @tags gists - * @name GistsDelete - * @summary Delete a gist - * @request DELETE:/gists/{gist_id} + * @format uri + * @example "https://api.github.com/scim/v2/organizations/myorg-123abc55141bfd8f/Users/c42772b5-2029-11e9-8543-9264a97dec8d" */ - gistsDelete: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}\`, - method: "DELETE", - ...params, - }), + location?: string; + /** @example "User" */ + resourceType?: string; + }; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string | null; + formatted?: string | null; + givenName: string | null; + }; + /** + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] + */ + operations?: { + op: "add" | "remove" | "replace"; + path?: string; + value?: string | object | any[]; + }[]; + /** The ID of the organization. */ + organization_id?: number; + /** + * SCIM schema used. + * @minItems 1 + */ + schemas: string[]; + /** + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" + */ + userName: string | null; +} + +/** + * SCIM User List + * SCIM User List + */ +export interface ScimUserList { + Resources: ScimUser[]; + /** @example 10 */ + itemsPerPage: number; + /** + * SCIM schema used. + * @minItems 1 + */ + schemas: string[]; + /** @example 1 */ + startIndex: number; + /** @example 3 */ + totalResults: number; +} + +export interface ScimUserListEnterprise { + Resources: { + active?: boolean; + emails?: { + primary?: boolean; + type?: string; + value?: string; + }[]; + externalId?: string; + groups?: { + value?: string; + }[]; + id: string; + meta?: { + created?: string; + lastModified?: string; + location?: string; + resourceType?: string; + }; + name?: { + familyName?: string; + givenName?: string; + }; + schemas: string[]; + userName?: string; + }[]; + itemsPerPage: number; + schemas: string[]; + startIndex: number; + totalResults: number; +} + +/** Scoped Installation */ +export interface ScopedInstallation { + /** Simple User */ + account: SimpleUser; + /** @example true */ + has_multiple_single_files?: boolean; + /** The permissions granted to the user-to-server access token. */ + permissions: AppPermissions; + /** + * @format uri + * @example "https://api.github.com/users/octocat/repos" + */ + repositories_url: string; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: "all" | "selected"; + /** @example "config.yaml" */ + single_file_name: string | null; + /** @example ["config.yml",".github/issue_TEMPLATE.md"] */ + single_file_paths?: string[]; +} + +/** Search Result Text Matches */ +export type SearchResultTextMatches = { + fragment?: string; + matches?: { + indices?: number[]; + text?: string; + }[]; + object_type?: string | null; + object_url?: string; + property?: string; +}[]; + +export interface SecretScanningAlert { + /** The time that the alert was created in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + created_at?: AlertCreatedAt; + /** The GitHub URL of the alert resource. */ + html_url?: AlertHtmlUrl; + /** The security alert number. */ + number?: AlertNumber; + /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ + resolution?: SecretScanningAlertResolution; + /** + * The time that the alert was resolved in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time + */ + resolved_at?: string | null; + /** Simple User */ + resolved_by?: SimpleUser; + /** The secret that was detected. */ + secret?: string; + /** The type of secret that secret scanning detected. */ + secret_type?: string; + /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ + state?: SecretScanningAlertState; + /** The REST API URL of the alert resource. */ + url?: AlertUrl; +} + +/** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ +export type SecretScanningAlertResolution = + | "false_positive" + | "wont_fix" + | "revoked" + | "used_in_tests" + | null; + +/** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ +export enum SecretScanningAlertState { + Open = "open", + Resolved = "resolved", +} + +export interface SelectedActions { + /** Whether GitHub-owned actions are allowed. For example, this includes the actions in the \`actions\` organization. */ + github_owned_allowed: boolean; + /** Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, \`monalisa/octocat@*\`, \`monalisa/octocat@v2\`, \`monalisa/*\`." */ + patterns_allowed: string[]; + /** Whether actions in GitHub Marketplace from verified creators are allowed. Set to \`true\` to allow all GitHub Marketplace actions by verified creators. */ + verified_allowed: boolean; +} - /** - * No description - * - * @tags gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments - */ - gistsListComments: ( - gistId: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** The API URL to use to get or set the actions that are allowed to run, when \`allowed_actions\` is set to \`selected\`. */ +export type SelectedActionsUrl = string; - /** - * No description - * - * @tags gists - * @name GistsCreateComment - * @summary Create a gist comment - * @request POST:/gists/{gist_id}/comments - */ - gistsCreateComment: ( - gistId: string, - data: { - /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" - */ - body: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +/** + * Short Blob + * Short Blob + */ +export interface ShortBlob { + sha: string; + url: string; +} - /** - * No description - * - * @tags gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} - */ - gistsGetComment: ( - gistId: string, - commentId: number, - params: RequestParams = {}, - ) => - this.request< - GistComment, - | { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; - } - | BasicError - >({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Short Branch + * Short Branch + */ +export interface ShortBranch { + commit: { + sha: string; + /** @format uri */ + url: string; + }; + name: string; + protected: boolean; + /** Branch Protection */ + protection?: BranchProtection; + /** @format uri */ + protection_url?: string; +} - /** - * No description - * - * @tags gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_id} - */ - gistsUpdateComment: ( - gistId: string, - commentId: number, - data: { - /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" - */ - body: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +/** + * Simple Commit + * Simple Commit + */ +export interface SimpleCommit { + author: { + email: string; + name: string; + } | null; + committer: { + email: string; + name: string; + } | null; + id: string; + message: string; + /** @format date-time */ + timestamp: string; + tree_id: string; +} + +/** Simple Commit Status */ +export interface SimpleCommitStatus { + /** @format uri */ + avatar_url: string | null; + context: string; + /** @format date-time */ + created_at: string; + description: string | null; + id: number; + node_id: string; + required?: boolean | null; + state: string; + /** @format uri */ + target_url: string; + /** @format date-time */ + updated_at: string; + /** @format uri */ + url: string; +} + +/** + * Simple User + * Simple User + */ +export type SimpleUser = { + /** + * @format uri + * @example "https://github.com/images/error/octocat_happy.gif" + */ + avatar_url: string; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/followers" + */ + followers_url: string; + /** @example "https://api.github.com/users/octocat/following{/other_user}" */ + following_url: string; + /** @example "https://api.github.com/users/octocat/gists{/gist_id}" */ + gists_url: string; + /** @example "41d064eb2195891e12d0413f63227ea7" */ + gravatar_id: string | null; + /** + * @format uri + * @example "https://github.com/octocat" + */ + html_url: string; + /** @example 1 */ + id: number; + /** @example "octocat" */ + login: string; + /** @example "MDQ6VXNlcjE=" */ + node_id: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/orgs" + */ + organizations_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/received_events" + */ + received_events_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/repos" + */ + repos_url: string; + site_admin: boolean; + /** @example ""2020-07-09T00:17:55Z"" */ + starred_at?: string; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat/subscriptions" + */ + subscriptions_url: string; + /** @example "User" */ + type: string; + /** + * @format uri + * @example "https://api.github.com/users/octocat" + */ + url: string; +} | null; - /** - * No description - * - * @tags gists - * @name GistsDeleteComment - * @summary Delete a gist comment - * @request DELETE:/gists/{gist_id}/comments/{comment_id} - */ - gistsDeleteComment: ( - gistId: string, - commentId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "DELETE", - ...params, - }), +/** + * Stargazer + * Stargazer + */ +export interface Stargazer { + /** @format date-time */ + starred_at: string; + user: SimpleUser | null; +} - /** - * No description - * - * @tags gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits - */ - gistsListCommits: ( - gistId: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/commits\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Starred Repository + * Starred Repository + */ +export interface StarredRepository { + /** A git repository */ + repo: Repository; + /** @format date-time */ + starred_at: string; +} - /** - * No description - * - * @tags gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks - */ - gistsListForks: ( - gistId: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/forks\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Status + * The status of a commit. + */ +export interface Status { + avatar_url: string | null; + context: string; + created_at: string; + /** Simple User */ + creator: SimpleUser; + description: string; + id: number; + node_id: string; + state: string; + target_url: string; + updated_at: string; + url: string; +} - /** - * @description **Note**: This was previously \`/gists/:gist_id/fork\`. - * - * @tags gists - * @name GistsFork - * @summary Fork a gist - * @request POST:/gists/{gist_id}/forks - */ - gistsFork: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/forks\`, - method: "POST", - format: "json", - ...params, - }), +/** + * Status Check Policy + * Status Check Policy + */ +export interface StatusCheckPolicy { + /** @example ["continuous-integration/travis-ci"] */ + contexts: string[]; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts" + */ + contexts_url: string; + /** @example true */ + strict: boolean; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks" + */ + url: string; +} - /** - * No description - * - * @tags gists - * @name GistsCheckIsStarred - * @summary Check if a gist is starred - * @request GET:/gists/{gist_id}/star - */ - gistsCheckIsStarred: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "GET", - ...params, - }), +/** + * Tag + * Tag + */ +export interface Tag { + commit: { + sha: string; + /** @format uri */ + url: string; + }; + /** @example "v0.1" */ + name: string; + node_id: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/tarball/v0.1" + */ + tarball_url: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/zipball/v0.1" + */ + zipball_url: string; +} - /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - * - * @tags gists - * @name GistsStar - * @summary Star a gist - * @request PUT:/gists/{gist_id}/star - */ - gistsStar: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "PUT", - ...params, - }), +/** + * Team + * Groups of organization members that gives permissions on specified repositories. + */ +export interface Team { + description: string | null; + /** + * @format uri + * @example "https://github.com/orgs/rails/teams/core" + */ + html_url: string; + id: number; + members_url: string; + name: string; + node_id: string; + parent?: TeamSimple | null; + permission: string; + privacy?: string; + /** @format uri */ + repositories_url: string; + slug: string; + /** @format uri */ + url: string; +} - /** - * No description - * - * @tags gists - * @name GistsUnstar - * @summary Unstar a gist - * @request DELETE:/gists/{gist_id}/star - */ - gistsUnstar: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}/star\`, - method: "DELETE", - ...params, - }), +/** + * Team Discussion + * A team discussion is a persistent record of a free-form conversation within a team. + */ +export interface TeamDiscussion { + author: SimpleUser | null; + /** + * The main text of the discussion. + * @example "Please suggest improvements to our workflow in comments." + */ + body: string; + /** @example "

Hi! This is an area for us to collaborate as a team

" */ + body_html: string; + /** + * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + * @example "0307116bbf7ced493b8d8a346c650b71" + */ + body_version: string; + /** @example 0 */ + comments_count: number; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027/discussions/1/comments" + */ + comments_url: string; + /** + * @format date-time + * @example "2018-01-25T18:56:31Z" + */ + created_at: string; + /** + * @format uri + * @example "https://github.com/orgs/github/teams/justice-league/discussions/1" + */ + html_url: string; + /** @format date-time */ + last_edited_at: string | null; + /** @example "MDE0OlRlYW1EaXNjdXNzaW9uMQ==" */ + node_id: string; + /** + * The unique sequence number of a team discussion. + * @example 42 + */ + number: number; + /** + * Whether or not this discussion should be pinned for easy retrieval. + * @example true + */ + pinned: boolean; + /** + * Whether or not this discussion should be restricted to team members and organization administrators. + * @example true + */ + private: boolean; + reactions?: ReactionRollup; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027" + */ + team_url: string; + /** + * The title of the discussion. + * @example "How can we improve our workflow?" + */ + title: string; + /** + * @format date-time + * @example "2018-01-25T18:56:31Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2343027/discussions/1" + */ + url: string; +} - /** - * No description - * - * @tags gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} - */ - gistsGetRevision: ( - gistId: string, - sha: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/\${sha}\`, - method: "GET", - format: "json", - ...params, - }), - }; - gitignore = { - /** - * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). - * - * @tags gitignore - * @name GitignoreGetAllTemplates - * @summary Get all gitignore templates - * @request GET:/gitignore/templates - */ - gitignoreGetAllTemplates: (params: RequestParams = {}) => - this.request({ - path: \`/gitignore/templates\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Team Discussion Comment + * A reply to a discussion within a team. + */ +export interface TeamDiscussionComment { + author: SimpleUser | null; + /** + * The main text of the comment. + * @example "I agree with this suggestion." + */ + body: string; + /** @example "

Do you like apples?

" */ + body_html: string; + /** + * The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + * @example "0307116bbf7ced493b8d8a346c650b71" + */ + body_version: string; + /** + * @format date-time + * @example "2018-01-15T23:53:58Z" + */ + created_at: string; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2403582/discussions/1" + */ + discussion_url: string; + /** + * @format uri + * @example "https://github.com/orgs/github/teams/justice-league/discussions/1/comments/1" + */ + html_url: string; + /** @format date-time */ + last_edited_at: string | null; + /** @example "MDIxOlRlYW1EaXNjdXNzaW9uQ29tbWVudDE=" */ + node_id: string; + /** + * The unique sequence number of a team discussion comment. + * @example 42 + */ + number: number; + reactions?: ReactionRollup; + /** + * @format date-time + * @example "2018-01-15T23:53:58Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1" + */ + url: string; +} - /** - * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. - * - * @tags gitignore - * @name GitignoreGetTemplate - * @summary Get a gitignore template - * @request GET:/gitignore/templates/{name} - */ - gitignoreGetTemplate: (name: string, params: RequestParams = {}) => - this.request({ - path: \`/gitignore/templates/\${name}\`, - method: "GET", - format: "json", - ...params, - }), - }; - installation = { - /** - * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsListReposAccessibleToInstallation - * @summary List repositories accessible to the app installation - * @request GET:/installation/repositories - */ - appsListReposAccessibleToInstallation: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - repositories: Repository[]; - /** @example "selected" */ - repository_selection?: string; - total_count: number; - }, - BasicError - >({ - path: \`/installation/repositories\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Full Team + * Groups of organization members that gives permissions on specified repositories. + */ +export interface TeamFull { + /** + * @format date-time + * @example "2017-07-14T16:53:42Z" + */ + created_at: string; + /** @example "A great team." */ + description: string | null; + /** + * @format uri + * @example "https://github.com/orgs/rails/teams/core" + */ + html_url: string; + /** + * Unique identifier of the team + * @example 42 + */ + id: number; + /** + * Distinguished Name (DN) that team maps to within LDAP environment + * @example "uid=example,ou=users,dc=github,dc=com" + */ + ldap_dn?: string; + /** @example 3 */ + members_count: number; + /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ + members_url: string; + /** + * Name of the team + * @example "Developers" + */ + name: string; + /** @example "MDQ6VGVhbTE=" */ + node_id: string; + /** Organization Full */ + organization: OrganizationFull; + parent?: TeamSimple | null; + /** + * Permission that the team will have for its repositories + * @example "push" + */ + permission: string; + /** + * The level of privacy this team should have + * @example "closed" + */ + privacy?: "closed" | "secret"; + /** @example 10 */ + repos_count: number; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/1/repos" + */ + repositories_url: string; + /** @example "justice-league" */ + slug: string; + /** + * @format date-time + * @example "2017-08-17T12:37:15Z" + */ + updated_at: string; + /** + * URL for the team + * @format uri + * @example "https://api.github.com/organizations/1/team/1" + */ + url: string; +} - /** - * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. - * - * @tags apps - * @name AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token - */ - appsRevokeInstallationAccessToken: (params: RequestParams = {}) => - this.request({ - path: \`/installation/token\`, - method: "DELETE", - ...params, - }), +/** + * Team Membership + * Team Membership + */ +export interface TeamMembership { + /** + * The role of the user in the team. + * @default "member" + * @example "member" + */ + role: "member" | "maintainer"; + state: string; + /** @format uri */ + url: string; +} + +/** + * Team Project + * A team's access to a project. + */ +export interface TeamProject { + body: string | null; + columns_url: string; + created_at: string; + /** Simple User */ + creator: SimpleUser; + html_url: string; + id: number; + name: string; + node_id: string; + number: number; + /** The organization permission for this project. Only present when owner is an organization. */ + organization_permission?: string; + owner_url: string; + permissions: { + admin: boolean; + read: boolean; + write: boolean; }; - issues = { - /** - * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. - * - * @tags issues - * @name IssuesList - * @summary List issues assigned to the authenticated user - * @request GET:/issues - */ - issuesList: ( - query?: { - collab?: boolean; - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - orgs?: boolean; - owned?: boolean; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - pulls?: boolean; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: "created" | "updated" | "comments"; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/issues\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** Whether the project is private or not. Only present when owner is an organization. */ + private?: boolean; + state: string; + updated_at: string; + url: string; +} + +/** + * Team Repository + * A team's access to a repository. + */ +export interface TeamRepository { + /** + * Whether to allow merge commits for pull requests. + * @default true + * @example true + */ + allow_merge_commit?: boolean; + /** + * Whether to allow rebase merges for pull requests. + * @default true + * @example true + */ + allow_rebase_merge?: boolean; + /** + * Whether to allow squash merges for pull requests. + * @default true + * @example true + */ + allow_squash_merge?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" */ + archive_url: string; + /** + * Whether the repository is archived. + * @default false + */ + archived: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" */ + assignees_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" */ + blobs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" */ + branches_url: string; + /** @example "https://github.com/octocat/Hello-World.git" */ + clone_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" */ + collaborators_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/comments{/number}" */ + comments_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" */ + commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" */ + compare_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" */ + contents_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" + */ + contributors_url: string; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + created_at: string | null; + /** + * The default branch of the repository. + * @example "master" + */ + default_branch: string; + /** + * Whether to delete head branches when pull requests are merged + * @default false + * @example false + */ + delete_branch_on_merge?: boolean; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" + */ + deployments_url: string; + /** @example "This your first repo!" */ + description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" + */ + downloads_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" + */ + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" + */ + forks_url: string; + /** @example "octocat/Hello-World" */ + full_name: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" */ + git_commits_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" */ + git_refs_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" */ + git_tags_url: string; + /** @example "git:github.com/octocat/Hello-World.git" */ + git_url: string; + /** + * Whether downloads are enabled. + * @default true + * @example true + */ + has_downloads: boolean; + /** + * Whether issues are enabled. + * @default true + * @example true + */ + has_issues: boolean; + has_pages: boolean; + /** + * Whether projects are enabled. + * @default true + * @example true + */ + has_projects: boolean; + /** + * Whether the wiki is enabled. + * @default true + * @example true + */ + has_wiki: boolean; + /** + * @format uri + * @example "https://github.com" + */ + homepage: string | null; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + */ + hooks_url: string; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World" + */ + html_url: string; + /** + * Unique identifier of the repository + * @example 42 + */ + id: number; + /** + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true + */ + is_template?: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" */ + issue_comment_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" */ + issue_events_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/issues{/number}" */ + issues_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" */ + keys_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/labels{/name}" */ + labels_url: string; + language: string | null; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/languages" + */ + languages_url: string; + license: LicenseSimple | null; + master_branch?: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/merges" + */ + merges_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ + milestones_url: string; + /** + * @format uri + * @example "git:git.example.com/octocat/Hello-World" + */ + mirror_url: string | null; + /** + * The name of the repository. + * @example "Team Environment" + */ + name: string; + network_count?: number; + /** @example "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" */ + node_id: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" */ + notifications_url: string; + open_issues: number; + /** @example 0 */ + open_issues_count: number; + owner: SimpleUser | null; + permissions?: { + admin: boolean; + maintain?: boolean; + pull: boolean; + push: boolean; + triage?: boolean; }; - licenses = { - /** - * No description - * - * @tags licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses - */ - licensesGetAllCommonlyUsed: ( - query?: { - featured?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/licenses\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + /** + * Whether the repository is private or public. + * @default false + */ + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; + /** + * @format date-time + * @example "2011-01-26T19:06:43Z" + */ + pushed_at: string | null; + /** @example "http://api.github.com/repos/octocat/Hello-World/releases{/id}" */ + releases_url: string; + /** @example 108 */ + size: number; + /** @example "git@github.com:octocat/Hello-World.git" */ + ssh_url: string; + /** @example 80 */ + stargazers_count: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + */ + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + */ + subscribers_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + */ + subscription_url: string; + /** + * @format uri + * @example "https://svn.github.com/octocat/Hello-World" + */ + svn_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/tags" + */ + tags_url: string; + /** + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/teams" + */ + teams_url: string; + temp_clone_token?: string; + template_repository?: Repository | null; + topics?: string[]; + /** @example "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" */ + trees_url: string; + /** + * @format date-time + * @example "2011-01-26T19:14:43Z" + */ + updated_at: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World" + */ + url: string; + /** + * The repository visibility: public, private, or internal. + * @default "public" + */ + visibility?: string; + watchers: number; + /** @example 80 */ + watchers_count: number; +} + +/** + * Team Simple + * Groups of organization members that gives permissions on specified repositories. + */ +export type TeamSimple = { + /** + * Description of the team + * @example "A great team." + */ + description: string | null; + /** + * @format uri + * @example "https://github.com/orgs/rails/teams/core" + */ + html_url: string; + /** + * Unique identifier of the team + * @example 1 + */ + id: number; + /** + * Distinguished Name (DN) that team maps to within LDAP environment + * @example "uid=example,ou=users,dc=github,dc=com" + */ + ldap_dn?: string; + /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ + members_url: string; + /** + * Name of the team + * @example "Justice League" + */ + name: string; + /** @example "MDQ6VGVhbTE=" */ + node_id: string; + /** + * Permission that the team will have for its repositories + * @example "admin" + */ + permission: string; + /** + * The level of privacy this team should have + * @example "closed" + */ + privacy?: string; + /** + * @format uri + * @example "https://api.github.com/organizations/1/team/1/repos" + */ + repositories_url: string; + /** @example "justice-league" */ + slug: string; + /** + * URL for the team + * @format uri + * @example "https://api.github.com/organizations/1/team/1" + */ + url: string; +} | null; - /** - * No description - * - * @tags licenses - * @name LicensesGet - * @summary Get a license - * @request GET:/licenses/{license} - */ - licensesGet: (license: string, params: RequestParams = {}) => - this.request({ - path: \`/licenses/\${license}\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Thread + * Thread + */ +export interface Thread { + id: string; + last_read_at: string | null; + reason: string; + /** Minimal Repository */ + repository: MinimalRepository; + subject: { + latest_comment_url: string; + title: string; + type: string; + url: string; }; - markdown = { - /** - * No description - * - * @tags markdown - * @name MarkdownRender - * @summary Render a Markdown document - * @request POST:/markdown - */ - markdownRender: ( - data: { - /** The repository context to use when creating references in \`gfm\` mode. */ - context?: string; - /** - * The rendering mode. - * @default "markdown" - * @example "markdown" - */ - mode?: "markdown" | "gfm"; - /** The Markdown text to render in HTML. */ - text: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/markdown\`, - method: "POST", - body: data, - type: ContentType.Json, - ...params, - }), + /** @example "https://api.github.com/notifications/threads/2/subscription" */ + subscription_url: string; + unread: boolean; + updated_at: string; + url: string; +} + +/** + * Thread Subscription + * Thread Subscription + */ +export interface ThreadSubscription { + /** + * @format date-time + * @example "2012-10-06T21:34:12Z" + */ + created_at: string | null; + ignored: boolean; + reason: string | null; + /** + * @format uri + * @example "https://api.github.com/repos/1" + */ + repository_url?: string; + /** @example true */ + subscribed: boolean; + /** + * @format uri + * @example "https://api.github.com/notifications/threads/1" + */ + thread_url?: string; + /** + * @format uri + * @example "https://api.github.com/notifications/threads/1/subscription" + */ + url: string; +} + +/** + * Topic + * A topic aggregates entities that are related to a subject. + */ +export interface Topic { + names: string[]; +} + +/** + * Topic Search Result Item + * Topic Search Result Item + */ +export interface TopicSearchResultItem { + aliases?: + | { + topic_relation?: { + id?: number; + name?: string; + relation_type?: string; + topic_id?: number; + }; + }[] + | null; + /** @format date-time */ + created_at: string; + created_by: string | null; + curated: boolean; + description: string | null; + display_name: string | null; + featured: boolean; + /** @format uri */ + logo_url?: string | null; + name: string; + related?: + | { + topic_relation?: { + id?: number; + name?: string; + relation_type?: string; + topic_id?: number; + }; + }[] + | null; + released: string | null; + repository_count?: number | null; + score: number; + short_description: string | null; + text_matches?: SearchResultTextMatches; + /** @format date-time */ + updated_at: string; +} + +/** Traffic */ +export interface Traffic { + count: number; + /** @format date-time */ + timestamp: string; + uniques: number; +} + +/** + * User Marketplace Purchase + * User Marketplace Purchase + */ +export interface UserMarketplacePurchase { + account: MarketplaceAccount; + /** @example "monthly" */ + billing_cycle: string; + /** + * @format date-time + * @example "2017-11-11T00:00:00Z" + */ + free_trial_ends_on: string | null; + /** + * @format date-time + * @example "2017-11-11T00:00:00Z" + */ + next_billing_date: string | null; + /** @example true */ + on_free_trial: boolean; + /** Marketplace Listing Plan */ + plan: MarketplaceListingPlan; + unit_count: number | null; + /** + * @format date-time + * @example "2017-11-02T01:12:12Z" + */ + updated_at: string | null; +} + +/** + * User Search Result Item + * User Search Result Item + */ +export interface UserSearchResultItem { + /** @format uri */ + avatar_url: string; + bio?: string | null; + blog?: string | null; + company?: string | null; + /** @format date-time */ + created_at?: string; + /** @format email */ + email?: string | null; + events_url: string; + followers?: number; + /** @format uri */ + followers_url: string; + following?: number; + following_url: string; + gists_url: string; + gravatar_id: string | null; + hireable?: boolean | null; + /** @format uri */ + html_url: string; + id: number; + location?: string | null; + login: string; + name?: string | null; + node_id: string; + /** @format uri */ + organizations_url: string; + public_gists?: number; + public_repos?: number; + /** @format uri */ + received_events_url: string; + /** @format uri */ + repos_url: string; + score: number; + site_admin: boolean; + starred_url: string; + /** @format uri */ + subscriptions_url: string; + /** @format date-time */ + suspended_at?: string | null; + text_matches?: SearchResultTextMatches; + type: string; + /** @format date-time */ + updated_at?: string; + /** @format uri */ + url: string; +} + +/** + * Validation Error + * Validation Error + */ +export interface ValidationError { + documentation_url: string; + errors?: { + code: string; + field?: string; + index?: number; + message?: string; + resource?: string; + value?: string | null | number | null | string[] | null; + }[]; + message: string; +} - /** - * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. - * - * @tags markdown - * @name MarkdownRenderRaw - * @summary Render a Markdown document in raw mode - * @request POST:/markdown/raw - */ - markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) => - this.request({ - path: \`/markdown/raw\`, - method: "POST", - body: data, - type: ContentType.Text, - ...params, - }), - }; - marketplaceListing = { - /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} - */ - appsGetSubscriptionPlanForAccount: ( - accountId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/accounts/\${accountId}\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Validation Error Simple + * Validation Error Simple + */ +export interface ValidationErrorSimple { + documentation_url: string; + errors?: string[]; + message: string; +} - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListPlans - * @summary List plans - * @request GET:/marketplace_listing/plans - */ - appsListPlans: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/plans\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** Verification */ +export interface Verification { + payload: string | null; + reason: string; + signature: string | null; + verified: boolean; +} - /** - * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts - */ - appsListAccountsForPlan: ( - planId: number, - query?: { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * View Traffic + * View Traffic + */ +export interface ViewTraffic { + /** @example 14850 */ + count: number; + /** @example 3782 */ + uniques: number; + views: Traffic[]; +} - /** - * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} - */ - appsGetSubscriptionPlanForAccountStubbed: ( - accountId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, - method: "GET", - format: "json", - ...params, - }), +/** + * Webhook Configuration + * Configuration object of the webhook + */ +export interface WebhookConfig { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; +} - /** - * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListPlansStubbed - * @summary List plans (stubbed) - * @request GET:/marketplace_listing/stubbed/plans - */ - appsListPlansStubbed: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. + * @example ""json"" + */ +export type WebhookConfigContentType = string; + +/** + * Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** + * @example ""0"" + */ +export type WebhookConfigInsecureSsl = string; + +/** + * If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + * @example ""********"" + */ +export type WebhookConfigSecret = string; + +/** + * The URL to which the payloads will be delivered. + * @format uri + * @example "https://example.com/webhook" + */ +export type WebhookConfigUrl = string; + +/** + * Workflow + * A GitHub Actions workflow + */ +export interface Workflow { + /** @example "https://github.com/actions/setup-ruby/workflows/CI/badge.svg" */ + badge_url: string; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + created_at: string; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + deleted_at?: string; + /** @example "https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml" */ + html_url: string; + /** @example 5 */ + id: number; + /** @example "CI" */ + name: string; + /** @example "MDg6V29ya2Zsb3cxMg==" */ + node_id: string; + /** @example "ruby.yaml" */ + path: string; + /** @example "active" */ + state: "active" | "deleted"; + /** + * @format date-time + * @example "2019-12-06T14:20:20.000Z" + */ + updated_at: string; + /** @example "https://api.github.com/repos/actions/setup-ruby/workflows/5" */ + url: string; +} - /** - * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. - * - * @tags apps - * @name AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts - */ - appsListAccountsForPlanStubbed: ( - planId: number, - query?: { - /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - meta = { - /** - * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. - * - * @tags meta - * @name MetaGet - * @summary Get GitHub meta information - * @request GET:/meta - */ - metaGet: (params: RequestParams = {}) => - this.request({ - path: \`/meta\`, - method: "GET", - format: "json", - ...params, - }), - }; - networks = { - /** - * No description - * - * @tags activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events - */ - activityListPublicEventsForRepoNetwork: ( - owner: string, - repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/networks/\${owner}/\${repo}/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - }; - notifications = { - /** - * @description List all notifications for the current user, sorted by most recently updated. - * - * @tags activity - * @name ActivityListNotificationsForAuthenticatedUser - * @summary List notifications for the authenticated user - * @request GET:/notifications - */ - activityListNotificationsForAuthenticatedUser: ( - query?: { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications\`, - method: "GET", - query: query, - format: "json", - ...params, - }), +/** + * Workflow Run + * An invocation of a workflow + */ +export interface WorkflowRun { + /** + * The URL to the artifacts for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" + */ + artifacts_url: string; + /** + * The URL to cancel the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/cancel" + */ + cancel_url: string; + /** + * The URL to the associated check suite. + * @example "https://api.github.com/repos/github/hello-world/check-suites/12" + */ + check_suite_url: string; + /** @example "neutral" */ + conclusion: string | null; + /** @format date-time */ + created_at: string; + /** @example "push" */ + event: string; + /** @example "master" */ + head_branch: string | null; + /** Simple Commit */ + head_commit: SimpleCommit; + /** Minimal Repository */ + head_repository: MinimalRepository; + /** @example 5 */ + head_repository_id?: number; + /** + * The SHA of the head commit that points to the version of the worflow being run. + * @example "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d" + */ + head_sha: string; + /** @example "https://github.com/github/hello-world/suites/4" */ + html_url: string; + /** + * The ID of the workflow run. + * @example 5 + */ + id: number; + /** + * The URL to the jobs for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/jobs" + */ + jobs_url: string; + /** + * The URL to download the logs for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/logs" + */ + logs_url: string; + /** + * The name of the workflow run. + * @example "Build" + */ + name?: string; + /** @example "MDEwOkNoZWNrU3VpdGU1" */ + node_id: string; + pull_requests: PullRequestMinimal[] | null; + /** Minimal Repository */ + repository: MinimalRepository; + /** + * The URL to rerun the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun" + */ + rerun_url: string; + /** + * The auto incrementing run number for the workflow run. + * @example 106 + */ + run_number: number; + /** @example "completed" */ + status: string | null; + /** @format date-time */ + updated_at: string; + /** + * The URL to the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5" + */ + url: string; + /** + * The ID of the parent workflow. + * @example 5 + */ + workflow_id: number; + /** + * The URL to the workflow. + * @example "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" + */ + workflow_url: string; +} + +/** + * Workflow Run Usage + * Workflow Run Usage + */ +export interface WorkflowRunUsage { + billable: { + MACOS?: { + jobs: number; + total_ms: number; + }; + UBUNTU?: { + jobs: number; + total_ms: number; + }; + WINDOWS?: { + jobs: number; + total_ms: number; + }; + }; + run_duration_ms: number; +} - /** - * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. - * - * @tags activity - * @name ActivityMarkNotificationsAsRead - * @summary Mark notifications as read - * @request PUT:/notifications - */ - activityMarkNotificationsAsRead: ( - data: { - /** - * Describes the last point that notifications were checked. - * @format date-time - */ - last_read_at?: string; - /** Whether the notification has been read. */ - read?: boolean; - }, - params: RequestParams = {}, - ) => - this.request< - { - message?: string; - }, - BasicError - >({ - path: \`/notifications\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +/** + * Workflow Usage + * Workflow Usage + */ +export interface WorkflowUsage { + billable: { + MACOS?: { + total_ms?: number; + }; + UBUNTU?: { + total_ms?: number; + }; + WINDOWS?: { + total_ms?: number; + }; + }; +} - /** - * No description - * - * @tags activity - * @name ActivityGetThread - * @summary Get a thread - * @request GET:/notifications/threads/{thread_id} - */ - activityGetThread: (threadId: number, params: RequestParams = {}) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, - method: "GET", - format: "json", - ...params, - }), +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; - /** - * No description - * - * @tags activity - * @name ActivityMarkThreadAsRead - * @summary Mark a thread as read - * @request PATCH:/notifications/threads/{thread_id} - */ - activityMarkThreadAsRead: (threadId: number, params: RequestParams = {}) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, - method: "PATCH", - ...params, - }), +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; +} - /** - * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. - * - * @tags activity - * @name ActivityGetThreadSubscriptionForAuthenticatedUser - * @summary Get a thread subscription for the authenticated user - * @request GET:/notifications/threads/{thread_id}/subscription - */ - activityGetThreadSubscriptionForAuthenticatedUser: ( - threadId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "GET", - format: "json", - ...params, - }), +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; - /** - * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. - * - * @tags activity - * @name ActivitySetThreadSubscription - * @summary Set a thread subscription - * @request PUT:/notifications/threads/{thread_id}/subscription - */ - activitySetThreadSubscription: ( - threadId: number, - data: { - /** - * Whether to block all notifications from a thread. - * @default false - */ - ignored?: boolean; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} - /** - * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. - * - * @tags activity - * @name ActivityDeleteThreadSubscription - * @summary Delete a thread subscription - * @request DELETE:/notifications/threads/{thread_id}/subscription - */ - activityDeleteThreadSubscription: ( - threadId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "DELETE", - ...params, - }), +export interface HttpResponse + extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + JsonApi = "application/vnd.api+json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +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", }; - octocat = { - /** - * @description Get the octocat as ASCII art - * - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat - */ - metaGetOctocat: ( - query?: { - /** The words to show in Octocat's speech bubble */ - s?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/octocat\`, - method: "GET", - query: query, - ...params, - }), + + 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.JsonApi]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") + ? JSON.stringify(input) + : input, + [ContentType.Text]: (input: any) => + input !== null && typeof input !== "string" + ? JSON.stringify(input) + : input, + [ContentType.FormData]: (input: any) => { + if (input instanceof FormData) { + return input; + } + + return 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), }; - organizations = { - /** - * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. - * - * @tags orgs - * @name OrgsList - * @summary List organizations - * @request GET:/organizations - */ - orgsList: ( - query?: { - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** An organization ID. Only return organizations with an ID greater than this ID. */ - since?: number; + + protected mergeRequestParams( + params1: RequestParams, + params2?: RequestParams, + ): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/organizations\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + }; + } + + 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; }; - orgs = { - /** - * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." - * - * @tags orgs - * @name OrgsGet - * @summary Get an organization - * @request GET:/orgs/{org} - */ - orgsGet: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}\`, - method: "GET", - format: "json", - ...params, - }), - /** - * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. - * - * @tags orgs - * @name OrgsUpdate - * @summary Update an organization - * @request PATCH:/orgs/{org} - */ - orgsUpdate: ( - org: string, - data: { - /** Billing email address. This address is not publicized. */ - billing_email?: string; - /** @example ""http://github.blog"" */ - blog?: string; - /** The company name. */ - company?: string; - /** - * Default permission level members have for organization repositories: - * \\* \`read\` - can pull, but not push to or administer this repository. - * \\* \`write\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push, and administer this repository. - * \\* \`none\` - no permissions granted by default. - * @default "read" - */ - default_repository_permission?: "read" | "write" | "admin" | "none"; - /** The description of the company. */ - description?: string; - /** The publicly visible email address. */ - email?: string; - /** Toggles whether an organization can use organization projects. */ - has_organization_projects?: boolean; - /** Toggles whether repositories that belong to the organization can use repository projects. */ - has_repository_projects?: boolean; - /** The location. */ - location?: string; - /** - * Specifies which types of repositories non-admin organization members can create. Can be one of: - * \\* \`all\` - all organization members can create public and private repositories. - * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - * \\* \`none\` - only admin members can create repositories. - * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. - */ - members_allowed_repository_creation_type?: "all" | "private" | "none"; - /** - * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: - * \\* \`true\` - all organization members can create internal repositories. - * \\* \`false\` - only organization owners can create internal repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - */ - members_can_create_internal_repositories?: boolean; - /** - * Toggles whether organization members can create GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create GitHub Pages sites. - * \\* \`false\` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. - * @default true - */ - members_can_create_pages?: boolean; - /** - * Toggles whether organization members can create private GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create private GitHub Pages sites. - * \\* \`false\` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - * @default true - */ - members_can_create_private_pages?: boolean; - /** - * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: - * \\* \`true\` - all organization members can create private repositories. - * \\* \`false\` - only organization owners can create private repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - */ - members_can_create_private_repositories?: boolean; - /** - * Toggles whether organization members can create public GitHub Pages sites. Can be one of: - * \\* \`true\` - all organization members can create public GitHub Pages sites. - * \\* \`false\` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - * @default true - */ - members_can_create_public_pages?: boolean; - /** - * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: - * \\* \`true\` - all organization members can create public repositories. - * \\* \`false\` - only organization owners can create public repositories. - * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - */ - members_can_create_public_repositories?: boolean; - /** - * Toggles the ability of non-admin organization members to create repositories. Can be one of: - * \\* \`true\` - all organization members can create repositories. - * \\* \`false\` - only organization owners can create repositories. - * Default: \`true\` - * **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. - * @default true - */ - members_can_create_repositories?: boolean; - /** The shorthand name of the company. */ - name?: string; - /** The Twitter username of the company. */ - twitter_username?: string; - }, - params: RequestParams = {}, - ) => - this.request< - OrganizationFull, - | BasicError - | { - documentation_url: string; - message: string; - } - | (ValidationError | ValidationErrorSimple) - >({ - path: \`/orgs/\${org}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); - /** - * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsGetGithubActionsPermissionsOrganization - * @summary Get GitHub Actions permissions for an organization - * @request GET:/orgs/{org}/actions/permissions - */ - actionsGetGithubActionsPermissionsOrganization: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "GET", - format: "json", - ...params, - }), + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; - /** - * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsSetGithubActionsPermissionsOrganization - * @summary Set GitHub Actions permissions for an organization - * @request PUT:/orgs/{org}/actions/permissions - */ - actionsSetGithubActionsPermissionsOrganization: ( - org: string, - data: { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ - enabled_repositories: EnabledRepositories; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + 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; - /** - * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization - * @summary List selected repositories enabled for GitHub Actions in an organization - * @request GET:/orgs/{org}/actions/permissions/repositories - */ - actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( - org: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - repositories: Repository[]; - total_count: number; + return this.customFetch( + \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, + { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData + ? { "Content-Type": type } + : {}), }, - any - >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization - * @summary Set selected repositories enabled for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories - */ - actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( - org: string, - data: { - /** List of repository IDs to enable for GitHub Actions. */ - selected_repository_ids: number[]; + signal: + (cancelToken + ? this.createAbortSignal(cancelToken) + : requestParams.signal) || null, + body: + typeof body === "undefined" || body === null + ? null + : payloadFormatter(body), }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, - ...params, - }), + ).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; - /** - * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. - * - * @tags actions - * @name ActionsEnableSelectedRepositoryGithubActionsOrganization - * @summary Enable a selected repository for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} - */ - actionsEnableSelectedRepositoryGithubActionsOrganization: ( - org: string, - repositoryId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "PUT", - ...params, - }), + const responseToParse = responseFormat ? response.clone() : response; + const data = !responseFormat + ? r + : await responseToParse[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 v3 REST API + * @version 1.1.4 + * @license MIT (https://spdx.org/licenses/MIT) + * @termsOfService https://docs.github.com/articles/github-terms-of-service + * @baseUrl https://api.github.com + * @externalDocs https://docs.github.com/rest/ + * @contact Support (https://support.github.com/contact) + * + * GitHub's v3 REST API. + */ +export class Api< + SecurityDataType extends unknown, +> extends HttpClient { + /** + * @description Get Hypermedia links to resources accessible in GitHub's REST API + * + * @tags meta + * @name MetaRoot + * @summary GitHub API Root + * @request GET:/ + */ + metaRoot = (params: RequestParams = {}) => + this.request< + { + /** @format uri */ + authorizations_url: string; + /** @format uri */ + code_search_url: string; + /** @format uri */ + commit_search_url: string; + /** @format uri */ + current_user_authorizations_html_url: string; + /** @format uri */ + current_user_repositories_url: string; + /** @format uri */ + current_user_url: string; + /** @format uri */ + emails_url: string; + /** @format uri */ + emojis_url: string; + /** @format uri */ + events_url: string; + /** @format uri */ + feeds_url: string; + /** @format uri */ + followers_url: string; + /** @format uri */ + following_url: string; + /** @format uri */ + gists_url: string; + /** @format uri */ + hub_url: string; + /** @format uri */ + issue_search_url: string; + /** @format uri */ + issues_url: string; + /** @format uri */ + keys_url: string; + /** @format uri */ + label_search_url: string; + /** @format uri */ + notifications_url: string; + /** @format uri */ + organization_repositories_url: string; + /** @format uri */ + organization_teams_url: string; + /** @format uri */ + organization_url: string; + /** @format uri */ + public_gists_url: string; + /** @format uri */ + rate_limit_url: string; + /** @format uri */ + repository_search_url: string; + /** @format uri */ + repository_url: string; + /** @format uri */ + starred_gists_url: string; + /** @format uri */ + starred_url: string; + /** @format uri */ + topic_search_url?: string; + /** @format uri */ + user_organizations_url: string; + /** @format uri */ + user_repositories_url: string; + /** @format uri */ + user_search_url: string; + /** @format uri */ + user_url: string; + }, + any + >({ + path: \`/\`, + method: "GET", + format: "json", + ...params, + }); + app = { /** - * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @description Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsDisableSelectedRepositoryGithubActionsOrganization - * @summary Disable a selected repository for GitHub Actions in an organization - * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} + * @tags apps + * @name AppsGetAuthenticated + * @summary Get the authenticated app + * @request GET:/app */ - actionsDisableSelectedRepositoryGithubActionsOrganization: ( - org: string, - repositoryId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "DELETE", + appsGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/app\`, + method: "GET", + format: "json", ...params, }), /** - * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @description Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsGetAllowedActionsOrganization - * @summary Get allowed actions for an organization - * @request GET:/orgs/{org}/actions/permissions/selected-actions + * @tags apps + * @name AppsGetWebhookConfigForApp + * @summary Get a webhook configuration for an app + * @request GET:/app/hook/config */ - actionsGetAllowedActionsOrganization: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + appsGetWebhookConfigForApp: (params: RequestParams = {}) => + this.request({ + path: \`/app/hook/config\`, method: "GET", format: "json", ...params, }), /** - * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * @description Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsSetAllowedActionsOrganization - * @summary Set allowed actions for an organization - * @request PUT:/orgs/{org}/actions/permissions/selected-actions + * @tags apps + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config */ - actionsSetAllowedActionsOrganization: ( - org: string, - data: SelectedActions, + appsUpdateWebhookConfigForApp: ( + data: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - method: "PUT", + this.request({ + path: \`/app/hook/config\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The permissions the installation has are included under the \`permissions\` key. * - * @tags actions - * @name ActionsListSelfHostedRunnerGroupsForOrg - * @summary List self-hosted runner groups for an organization - * @request GET:/orgs/{org}/actions/runner-groups + * @tags apps + * @name AppsListInstallations + * @summary List installations for the authenticated app + * @request GET:/app/installations */ - actionsListSelfHostedRunnerGroupsForOrg: ( - org: string, + appsListInstallations: ( query?: { + outdated?: string; /** * Page number of the results to fetch. * @default 1 @@ -20861,50 +18960,93 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => + this.request({ + path: \`/app/installations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (\`target_type\`) will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * @tags apps + * @name AppsGetInstallation + * @summary Get an installation for the authenticated app + * @request GET:/app/installations/{installation_id} + */ + appsGetInstallation: (installationId: number, params: RequestParams = {}) => this.request< - { - runner_groups: RunnerGroupsOrg[]; - total_count: number; - }, - any + Installation, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/orgs/\${org}/actions/runner-groups\`, + path: \`/app/installations/\${installationId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/v3/apps/#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsCreateSelfHostedRunnerGroupForOrg - * @summary Create a self-hosted runner group for an organization - * @request POST:/orgs/{org}/actions/runner-groups + * @tags apps + * @name AppsDeleteInstallation + * @summary Delete an installation for the authenticated app + * @request DELETE:/app/installations/{installation_id} */ - actionsCreateSelfHostedRunnerGroupForOrg: ( - org: string, + appsDeleteInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/app/installations/\${installationId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the \`repository_ids\` when creating the token. When you omit \`repository_ids\`, the response does not contain the \`repositories\` key. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * @tags apps + * @name AppsCreateInstallationAccessToken + * @summary Create an installation access token for an app + * @request POST:/app/installations/{installation_id}/access_tokens + */ + appsCreateInstallationAccessToken: ( + installationId: number, data: { - /** Name of the runner group. */ - name: string; - /** List of runner IDs to add to the runner group. */ - runners?: number[]; - /** List of repository IDs that can access the runner group. */ - selected_repository_ids?: number[]; + /** The permissions granted to the user-to-server access token. */ + permissions?: AppPermissions; + /** List of repository names that the token should have access to */ + repositories?: string[]; /** - * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. - * @default "all" + * List of repository IDs that the token should have access to + * @example [1] */ - visibility?: "selected" | "all" | "private"; + repository_ids?: number[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, + this.request< + InstallationToken, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/app/installations/\${installationId}/access_tokens\`, method: "POST", body: data, type: ContentType.Json, @@ -20913,855 +19055,939 @@ export class Api< }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsGetSelfHostedRunnerGroupForOrg - * @summary Get a self-hosted runner group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags apps + * @name AppsSuspendInstallation + * @summary Suspend an app installation + * @request PUT:/app/installations/{installation_id}/suspended */ - actionsGetSelfHostedRunnerGroupForOrg: ( - org: string, - runnerGroupId: number, + appsSuspendInstallation: ( + installationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "GET", + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, + method: "PUT", + ...params, + }), + + /** + * @description **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://docs.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * @tags apps + * @name AppsUnsuspendInstallation + * @summary Unsuspend an app installation + * @request DELETE:/app/installations/{installation_id}/suspended + */ + appsUnsuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, + method: "DELETE", + ...params, + }), + }; + appManifests = { + /** + * @description Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`. + * + * @tags apps + * @name AppsCreateFromManifest + * @summary Create a GitHub App from a manifest + * @request POST:/app-manifests/{code}/conversions + */ + appsCreateFromManifest: (code: string, params: RequestParams = {}) => + this.request< + Integration & { + client_id: string; + client_secret: string; + pem: string; + webhook_secret: string; + [key: string]: any; + }, + BasicError | ValidationErrorSimple + >({ + path: \`/app-manifests/\${code}/conversions\`, + method: "POST", format: "json", ...params, }), - + }; + applications = { /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The \`scopes\` returned are the union of scopes authorized for the application. For example, if an application has one token with \`repo\` scope and another token with \`user\` scope, the grant will return \`["repo", "user"]\`. * - * @tags actions - * @name ActionsUpdateSelfHostedRunnerGroupForOrg - * @summary Update a self-hosted runner group for an organization - * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsListGrants + * @summary List your grants + * @request GET:/applications/grants + * @deprecated */ - actionsUpdateSelfHostedRunnerGroupForOrg: ( - org: string, - runnerGroupId: number, - data: { - /** Name of the runner group. */ - name?: string; - /** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ - visibility?: "selected" | "all" | "private"; + oauthAuthorizationsListGrants: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/applications/grants\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerGroupFromOrg - * @summary Delete a self-hosted runner group from an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsGetGrant + * @summary Get a single grant + * @request GET:/applications/grants/{grant_id} + * @deprecated */ - actionsDeleteSelfHostedRunnerGroupFromOrg: ( - org: string, - runnerGroupId: number, + oauthAuthorizationsGetGrant: ( + grantId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "DELETE", + this.request({ + path: \`/applications/grants/\${grantId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). * - * @tags actions - * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg - * @summary List repository access to a self-hosted runner group in an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteGrant + * @summary Delete a grant + * @request DELETE:/applications/grants/{grant_id} + * @deprecated */ - actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, + oauthAuthorizationsDeleteGrant: ( + grantId: number, params: RequestParams = {}, ) => - this.request< - { - repositories: Repository[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "GET", - format: "json", + this.request({ + path: \`/applications/grants/\${grantId}\`, + method: "DELETE", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). * - * @tags actions - * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Set repository access for a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories + * @tags apps + * @name AppsDeleteAuthorization + * @summary Delete an app authorization + * @request DELETE:/applications/{client_id}/grant */ - actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, + appsDeleteAuthorization: ( + clientId: string, data: { - /** List of repository IDs that can access the runner group. */ - selected_repository_ids: number[]; + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "PUT", + this.request({ + path: \`/applications/\${clientId}/grant\`, + method: "DELETE", body: data, type: ContentType.Json, ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Add repository access to a self-hosted runner group in an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} - */ - actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, - repositoryId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "PUT", - ...params, - }), - - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. You must also provide a valid token as \`:access_token\` and the grant for the token's owner will be deleted. Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). * - * @tags actions - * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg - * @summary Remove repository access to a self-hosted runner group in an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} + * @tags apps + * @name AppsRevokeGrantForApplication + * @summary Revoke a grant for an application + * @request DELETE:/applications/{client_id}/grants/{access_token} + * @deprecated */ - actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, - repositoryId: number, + appsRevokeGrantForApplication: ( + clientId: string, + accessToken: string, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + path: \`/applications/\${clientId}/grants/\${accessToken}\`, method: "DELETE", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application \`client_id\` and the password is its \`client_secret\`. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags actions - * @name ActionsListSelfHostedRunnersInGroupForOrg - * @summary List self-hosted runners in a group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners + * @tags apps + * @name AppsCheckToken + * @summary Check a token + * @request POST:/applications/{client_id}/token */ - actionsListSelfHostedRunnersInGroupForOrg: ( - org: string, - runnerGroupId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + appsCheckToken: ( + clientId: string, + data: { + /** The access_token of the OAuth application. */ + access_token: string; }, params: RequestParams = {}, ) => - this.request< - { - runners: Runner[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags actions - * @name ActionsSetSelfHostedRunnersInGroupForOrg - * @summary Set self-hosted runners in a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners + * @tags apps + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - actionsSetSelfHostedRunnersInGroupForOrg: ( - org: string, - runnerGroupId: number, + appsResetToken: ( + clientId: string, data: { - /** List of runner IDs to add to the runner group. */ - runners: number[]; + /** The access_token of the OAuth application. */ + access_token: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. - * - * @tags actions - * @name ActionsAddSelfHostedRunnerToGroupForOrg - * @summary Add a self-hosted runner to a group for an organization - * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} - */ - actionsAddSelfHostedRunnerToGroupForOrg: ( - org: string, - runnerGroupId: number, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "PUT", - ...params, - }), - - /** - * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. * - * @tags actions - * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg - * @summary Remove a self-hosted runner from a group for an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + * @tags apps + * @name AppsDeleteToken + * @summary Delete an app token + * @request DELETE:/applications/{client_id}/token */ - actionsRemoveSelfHostedRunnerFromGroupForOrg: ( - org: string, - runnerGroupId: number, - runnerId: number, + appsDeleteToken: ( + clientId: string, + data: { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + this.request({ + path: \`/applications/\${clientId}/token\`, method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description Exchanges a non-repository scoped user-to-server OAuth access token for a repository scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags actions - * @name ActionsListSelfHostedRunnersForOrg - * @summary List self-hosted runners for an organization - * @request GET:/orgs/{org}/actions/runners + * @tags apps + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - actionsListSelfHostedRunnersForOrg: ( - org: string, - query?: { + appsScopeToken: ( + clientId: string, + data: { /** - * Page number of the results to fetch. - * @default 1 + * **Required.** The OAuth access token used to authenticate to the GitHub API. + * @example "e72e16c7e42f292c6912e7710c838347ae178b4a" */ - page?: number; + access_token?: string; + /** The permissions granted to the user-to-server access token. */ + permissions?: AppPermissions; + /** The list of repository IDs to scope the user-to-server access token to. \`repositories\` may not be specified if \`repository_ids\` is specified. */ + repositories?: string[]; /** - * Results per page (max 100) - * @default 30 + * The list of repository names to scope the user-to-server access token to. \`repository_ids\` may not be specified if \`repositories\` is specified. + * @example [1] */ - per_page?: number; + repository_ids?: number[]; + /** + * The name of the user or organization to scope the user-to-server access token to. **Required** unless \`target_id\` is specified. + * @example "octocat" + */ + target?: string; + /** + * The ID of the user or organization to scope the user-to-server access token to. **Required** unless \`target\` is specified. + * @example 1 + */ + target_id?: number; }, params: RequestParams = {}, ) => - this.request< - { - runners: Runner[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/runners\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/token/scoped\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags actions - * @name ActionsListRunnerApplicationsForOrg - * @summary List runner applications for an organization - * @request GET:/orgs/{org}/actions/runners/downloads + * @tags apps + * @name AppsCheckAuthorization + * @summary Check an authorization + * @request GET:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - actionsListRunnerApplicationsForOrg: ( - org: string, + appsCheckAuthorization: ( + clientId: string, + accessToken: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/downloads\`, + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "GET", format: "json", ...params, }), /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. Invalid tokens will return \`404 NOT FOUND\`. * - * @tags actions - * @name ActionsCreateRegistrationTokenForOrg - * @summary Create a registration token for an organization - * @request POST:/orgs/{org}/actions/runners/registration-token + * @tags apps + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - actionsCreateRegistrationTokenForOrg: ( - org: string, + appsResetAuthorization: ( + clientId: string, + accessToken: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/registration-token\`, + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "POST", format: "json", ...params, }), /** - * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @description **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain \`access_token\` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving \`access_token\` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's \`client_id\` and \`client_secret\` as the username and password. * - * @tags actions - * @name ActionsCreateRemoveTokenForOrg - * @summary Create a remove token for an organization - * @request POST:/orgs/{org}/actions/runners/remove-token + * @tags apps + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - actionsCreateRemoveTokenForOrg: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/actions/runners/remove-token\`, - method: "POST", + appsRevokeAuthorizationForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, + method: "DELETE", + ...params, + }), + }; + apps = { + /** + * @description **Note**: The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`). If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * + * @tags apps + * @name AppsGetBySlug + * @summary Get an app + * @request GET:/apps/{app_slug} + */ + appsGetBySlug: (appSlug: string, params: RequestParams = {}) => + this.request< + Integration, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/apps/\${appSlug}\`, + method: "GET", format: "json", ...params, }), - + }; + authorizations = { /** - * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags actions - * @name ActionsGetSelfHostedRunnerForOrg - * @summary Get a self-hosted runner for an organization - * @request GET:/orgs/{org}/actions/runners/{runner_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsListAuthorizations + * @summary List your authorizations + * @request GET:/authorizations + * @deprecated */ - actionsGetSelfHostedRunnerForOrg: ( - org: string, - runnerId: number, + oauthAuthorizationsListAuthorizations: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + this.request({ + path: \`/authorizations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use \`fingerprint\` to differentiate between them. You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromOrg - * @summary Delete a self-hosted runner from an organization - * @request DELETE:/orgs/{org}/actions/runners/{runner_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsCreateAuthorization + * @summary Create a new authorization + * @request POST:/authorizations + * @deprecated */ - actionsDeleteSelfHostedRunnerFromOrg: ( - org: string, - runnerId: number, + oauthAuthorizationsCreateAuthorization: ( + data: { + /** + * The OAuth app client key for which to create the token. + * @maxLength 20 + */ + client_id?: string; + /** + * The OAuth app client secret for which to create the token. + * @maxLength 40 + */ + client_secret?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, - method: "DELETE", + this.request({ + path: \`/authorizations\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags actions - * @name ActionsListOrgSecrets - * @summary List organization secrets - * @request GET:/orgs/{org}/actions/secrets + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForApp + * @summary Get-or-create an authorization for a specific app + * @request PUT:/authorizations/clients/{client_id} + * @deprecated */ - actionsListOrgSecrets: ( - org: string, - query?: { + oauthAuthorizationsGetOrCreateAuthorizationForApp: ( + clientId: string, + data: { /** - * Page number of the results to fetch. - * @default 1 + * The OAuth app client secret for which to create the token. + * @maxLength 40 */ - page?: number; + client_secret: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; /** - * Results per page (max 100) - * @default 30 + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - per_page?: number; + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; }, params: RequestParams = {}, ) => - this.request< - { - secrets: OrganizationActionsSecret[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/secrets\`, - method: "GET", - query: query, + this.request({ + path: \`/authorizations/clients/\${clientId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. \`fingerprint\` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." * - * @tags actions - * @name ActionsGetOrgPublicKey - * @summary Get an organization public key - * @request GET:/orgs/{org}/actions/secrets/public-key + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint + * @summary Get-or-create an authorization for a specific app and fingerprint + * @request PUT:/authorizations/clients/{client_id}/{fingerprint} + * @deprecated */ - actionsGetOrgPublicKey: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/public-key\`, - method: "GET", + oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( + clientId: string, + fingerprint: string, + data: { + /** + * The OAuth app client secret for which to create the token. + * @maxLength 40 + */ + client_secret: string; + /** + * A note to remind you what the OAuth token is for. + * @example "Update all gems" + */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags actions - * @name ActionsGetOrgSecret - * @summary Get an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name} + * @tags oauth-authorizations + * @name OauthAuthorizationsGetAuthorization + * @summary Get a single authorization + * @request GET:/authorizations/{authorization_id} + * @deprecated */ - actionsGetOrgSecret: ( - org: string, - secretName: string, + oauthAuthorizationsGetAuthorization: ( + authorizationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + this.request({ + path: \`/authorizations/\${authorizationId}\`, method: "GET", format: "json", ...params, }), /** - * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." You can only send one of these scope keys at a time. * - * @tags actions - * @name ActionsCreateOrUpdateOrgSecret - * @summary Create or update an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name} + * @tags oauth-authorizations + * @name OauthAuthorizationsUpdateAuthorization + * @summary Update an existing authorization + * @request PATCH:/authorizations/{authorization_id} + * @deprecated */ - actionsCreateOrUpdateOrgSecret: ( - org: string, - secretName: string, + oauthAuthorizationsUpdateAuthorization: ( + authorizationId: number, data: { - /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. */ - encrypted_value?: string; - /** ID of the key you used to encrypt the secret. */ - key_id?: string; - /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ - selected_repository_ids?: string[]; + /** A list of scopes to add to this authorization. */ + add_scopes?: string[]; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; /** - * Configures the access that repositories have to the organization secret. Can be one of: - * \\- \`all\` - All repositories in an organization can access the secret. - * \\- \`private\` - Private repositories in an organization can access the secret. - * \\- \`selected\` - Only specific repositories can access the secret. + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - visibility?: "all" | "private" | "selected"; + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** A list of scopes to remove from this authorization. */ + remove_scopes?: string[]; + /** + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] + */ + scopes?: string[] | null; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - method: "PUT", + this.request({ + path: \`/authorizations/\${authorizationId}\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). * - * @tags actions - * @name ActionsDeleteOrgSecret - * @summary Delete an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteAuthorization + * @summary Delete an authorization + * @request DELETE:/authorizations/{authorization_id} + * @deprecated */ - actionsDeleteOrgSecret: ( - org: string, - secretName: string, + oauthAuthorizationsDeleteAuthorization: ( + authorizationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + this.request({ + path: \`/authorizations/\${authorizationId}\`, method: "DELETE", ...params, }), + }; + codesOfConduct = { + /** + * No description + * + * @tags codes-of-conduct + * @name CodesOfConductGetAllCodesOfConduct + * @summary Get all codes of conduct + * @request GET:/codes_of_conduct + */ + codesOfConductGetAllCodesOfConduct: (params: RequestParams = {}) => + this.request< + CodeOfConduct[], + { + documentation_url: string; + message: string; + } + >({ + path: \`/codes_of_conduct\`, + method: "GET", + format: "json", + ...params, + }), /** - * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * No description * - * @tags actions - * @name ActionsListSelectedReposForOrgSecret - * @summary List selected repositories for an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - actionsListSelectedReposForOrgSecret: ( - org: string, - secretName: string, + codesOfConductGetConductCode: (key: string, params: RequestParams = {}) => + this.request< + CodeOfConduct, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/codes_of_conduct/\${key}\`, + method: "GET", + format: "json", + ...params, + }), + }; + contentReferences = { + /** + * @description Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the \`id\` of the content reference from the [\`content_reference\` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * + * @tags apps + * @name AppsCreateContentAttachment + * @summary Create a content attachment + * @request POST:/content_references/{content_reference_id}/attachments + */ + appsCreateContentAttachment: ( + contentReferenceId: number, + data: { + /** + * The body of the attachment + * @maxLength 262144 + * @example "Body of the attachment" + */ + body: string; + /** + * The title of the attachment + * @maxLength 1024 + * @example "Title of the attachment" + */ + title: string; + }, params: RequestParams = {}, ) => this.request< - { - repositories: MinimalRepository[]; - total_count: number; - }, - any + ContentReferenceAttachment, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "GET", + path: \`/content_references/\${contentReferenceId}/attachments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + emojis = { /** - * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description Lists all the emojis available to use on GitHub. * - * @tags actions - * @name ActionsSetSelectedReposForOrgSecret - * @summary Set selected repositories for an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - actionsSetSelectedReposForOrgSecret: ( - org: string, - secretName: string, - data: { - /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ - selected_repository_ids?: number[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, + emojisGet: (params: RequestParams = {}) => + this.request, any>({ + path: \`/emojis\`, + method: "GET", + format: "json", ...params, }), - + }; + enterprises = { /** - * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags actions - * @name ActionsAddSelectedRepoToOrgSecret - * @summary Add selected repository to an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags enterprise-admin + * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise + * @summary Get GitHub Actions permissions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions */ - actionsAddSelectedRepoToOrgSecret: ( - org: string, - secretName: string, - repositoryId: number, + enterpriseAdminGetGithubActionsPermissionsEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * @description Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags actions - * @name ActionsRemoveSelectedRepoFromOrgSecret - * @summary Remove selected repository from an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags enterprise-admin + * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise + * @summary Set GitHub Actions permissions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions */ - actionsRemoveSelectedRepoFromOrgSecret: ( - org: string, - secretName: string, - repositoryId: number, + enterpriseAdminSetGithubActionsPermissionsEnterprise: ( + enterprise: string, + data: { + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_organizations: EnabledOrganizations; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. + * @description Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsGetAuditLog - * @summary Get the audit log for an organization - * @request GET:/orgs/{org}/audit-log + * @tags enterprise-admin + * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary List selected organizations enabled for GitHub Actions in an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/organizations */ - orgsGetAuditLog: ( - org: string, + enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise: ( + enterprise: string, query?: { - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ - after?: string; - /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ - before?: string; - /** - * The event types to include: - * - * - \`web\` - returns web (non-Git) events - * - \`git\` - returns Git events - * - \`all\` - returns both web and Git events - * - * The default is \`web\`. - */ - include?: "web" | "git" | "all"; /** - * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. - * - * The default is \`desc\`. + * Page number of the results to fetch. + * @default 1 */ - order?: "desc" | "asc"; + page?: number; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ - phrase?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/audit-log\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description List the users blocked by an organization. - * - * @tags orgs - * @name OrgsListBlockedUsers - * @summary List users blocked by an organization - * @request GET:/orgs/{org}/blocks - */ - orgsListBlockedUsers: (org: string, params: RequestParams = {}) => this.request< - SimpleUser[], { - documentation_url: string; - message: string; - } + organizations: OrganizationSimple[]; + total_count: number; + }, + any >({ - path: \`/orgs/\${org}/blocks\`, + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description - * - * @tags orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} - */ - orgsCheckBlockedUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "GET", - ...params, - }), - - /** - * No description - * - * @tags orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} - */ - orgsBlockUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "PUT", - ...params, - }), - - /** - * No description + * @description Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} + * @tags enterprise-admin + * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary Set selected organizations enabled for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations */ - orgsUnblockUser: ( - org: string, - username: string, + enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( + enterprise: string, + data: { + /** List of organization IDs to enable for GitHub Actions. */ + selected_organization_ids: number[]; + }, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "DELETE", + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + * @description Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListSamlSsoAuthorizations - * @summary List SAML SSO authorizations for an organization - * @request GET:/orgs/{org}/credential-authorizations + * @tags enterprise-admin + * @name EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise + * @summary Enable a selected organization for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - orgsListSamlSsoAuthorizations: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations\`, - method: "GET", - format: "json", + enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( + enterprise: string, + orgId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. + * @description Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for \`enabled_organizations\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsRemoveSamlSsoAuthorization - * @summary Remove a SAML SSO authorization for an organization - * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} + * @tags enterprise-admin + * @name EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise + * @summary Disable a selected organization for GitHub Actions in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/permissions/organizations/{org_id} */ - orgsRemoveSamlSsoAuthorization: ( - org: string, - credentialId: number, + enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( + enterprise: string, + orgId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, method: "DELETE", ...params, }), /** - * No description + * @description Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags activity - * @name ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events + * @tags enterprise-admin + * @name EnterpriseAdminGetAllowedActionsEnterprise + * @summary Get allowed actions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions */ - activityListPublicOrgEvents: ( - org: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminGetAllowedActionsEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/events\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. + * @description Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListFailedInvitations - * @summary List failed organization invitations - * @request GET:/orgs/{org}/failed_invitations + * @tags enterprise-admin + * @name EnterpriseAdminSetAllowedActionsEnterprise + * @summary Set allowed actions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions */ - orgsListFailedInvitations: ( - org: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminSetAllowedActionsEnterprise: ( + enterprise: string, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/failed_invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @description Lists all self-hosted runner groups for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise + * @summary List self-hosted runner groups for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups */ - orgsListWebhooks: ( - org: string, + enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( + enterprise: string, query?: { /** * Page number of the results to fetch. @@ -21776,8 +20002,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, + this.request< + { + runner_groups: RunnerGroupsEnterprise[]; + total_count: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "GET", query: query, format: "json", @@ -21785,48 +20017,29 @@ export class Api< }), /** - * @description Here's how you can create a hook that posts payloads in JSON format: + * @description Creates a new self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsCreateWebhook - * @summary Create an organization webhook - * @request POST:/orgs/{org}/hooks + * @tags enterprise-admin + * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise + * @summary Create a self-hosted runner group for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runner-groups */ - orgsCreateWebhook: ( - org: string, + enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, data: { - /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true - */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""password"" */ - password?: string; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - /** @example ""kdaigle"" */ - username?: string; - }; - /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] - */ - events?: string[]; - /** Must be passed as "web". */ + /** Name of the runner group. */ name: string; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + /** List of organization IDs that can access the runner group. */ + selected_organization_ids?: number[]; + /** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: \`all\` or \`selected\` */ + visibility?: "selected" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "POST", body: data, type: ContentType.Json, @@ -21835,61 +20048,49 @@ export class Api< }), /** - * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." + * @description Gets a specific self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsGetWebhook - * @summary Get an organization webhook - * @request GET:/orgs/{org}/hooks/{hook_id} + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise + * @summary Get a self-hosted runner group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - orgsGetWebhook: (org: string, hookId: number, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, + enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", format: "json", ...params, }), /** - * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." + * @description Updates the \`name\` and \`visibility\` of a self-hosted runner group in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsUpdateWebhook - * @summary Update an organization webhook - * @request PATCH:/orgs/{org}/hooks/{hook_id} + * @tags enterprise-admin + * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise + * @summary Update a self-hosted runner group for an enterprise + * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - orgsUpdateWebhook: ( - org: string, - hookId: number, + enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, data: { + /** Name of the runner group. */ + name?: string; /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true - */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ - config?: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - }; - /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] + * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` + * @default "all" */ - events?: string[]; - /** @example ""web"" */ - name?: string; + visibility?: "selected" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -21898,121 +20099,139 @@ export class Api< }), /** - * No description + * @description Deletes a self-hosted runner group for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise + * @summary Delete a self-hosted runner group from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} */ - orgsDeleteWebhook: ( - org: string, - hookId: number, + enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( + enterprise: string, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", ...params, }), /** - * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. + * @description Lists the organizations with access to a self-hosted runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsGetWebhookConfigForOrg - * @summary Get a webhook configuration for an organization - * @request GET:/orgs/{org}/hooks/{hook_id}/config + * @tags enterprise-admin + * @name EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary List organization access to a self-hosted runner group in an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - orgsGetWebhookConfigForOrg: ( - org: string, - hookId: number, + enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + this.request< + { + organizations: OrganizationSimple[]; + total_count: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. + * @description Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsUpdateWebhookConfigForOrg - * @summary Update a webhook configuration for an organization - * @request PATCH:/orgs/{org}/hooks/{hook_id}/config + * @tags enterprise-admin + * @name EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Set organization access for a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations */ - orgsUpdateWebhookConfigForOrg: ( - org: string, - hookId: number, + enterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, data: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; + /** List of organization IDs that can access the runner group. */ + selected_organization_ids: number[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "PATCH", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @description Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsPingWebhook - * @summary Ping an organization webhook - * @request POST:/orgs/{org}/hooks/{hook_id}/pings + * @tags enterprise-admin + * @name EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Add organization access to a self-hosted runner group in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - orgsPingWebhook: ( - org: string, - hookId: number, + enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, + orgId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @description Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags apps - * @name AppsGetOrgInstallation - * @summary Get an organization installation for the authenticated app - * @request GET:/orgs/{org}/installation + * @tags enterprise-admin + * @name EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise + * @summary Remove organization access to a self-hosted runner group in an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id} */ - appsGetOrgInstallation: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/installation\`, - method: "GET", - format: "json", + enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, + orgId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "DELETE", ...params, }), /** - * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. + * @description Lists the self-hosted runners that are in a specific enterprise group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListAppInstallations - * @summary List app installations for an organization - * @request GET:/orgs/{org}/installations + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise + * @summary List self-hosted runners in a group for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - orgsListAppInstallations: ( - org: string, + enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, query?: { /** * Page number of the results to fetch. @@ -22029,12 +20248,12 @@ export class Api< ) => this.request< { - installations: Installation[]; + runners: Runner[]; total_count: number; }, any >({ - path: \`/orgs/\${org}/installations\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "GET", query: query, format: "json", @@ -22042,287 +20261,247 @@ export class Api< }), /** - * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. + * @description Replaces the list of self-hosted runners that are part of an enterprise runner group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags interactions - * @name InteractionsGetRestrictionsForOrg - * @summary Get interaction restrictions for an organization - * @request GET:/orgs/{org}/interaction-limits + * @tags enterprise-admin + * @name EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise + * @summary Set self-hosted runners in a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners */ - interactionsGetRestrictionsForOrg: ( - org: string, + enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + data: { + /** List of runner IDs to add to the runner group. */ + runners: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "GET", - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. + * @description Adds a self-hosted runner to a runner group configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags interactions - * @name InteractionsSetRestrictionsForOrg - * @summary Set interaction restrictions for an organization - * @request PUT:/orgs/{org}/interaction-limits + * @tags enterprise-admin + * @name EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise + * @summary Add a self-hosted runner to a group for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - interactionsSetRestrictionsForOrg: ( - org: string, - data: InteractionLimit, + enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "PUT", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. + * @description Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags interactions - * @name InteractionsRemoveRestrictionsForOrg - * @summary Remove interaction restrictions for an organization - * @request DELETE:/orgs/{org}/interaction-limits + * @tags enterprise-admin + * @name EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise + * @summary Remove a self-hosted runner from a group for an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - interactionsRemoveRestrictionsForOrg: ( - org: string, + enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/interaction-limits\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...params, }), /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * @description Lists all self-hosted runners configured for an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListPendingInvitations - * @summary List pending organization invitations - * @request GET:/orgs/{org}/invitations + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersForEnterprise + * @summary List self-hosted runners for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners + */ + enterpriseAdminListSelfHostedRunnersForEnterprise: ( + enterprise: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request< + { + runners?: Runner[]; + total_count?: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runners\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. + * + * @tags enterprise-admin + * @name EnterpriseAdminListRunnerApplicationsForEnterprise + * @summary List runner applications for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/downloads */ - orgsListPendingInvitations: ( - org: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminListRunnerApplicationsForEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/downloads\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN \`\`\` * - * @tags orgs - * @name OrgsCreateInvitation - * @summary Create an organization invitation - * @request POST:/orgs/{org}/invitations + * @tags enterprise-admin + * @name EnterpriseAdminCreateRegistrationTokenForEnterprise + * @summary Create a registration token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/registration-token */ - orgsCreateInvitation: ( - org: string, - data: { - /** **Required unless you provide \`invitee_id\`**. Email address of the person you are inviting, which can be an existing GitHub user. */ - email?: string; - /** **Required unless you provide \`email\`**. GitHub user ID for the person you are inviting. */ - invitee_id?: number; - /** - * Specify role for new member. Can be one of: - * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. - * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. - * @default "direct_member" - */ - role?: "admin" | "direct_member" | "billing_manager"; - /** Specify IDs for the teams you want to invite new members to. */ - team_ids?: number[]; - }, + enterpriseAdminCreateRegistrationTokenForEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, method: "POST", - body: data, - type: ContentType.Json, format: "json", ...params, }), /** - * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an enterprise. The token expires after one hour. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an enterprise, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * - * @tags orgs - * @name OrgsCancelInvitation - * @summary Cancel an organization invitation - * @request DELETE:/orgs/{org}/invitations/{invitation_id} + * @tags enterprise-admin + * @name EnterpriseAdminCreateRemoveTokenForEnterprise + * @summary Create a remove token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/remove-token */ - orgsCancelInvitation: ( - org: string, - invitationId: number, + enterpriseAdminCreateRemoveTokenForEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, + method: "POST", + format: "json", ...params, }), /** - * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + * @description Gets a specific self-hosted runner configured in an enterprise. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags orgs - * @name OrgsListInvitationTeams - * @summary List organization invitation teams - * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise + * @summary Get a self-hosted runner for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} */ - orgsListInvitationTeams: ( - org: string, - invitationId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminGetSelfHostedRunnerForEnterprise: ( + enterprise: string, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:enterprise\` scope to use this endpoint. * - * @tags issues - * @name IssuesListForOrg - * @summary List organization issues assigned to the authenticated user - * @request GET:/orgs/{org}/issues + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise + * @summary Delete a self-hosted runner from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} */ - issuesListForOrg: ( - org: string, - query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: "created" | "updated" | "comments"; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; - }, + enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( + enterprise: string, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/issues\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the \`admin:enterprise\` scope. * - * @tags orgs - * @name OrgsListMembers - * @summary List organization members - * @request GET:/orgs/{org}/members + * @tags audit-log + * @name AuditLogGetAuditLog + * @summary Get the audit log for an enterprise + * @request GET:/enterprises/{enterprise}/audit-log */ - orgsListMembers: ( - org: string, + auditLogGetAuditLog: ( + enterprise: string, query?: { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; /** - * Filter members returned in the list. Can be one of: - * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \\* \`all\` - All members the authenticated user can see. - * @default "all" + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. */ - filter?: "2fa_disabled" | "all"; + include?: "web" | "git" | "all"; /** - * Page number of the results to fetch. - * @default 1 + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. */ - page?: number; + order?: "desc" | "asc"; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** - * Filter members returned by their role. Can be one of: - * \\* \`all\` - All members of the organization, regardless of role. - * \\* \`admin\` - Organization owners. - * \\* \`member\` - Non-owner organization members. - * @default "all" - */ - role?: "all" | "admin" | "member"; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members\`, + this.request({ + path: \`/enterprises/\${enterprise}/audit-log\`, method: "GET", query: query, format: "json", @@ -22330,123 +20509,129 @@ export class Api< }), /** - * @description Check if a user is, publicly or privately, a member of the organization. + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsCheckMembershipForUser - * @summary Check organization membership for a user - * @request GET:/orgs/{org}/members/{username} + * @tags billing + * @name BillingGetGithubActionsBillingGhe + * @summary Get GitHub Actions billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/actions */ - orgsCheckMembershipForUser: ( - org: string, - username: string, + billingGetGithubActionsBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/actions\`, method: "GET", + format: "json", ...params, }), /** - * @description 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. + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsRemoveMember - * @summary Remove an organization member - * @request DELETE:/orgs/{org}/members/{username} + * @tags billing + * @name BillingGetGithubPackagesBillingGhe + * @summary Get GitHub Packages billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/packages */ - orgsRemoveMember: ( - org: string, - username: string, + billingGetGithubPackagesBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, - method: "DELETE", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/packages\`, + method: "GET", + format: "json", ...params, }), /** - * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." The authenticated user must be an enterprise admin. * - * @tags orgs - * @name OrgsGetMembershipForUser - * @summary Get organization membership for a user - * @request GET:/orgs/{org}/memberships/{username} + * @tags billing + * @name BillingGetSharedStorageBillingGhe + * @summary Get shared storage billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage */ - orgsGetMembershipForUser: ( - org: string, - username: string, + billingGetSharedStorageBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, method: "GET", format: "json", ...params, }), - + }; + events = { /** - * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + * @description We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. * - * @tags orgs - * @name OrgsSetMembershipForUser - * @summary Set organization membership for a user - * @request PUT:/orgs/{org}/memberships/{username} + * @tags activity + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - orgsSetMembershipForUser: ( - org: string, - username: string, - data: { + activityListPublicEvents: ( + query?: { /** - * The role to give the user in the organization. Can be one of: - * \\* \`admin\` - The user will become an owner of the organization. - * \\* \`member\` - The user will become a non-owner member of the organization. - * @default "member" + * Page number of the results to fetch. + * @default 1 */ - role?: "admin" | "member"; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request< + Event[], + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/events\`, + method: "GET", + query: query, format: "json", ...params, }), - + }; + feeds = { /** - * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + * @description GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. * - * @tags orgs - * @name OrgsRemoveMembershipForUser - * @summary Remove organization membership for a user - * @request DELETE:/orgs/{org}/memberships/{username} + * @tags activity + * @name ActivityGetFeeds + * @summary Get feeds + * @request GET:/feeds */ - orgsRemoveMembershipForUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "DELETE", + activityGetFeeds: (params: RequestParams = {}) => + this.request({ + path: \`/feeds\`, + method: "GET", + format: "json", ...params, }), - + }; + gists = { /** - * @description Lists the most recent migrations. + * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: * - * @tags migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * @tags gists + * @name GistsList + * @summary List gists for the authenticated user + * @request GET:/gists */ - migrationsListForOrg: ( - org: string, + gistsList: ( query?: { /** * Page number of the results to fetch. @@ -22458,11 +20643,13 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + this.request({ + path: \`/gists\`, method: "GET", query: query, format: "json", @@ -22470,34 +20657,38 @@ export class Api< }), /** - * @description Initiates the generation of a migration archive. + * @description Allows you to add a new gist with one or more files. **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. * - * @tags migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations + * @tags gists + * @name GistsCreate + * @summary Create a gist + * @request POST:/gists */ - migrationsStartForOrg: ( - org: string, + gistsCreate: ( data: { - exclude?: string[]; /** - * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). - * @default false + * Description of the gist + * @example "Example Ruby script" */ - exclude_attachments?: boolean; + description?: string; /** - * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. - * @default false + * Names and content for the files that make up the gist + * @example {"hello.rb":{"content":"puts \\"Hello, World!\\""}} */ - lock_repositories?: boolean; - /** A list of arrays indicating which repositories should be migrated. */ - repositories: string[]; + files: Record< + string, + { + /** Content of the file */ + content: string; + } + >; + /** Flag indicating whether the gist is public */ + public?: boolean | "true" | "false"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + this.request({ + path: \`/gists\`, method: "POST", body: data, type: ContentType.Json, @@ -22506,94 +20697,14 @@ export class Api< }), /** - * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. - * - * @tags migrations - * @name MigrationsGetStatusForOrg - * @summary Get an organization migration status - * @request GET:/orgs/{org}/migrations/{migration_id} - */ - migrationsGetStatusForOrg: ( - org: string, - migrationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Fetches the URL to a migration archive. - * - * @tags migrations - * @name MigrationsDownloadArchiveForOrg - * @summary Download an organization migration archive - * @request GET:/orgs/{org}/migrations/{migration_id}/archive - */ - migrationsDownloadArchiveForOrg: ( - org: string, - migrationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, - method: "GET", - ...params, - }), - - /** - * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. - * - * @tags migrations - * @name MigrationsDeleteArchiveForOrg - * @summary Delete an organization migration archive - * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive - */ - migrationsDeleteArchiveForOrg: ( - org: string, - migrationId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, - method: "DELETE", - ...params, - }), - - /** - * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. - * - * @tags migrations - * @name MigrationsUnlockRepoForOrg - * @summary Unlock an organization repository - * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock - */ - migrationsUnlockRepoForOrg: ( - org: string, - migrationId: number, - repoName: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", - ...params, - }), - - /** - * @description List all the repositories for this organization migration. + * @description List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. * - * @tags migrations - * @name MigrationsListReposForOrg - * @summary List repositories in an organization migration - * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + * @tags gists + * @name GistsListPublic + * @summary List public gists + * @request GET:/gists/public */ - migrationsListReposForOrg: ( - org: string, - migrationId: number, + gistsListPublic: ( query?: { /** * Page number of the results to fetch. @@ -22605,11 +20716,13 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/gists/public\`, method: "GET", query: query, format: "json", @@ -22617,23 +20730,15 @@ export class Api< }), /** - * @description List all users who are outside collaborators of an organization. + * @description List the authenticated user's starred gists: * - * @tags orgs - * @name OrgsListOutsideCollaborators - * @summary List outside collaborators for an organization - * @request GET:/orgs/{org}/outside_collaborators + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred */ - orgsListOutsideCollaborators: ( - org: string, + gistsListStarred: ( query?: { - /** - * Filter the list of outside collaborators. Can be one of: - * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \\* \`all\`: All outside collaborators. - * @default "all" - */ - filter?: "2fa_disabled" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -22644,11 +20749,13 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/outside_collaborators\`, + this.request({ + path: \`/gists/starred\`, method: "GET", query: query, format: "json", @@ -22656,66 +20763,100 @@ export class Api< }), /** - * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". + * No description * - * @tags orgs - * @name OrgsConvertMemberToOutsideCollaborator - * @summary Convert an organization member to outside collaborator - * @request PUT:/orgs/{org}/outside_collaborators/{username} + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - orgsConvertMemberToOutsideCollaborator: ( - org: string, - username: string, - params: RequestParams = {}, - ) => + gistsGet: (gistId: string, params: RequestParams = {}) => this.request< - void, + GistSimple, | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; documentation_url?: string; message?: string; } | BasicError >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "PUT", + path: \`/gists/\${gistId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removing a user from this list will remove them from all the organization's repositories. + * @description Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. * - * @tags orgs - * @name OrgsRemoveOutsideCollaborator - * @summary Remove outside collaborator from an organization - * @request DELETE:/orgs/{org}/outside_collaborators/{username} + * @tags gists + * @name GistsUpdate + * @summary Update a gist + * @request PATCH:/gists/{gist_id} */ - orgsRemoveOutsideCollaborator: ( - org: string, - username: string, + gistsUpdate: ( + gistId: string, + data: null & { + /** + * Description of the gist + * @example "Example Ruby script" + */ + description?: string; + /** + * Names of files to be updated + * @example {"hello.rb":{"content":"blah","filename":"goodbye.rb"}} + */ + files?: Record< + string, + (object | null) & + ({ + /** The new content of the file */ + content?: string; + /** The new filename for the file */ + filename?: string | null; + } | null) + >; + }, params: RequestParams = {}, ) => - this.request< - void, - { - documentation_url?: string; - message?: string; - } - >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + this.request({ + path: \`/gists/\${gistId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} + */ + gistsDelete: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}\`, method: "DELETE", ...params, }), /** - * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * No description * - * @tags projects - * @name ProjectsListForOrg - * @summary List organization projects - * @request GET:/orgs/{org}/projects + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - projectsListForOrg: ( - org: string, + gistsListComments: ( + gistId: string, query?: { /** * Page number of the results to fetch. @@ -22727,16 +20868,11 @@ export class Api< * @default 30 */ per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, + this.request({ + path: \`/gists/\${gistId}/comments\`, method: "GET", query: query, format: "json", @@ -22744,25 +20880,27 @@ export class Api< }), /** - * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * No description * - * @tags projects - * @name ProjectsCreateForOrg - * @summary Create an organization project - * @request POST:/orgs/{org}/projects + * @tags gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments */ - projectsCreateForOrg: ( - org: string, + gistsCreateComment: ( + gistId: string, data: { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; + /** + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" + */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, + this.request({ + path: \`/gists/\${gistId}/comments\`, method: "POST", body: data, type: ContentType.Json, @@ -22771,15 +20909,96 @@ export class Api< }), /** - * @description Members of an organization can choose to have their membership publicized or not. + * No description + * + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} + */ + gistsGetComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => + this.request< + GistComment, + | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; + } + | BasicError + >({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} + */ + gistsUpdateComment: ( + gistId: string, + commentId: number, + data: { + /** + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" + */ + body: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} + */ + gistsDeleteComment: ( + gistId: string, + commentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "DELETE", + ...params, + }), + + /** + * No description * - * @tags orgs - * @name OrgsListPublicMembers - * @summary List public organization members - * @request GET:/orgs/{org}/public_members + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - orgsListPublicMembers: ( - org: string, + gistsListCommits: ( + gistId: string, query?: { /** * Page number of the results to fetch. @@ -22794,8 +21013,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members\`, + this.request({ + path: \`/gists/\${gistId}/commits\`, method: "GET", query: query, format: "json", @@ -22805,265 +21024,159 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * @tags gists + * @name GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - orgsCheckPublicMembershipForUser: ( - org: string, - username: string, + gistsListForks: ( + gistId: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, + this.request({ + path: \`/gists/\${gistId}/forks\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description **Note**: This was previously \`/gists/:gist_id/fork\`. * - * @tags orgs - * @name OrgsSetPublicMembershipForAuthenticatedUser - * @summary Set public organization membership for the authenticated user - * @request PUT:/orgs/{org}/public_members/{username} + * @tags gists + * @name GistsFork + * @summary Fork a gist + * @request POST:/gists/{gist_id}/forks */ - orgsSetPublicMembershipForAuthenticatedUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "PUT", + gistsFork: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/forks\`, + method: "POST", + format: "json", ...params, }), /** * No description * - * @tags orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} + * @tags gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - orgsRemovePublicMembershipForAuthenticatedUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "DELETE", + gistsCheckIsStarred: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "GET", ...params, }), /** - * @description Lists repositories for the specified organization. + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @tags gists + * @name GistsStar + * @summary Star a gist + * @request PUT:/gists/{gist_id}/star */ - reposListForOrg: ( - org: string, - query?: { - /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ - type?: - | "all" - | "public" - | "private" - | "forks" - | "sources" - | "member" - | "internal"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/repos\`, - method: "GET", - query: query, - format: "json", + gistsStar: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "PUT", ...params, }), /** - * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * No description * - * @tags repos - * @name ReposCreateInOrg - * @summary Create an organization repository - * @request POST:/orgs/{org}/repos + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - reposCreateInOrg: ( - org: string, - data: { - /** - * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. - * @default true - */ - allow_merge_commit?: boolean; - /** - * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. - * @default true - */ - allow_rebase_merge?: boolean; - /** - * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. - * @default true - */ - allow_squash_merge?: boolean; - /** - * Pass \`true\` to create an initial commit with empty README. - * @default false - */ - auto_init?: boolean; - /** - * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. - * @default false - */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; - /** Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ - gitignore_template?: string; - /** - * Either \`true\` to enable issues for this repository or \`false\` to disable them. - * @default true - */ - has_issues?: boolean; - /** - * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. - * @default true - */ - has_projects?: boolean; - /** - * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. - * @default true - */ - has_wiki?: boolean; - /** A URL with more information about the repository. */ - homepage?: string; - /** - * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. - * @default false - */ - is_template?: boolean; - /** Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the \`license_template\` string. For example, "mit" or "mpl-2.0". */ - license_template?: string; - /** The name of the repository. */ - name: string; - /** - * Either \`true\` to create a private repository or \`false\` to create a public one. - * @default false - */ - private?: boolean; - /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ - team_id?: number; - /** - * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. - * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. - */ - visibility?: "public" | "private" | "visibility" | "internal"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/repos\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + gistsUnstar: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "DELETE", ...params, }), /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. + * No description * - * @tags billing - * @name BillingGetGithubActionsBillingOrg - * @summary Get GitHub Actions billing for an organization - * @request GET:/orgs/{org}/settings/billing/actions + * @tags gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - billingGetGithubActionsBillingOrg: ( - org: string, + gistsGetRevision: ( + gistId: string, + sha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/actions\`, + this.request({ + path: \`/gists/\${gistId}/\${sha}\`, method: "GET", format: "json", ...params, }), - + }; + gitignore = { /** - * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. + * @description List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). * - * @tags billing - * @name BillingGetGithubPackagesBillingOrg - * @summary Get GitHub Packages billing for an organization - * @request GET:/orgs/{org}/settings/billing/packages + * @tags gitignore + * @name GitignoreGetAllTemplates + * @summary Get all gitignore templates + * @request GET:/gitignore/templates */ - billingGetGithubPackagesBillingOrg: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/packages\`, + gitignoreGetAllTemplates: (params: RequestParams = {}) => + this.request({ + path: \`/gitignore/templates\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. + * @description The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. * - * @tags billing - * @name BillingGetSharedStorageBillingOrg - * @summary Get shared storage billing for an organization - * @request GET:/orgs/{org}/settings/billing/shared-storage + * @tags gitignore + * @name GitignoreGetTemplate + * @summary Get a gitignore template + * @request GET:/gitignore/templates/{name} */ - billingGetSharedStorageBillingOrg: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/shared-storage\`, + gitignoreGetTemplate: (name: string, params: RequestParams = {}) => + this.request({ + path: \`/gitignore/templates/\${name}\`, method: "GET", format: "json", ...params, }), - + }; + installation = { /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: + * @description List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags teams - * @name TeamsListIdpGroupsForOrg - * @summary List IdP groups for an organization - * @request GET:/orgs/{org}/team-sync/groups + * @tags apps + * @name AppsListReposAccessibleToInstallation + * @summary List repositories accessible to the app installation + * @request GET:/installation/repositories */ - teamsListIdpGroupsForOrg: ( - org: string, + appsListReposAccessibleToInstallation: ( query?: { /** * Page number of the results to fetch. @@ -23078,8 +21191,16 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/team-sync/groups\`, + this.request< + { + repositories: Repository[]; + /** @example "selected" */ + repository_selection?: string; + total_count: number; + }, + BasicError + >({ + path: \`/installation/repositories\`, method: "GET", query: query, format: "json", @@ -23087,16 +21208,51 @@ export class Api< }), /** - * @description Lists all teams in an organization that are visible to the authenticated user. + * @description Revokes the installation token you're using to authenticate as an installation and access this endpoint. Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. * - * @tags teams - * @name TeamsList - * @summary List teams - * @request GET:/orgs/{org}/teams + * @tags apps + * @name AppsRevokeInstallationAccessToken + * @summary Revoke an installation access token + * @request DELETE:/installation/token */ - teamsList: ( - org: string, + appsRevokeInstallationAccessToken: (params: RequestParams = {}) => + this.request({ + path: \`/installation/token\`, + method: "DELETE", + ...params, + }), + }; + issues = { + /** + * @description List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * + * @tags issues + * @name IssuesList + * @summary List issues assigned to the authenticated user + * @request GET:/issues + */ + issuesList: ( query?: { + collab?: boolean; + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + orgs?: boolean; + owned?: boolean; /** * Page number of the results to fetch. * @default 1 @@ -23107,172 +21263,153 @@ export class Api< * @default 30 */ per_page?: number; + pulls?: boolean; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: "created" | "updated" | "comments"; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, + this.request({ + path: \`/issues\`, method: "GET", query: query, format: "json", ...params, }), - + }; + licenses = { /** - * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + * No description * - * @tags teams - * @name TeamsCreate - * @summary Create a team - * @request POST:/orgs/{org}/teams + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - teamsCreate: ( - org: string, - data: { - /** The description of the team. */ - description?: string; - /** List GitHub IDs for organization members who will become team maintainers. */ - maintainers?: string[]; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number; - /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" - */ - permission?: "pull" | "push" | "admin"; + licensesGetAllCommonlyUsed: ( + query?: { + featured?: boolean; /** - * The level of privacy this team should have. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * Default: \`secret\` - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. - * Default for child team: \`closed\` + * Results per page (max 100) + * @default 30 */ - privacy?: "secret" | "closed"; - /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ - repo_names?: string[]; + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/licenses\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. + * No description * - * @tags teams - * @name TeamsGetByName - * @summary Get a team by name - * @request GET:/orgs/{org}/teams/{team_slug} + * @tags licenses + * @name LicensesGet + * @summary Get a license + * @request GET:/licenses/{license} */ - teamsGetByName: ( - org: string, - teamSlug: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, + licensesGet: (license: string, params: RequestParams = {}) => + this.request({ + path: \`/licenses/\${license}\`, method: "GET", format: "json", ...params, }), - + }; + markdown = { /** - * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. + * No description * - * @tags teams - * @name TeamsUpdateInOrg - * @summary Update a team - * @request PATCH:/orgs/{org}/teams/{team_slug} + * @tags markdown + * @name MarkdownRender + * @summary Render a Markdown document + * @request POST:/markdown */ - teamsUpdateInOrg: ( - org: string, - teamSlug: string, - data: { - /** The description of the team. */ - description?: string; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number; - /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" - */ - permission?: "pull" | "push" | "admin"; - /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. + markdownRender: ( + data: { + /** The repository context to use when creating references in \`gfm\` mode. */ + context?: string; + /** + * The rendering mode. + * @default "markdown" + * @example "markdown" */ - privacy?: "secret" | "closed"; + mode?: "markdown" | "gfm"; + /** The Markdown text to render in HTML. */ + text: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "PATCH", + this.request({ + path: \`/markdown\`, + method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. + * @description You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. * - * @tags teams - * @name TeamsDeleteInOrg - * @summary Delete a team - * @request DELETE:/orgs/{org}/teams/{team_slug} + * @tags markdown + * @name MarkdownRenderRaw + * @summary Render a Markdown document in raw mode + * @request POST:/markdown/raw */ - teamsDeleteInOrg: ( - org: string, - teamSlug: string, + markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) => + this.request({ + path: \`/markdown/raw\`, + method: "POST", + body: data, + type: ContentType.Text, + ...params, + }), + }; + marketplaceListing = { + /** + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + * + * @tags apps + * @name AppsGetSubscriptionPlanForAccount + * @summary Get a subscription plan for an account + * @request GET:/marketplace_listing/accounts/{account_id} + */ + appsGetSubscriptionPlanForAccount: ( + accountId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "DELETE", + this.request({ + path: \`/marketplace_listing/accounts/\${accountId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags teams - * @name TeamsListDiscussionsInOrg - * @summary List discussions - * @request GET:/orgs/{org}/teams/{team_slug}/discussions + * @tags apps + * @name AppsListPlans + * @summary List plans + * @request GET:/marketplace_listing/plans */ - teamsListDiscussionsInOrg: ( - org: string, - teamSlug: string, + appsListPlans: ( query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -23286,8 +21423,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, + this.request({ + path: \`/marketplace_listing/plans\`, method: "GET", query: query, format: "json", @@ -23295,126 +21432,73 @@ export class Api< }), /** - * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. + * @description Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags teams - * @name TeamsCreateDiscussionInOrg - * @summary Create a discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions + * @tags apps + * @name AppsListAccountsForPlan + * @summary List accounts for a plan + * @request GET:/marketplace_listing/plans/{plan_id}/accounts */ - teamsCreateDiscussionInOrg: ( - org: string, - teamSlug: string, - data: { - /** The discussion post's body text. */ - body: string; + appsListAccountsForPlan: ( + planId: number, + query?: { + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: "asc" | "desc"; /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. - * @default false + * Page number of the results to fetch. + * @default 1 */ - private?: boolean; - /** The discussion post's title. */ - title: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. - * - * @tags teams - * @name TeamsGetDiscussionInOrg - * @summary Get a discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - */ - teamsGetDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + this.request({ + path: \`/marketplace_listing/plans/\${planId}/accounts\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. + * @description Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags teams - * @name TeamsUpdateDiscussionInOrg - * @summary Update a discussion - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags apps + * @name AppsGetSubscriptionPlanForAccountStubbed + * @summary Get a subscription plan for an account (stubbed) + * @request GET:/marketplace_listing/stubbed/accounts/{account_id} */ - teamsUpdateDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - data: { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; - }, + appsGetSubscriptionPlanForAccountStubbed: ( + accountId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. - * - * @tags teams - * @name TeamsDeleteDiscussionInOrg - * @summary Delete a discussion - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} - */ - teamsDeleteDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "DELETE", - ...params, - }), - - /** - * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * @description Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags teams - * @name TeamsListDiscussionCommentsInOrg - * @summary List discussion comments - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags apps + * @name AppsListPlansStubbed + * @summary List plans (stubbed) + * @request GET:/marketplace_listing/stubbed/plans */ - teamsListDiscussionCommentsInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, + appsListPlansStubbed: ( query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -23428,8 +21512,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/marketplace_listing/stubbed/plans\`, method: "GET", query: query, format: "json", @@ -23437,142 +21521,135 @@ export class Api< }), /** - * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * @description Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. * - * @tags teams - * @name TeamsCreateDiscussionCommentInOrg - * @summary Create a discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags apps + * @name AppsListAccountsForPlanStubbed + * @summary List accounts for a plan (stubbed) + * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts */ - teamsCreateDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; + appsListAccountsForPlanStubbed: ( + planId: number, + query?: { + /** To return the oldest accounts first, set to \`asc\`. Can be one of \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, + method: "GET", + query: query, format: "json", ...params, }), - + }; + meta = { /** - * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * @description Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. * - * @tags teams - * @name TeamsGetDiscussionCommentInOrg - * @summary Get a discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags meta + * @name MetaGet + * @summary Get GitHub meta information + * @request GET:/meta */ - teamsGetDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + metaGet: (params: RequestParams = {}) => + this.request({ + path: \`/meta\`, method: "GET", format: "json", ...params, }), - + }; + networks = { /** - * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. + * No description * - * @tags teams - * @name TeamsUpdateDiscussionCommentInOrg - * @summary Update a discussion comment - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags activity + * @name ActivityListPublicEventsForRepoNetwork + * @summary List public events for a network of repositories + * @request GET:/networks/{owner}/{repo}/events */ - teamsUpdateDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; + activityListPublicEventsForRepoNetwork: ( + owner: string, + repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/networks/\${owner}/\${repo}/events\`, + method: "GET", + query: query, format: "json", ...params, }), - - /** - * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. - * - * @tags teams - * @name TeamsDeleteDiscussionCommentInOrg - * @summary Delete a discussion comment - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - */ - teamsDeleteDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", - ...params, - }), - + }; + notifications = { /** - * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. + * @description List all notifications for the current user, sorted by most recently updated. * - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentInOrg - * @summary List reactions for a team discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @tags activity + * @name ActivityListNotificationsForAuthenticatedUser + * @summary List notifications for the authenticated user + * @request GET:/notifications */ - reactionsListForTeamDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, + activityListNotificationsForAuthenticatedUser: ( query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * If \`true\`, show notifications marked as read. + * @default false + */ + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; /** * Results per page (max 100) * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request({ + path: \`/notifications\`, method: "GET", query: query, format: "json", @@ -23580,35 +21657,33 @@ export class Api< }), /** - * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. + * @description Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentInOrg - * @summary Create reaction for a team discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @tags activity + * @name ActivityMarkNotificationsAsRead + * @summary Mark notifications as read + * @request PUT:/notifications */ - reactionsCreateForTeamDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, + activityMarkNotificationsAsRead: ( data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * Describes the last point that notifications were checked. + * @format date-time + */ + last_read_at?: string; + /** Whether the notification has been read. */ + read?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", + this.request< + { + message?: string; + }, + BasicError + >({ + path: \`/notifications\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -23616,100 +21691,77 @@ export class Api< }), /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags reactions - * @name ReactionsDeleteForTeamDiscussionComment - * @summary Delete team discussion comment reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - reactionsDeleteForTeamDiscussionComment: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - reactionId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, - method: "DELETE", + activityGetThread: (threadId: number, params: RequestParams = {}) => + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "GET", + format: "json", ...params, - }), - - /** - * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. - * - * @tags reactions - * @name ReactionsListForTeamDiscussionInOrg - * @summary List reactions for a team discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions - */ - reactionsListForTeamDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + }), + + /** + * No description + * + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} + */ + activityMarkThreadAsRead: (threadId: number, params: RequestParams = {}) => + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "PATCH", + ...params, + }), + + /** + * @description This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. + * + * @tags activity + * @name ActivityGetThreadSubscriptionForAuthenticatedUser + * @summary Get a thread subscription for the authenticated user + * @request GET:/notifications/threads/{thread_id}/subscription + */ + activityGetThreadSubscriptionForAuthenticatedUser: ( + threadId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. + * @description If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionInOrg - * @summary Create reaction for a team discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags activity + * @name ActivitySetThreadSubscription + * @summary Set a thread subscription + * @request PUT:/notifications/threads/{thread_id}/subscription */ - reactionsCreateForTeamDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, + activitySetThreadSubscription: ( + threadId: number, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * Whether to block all notifications from a thread. + * @default false + */ + ignored?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, - method: "POST", + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -23717,269 +21769,250 @@ export class Api< }), /** - * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`. * - * @tags reactions - * @name ReactionsDeleteForTeamDiscussion - * @summary Delete team discussion reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} + * @tags activity + * @name ActivityDeleteThreadSubscription + * @summary Delete a thread subscription + * @request DELETE:/notifications/threads/{thread_id}/subscription */ - reactionsDeleteForTeamDiscussion: ( - org: string, - teamSlug: string, - discussionNumber: number, - reactionId: number, + activityDeleteThreadSubscription: ( + threadId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, method: "DELETE", ...params, }), - + }; + octocat = { /** - * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. + * @description Get the octocat as ASCII art * - * @tags teams - * @name TeamsListPendingInvitationsInOrg - * @summary List pending team invitations - * @request GET:/orgs/{org}/teams/{team_slug}/invitations + * @tags meta + * @name MetaGetOctocat + * @summary Get Octocat + * @request GET:/octocat */ - teamsListPendingInvitationsInOrg: ( - org: string, - teamSlug: string, + metaGetOctocat: ( query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** The words to show in Octocat's speech bubble */ + s?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + this.request({ + path: \`/octocat\`, method: "GET", query: query, - format: "json", ...params, }), - + }; + organizations = { /** - * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. + * @description Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. * - * @tags teams - * @name TeamsListMembersInOrg - * @summary List team members - * @request GET:/orgs/{org}/teams/{team_slug}/members + * @tags orgs + * @name OrgsList + * @summary List organizations + * @request GET:/organizations */ - teamsListMembersInOrg: ( - org: string, - teamSlug: string, + orgsList: ( query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ - role?: "member" | "maintainer" | "all"; + /** An organization ID. Only return organizations with an ID greater than this ID. */ + since?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, + this.request({ + path: \`/organizations\`, method: "GET", query: query, format: "json", ...params, }), - + }; + orgs = { /** - * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @description To see many of the organization response values, you need to be an authenticated organization owner with the \`admin:org\` scope. When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). GitHub Apps with the \`Organization plan\` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." * - * @tags teams - * @name TeamsGetMembershipForUserInOrg - * @summary Get team membership for a user - * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags orgs + * @name OrgsGet + * @summary Get an organization + * @request GET:/orgs/{org} */ - teamsGetMembershipForUserInOrg: ( - org: string, - teamSlug: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + orgsGet: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}\`, method: "GET", format: "json", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. + * @description **Parameter Deprecation Notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). Enables an authenticated organization owner with the \`admin:org\` scope to update the organization's profile and member privileges. * - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserInOrg - * @summary Add or update team membership for a user - * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags orgs + * @name OrgsUpdate + * @summary Update an organization + * @request PATCH:/orgs/{org} */ - teamsAddOrUpdateMembershipForUserInOrg: ( + orgsUpdate: ( org: string, - teamSlug: string, - username: string, data: { + /** Billing email address. This address is not publicized. */ + billing_email?: string; + /** @example ""http://github.blog"" */ + blog?: string; + /** The company name. */ + company?: string; + /** + * Default permission level members have for organization repositories: + * \\* \`read\` - can pull, but not push to or administer this repository. + * \\* \`write\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push, and administer this repository. + * \\* \`none\` - no permissions granted by default. + * @default "read" + */ + default_repository_permission?: "read" | "write" | "admin" | "none"; + /** The description of the company. */ + description?: string; + /** The publicly visible email address. */ + email?: string; + /** Toggles whether an organization can use organization projects. */ + has_organization_projects?: boolean; + /** Toggles whether repositories that belong to the organization can use repository projects. */ + has_repository_projects?: boolean; + /** The location. */ + location?: string; + /** + * Specifies which types of repositories non-admin organization members can create. Can be one of: + * \\* \`all\` - all organization members can create public and private repositories. + * \\* \`private\` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + * \\* \`none\` - only admin members can create repositories. + * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in \`members_can_create_repositories\`. See the parameter deprecation notice in the operation description for details. + */ + members_allowed_repository_creation_type?: "all" | "private" | "none"; + /** + * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: + * \\* \`true\` - all organization members can create internal repositories. + * \\* \`false\` - only organization owners can create internal repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + */ + members_can_create_internal_repositories?: boolean; + /** + * Toggles whether organization members can create GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create GitHub Pages sites. + * \\* \`false\` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. + * @default true + */ + members_can_create_pages?: boolean; + /** + * Toggles whether organization members can create private GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create private GitHub Pages sites. + * \\* \`false\` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + * @default true + */ + members_can_create_private_pages?: boolean; + /** + * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: + * \\* \`true\` - all organization members can create private repositories. + * \\* \`false\` - only organization owners can create private repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + */ + members_can_create_private_repositories?: boolean; /** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" + * Toggles whether organization members can create public GitHub Pages sites. Can be one of: + * \\* \`true\` - all organization members can create public GitHub Pages sites. + * \\* \`false\` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + * @default true */ - role?: "member" | "maintainer"; - }, - params: RequestParams = {}, - ) => - this.request< - TeamMembership, - void | { - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; - } - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. - * - * @tags teams - * @name TeamsRemoveMembershipForUserInOrg - * @summary Remove team membership for a user - * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} - */ - teamsRemoveMembershipForUserInOrg: ( - org: string, - teamSlug: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. - * - * @tags teams - * @name TeamsListProjectsInOrg - * @summary List team projects - * @request GET:/orgs/{org}/teams/{team_slug}/projects - */ - teamsListProjectsInOrg: ( - org: string, - teamSlug: string, - query?: { + members_can_create_public_pages?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: + * \\* \`true\` - all organization members can create public repositories. + * \\* \`false\` - only organization owners can create public repositories. + * Default: \`true\`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. */ - page?: number; + members_can_create_public_repositories?: boolean; /** - * Results per page (max 100) - * @default 30 + * Toggles the ability of non-admin organization members to create repositories. Can be one of: + * \\* \`true\` - all organization members can create repositories. + * \\* \`false\` - only organization owners can create repositories. + * Default: \`true\` + * **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. **Note:** A parameter can override this parameter. See \`members_allowed_repository_creation_type\` in this table for details. + * @default true */ - per_page?: number; + members_can_create_repositories?: boolean; + /** The shorthand name of the company. */ + name?: string; + /** The Twitter username of the company. */ + twitter_username?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, - method: "GET", - query: query, + this.request< + OrganizationFull, + | BasicError + | { + documentation_url: string; + message: string; + } + | (ValidationError | ValidationErrorSimple) + >({ + path: \`/orgs/\${org}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @description Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsCheckPermissionsForProjectInOrg - * @summary Check team permissions for a project - * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags actions + * @name ActionsGetGithubActionsPermissionsOrganization + * @summary Get GitHub Actions permissions for an organization + * @request GET:/orgs/{org}/actions/permissions */ - teamsCheckPermissionsForProjectInOrg: ( + actionsGetGithubActionsPermissionsOrganization: ( org: string, - teamSlug: string, - projectId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, method: "GET", format: "json", ...params, }), /** - * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * @description Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsInOrg - * @summary Add or update team project permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags actions + * @name ActionsSetGithubActionsPermissionsOrganization + * @summary Set GitHub Actions permissions for an organization + * @request PUT:/orgs/{org}/actions/permissions */ - teamsAddOrUpdateProjectPermissionsInOrg: ( + actionsSetGithubActionsPermissionsOrganization: ( org: string, - teamSlug: string, - projectId: number, data: { - /** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ - permission?: "read" | "write" | "admin"; + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: \`all\`, \`none\`, or \`selected\`. */ + enabled_repositories: EnabledRepositories; }, params: RequestParams = {}, ) => - this.request< - void, - { - documentation_url?: string; - message?: string; - } - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, method: "PUT", body: data, type: ContentType.Json, @@ -23987,36 +22020,15 @@ export class Api< }), /** - * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. - * - * @tags teams - * @name TeamsRemoveProjectInOrg - * @summary Remove a project from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} - */ - teamsRemoveProjectInOrg: ( - org: string, - teamSlug: string, - projectId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. + * @description Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsListReposInOrg - * @summary List team repositories - * @request GET:/orgs/{org}/teams/{team_slug}/repos + * @tags actions + * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization + * @summary List selected repositories enabled for GitHub Actions in an organization + * @request GET:/orgs/{org}/actions/permissions/repositories */ - teamsListReposInOrg: ( + actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( org: string, - teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -24031,8 +22043,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, + this.request< + { + repositories: Repository[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "GET", query: query, format: "json", @@ -24040,148 +22058,117 @@ export class Api< }), /** - * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * @description Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsCheckPermissionsForRepoInOrg - * @summary Check team permissions for a repository - * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags actions + * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization + * @summary Set selected repositories enabled for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories */ - teamsCheckPermissionsForRepoInOrg: ( + actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( org: string, - teamSlug: string, - owner: string, - repo: string, + data: { + /** List of repository IDs to enable for GitHub Actions. */ + selected_repository_ids: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". - * - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsInOrg - * @summary Add or update team repository permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} - */ - teamsAddOrUpdateRepoPermissionsInOrg: ( - org: string, - teamSlug: string, - owner: string, - repo: string, - data: { - /** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. - * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: "pull" | "push" | "admin" | "maintain" | "triage"; - }, + * @description Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. + * + * @tags actions + * @name ActionsEnableSelectedRepositoryGithubActionsOrganization + * @summary Enable a selected repository for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} + */ + actionsEnableSelectedRepositoryGithubActionsOrganization: ( + org: string, + repositoryId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, method: "PUT", - body: data, - type: ContentType.Json, ...params, }), /** - * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. + * @description Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsRemoveRepoInOrg - * @summary Remove a repository from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags actions + * @name ActionsDisableSelectedRepositoryGithubActionsOrganization + * @summary Disable a selected repository for GitHub Actions in an organization + * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - teamsRemoveRepoInOrg: ( + actionsDisableSelectedRepositoryGithubActionsOrganization: ( org: string, - teamSlug: string, - owner: string, - repo: string, + repositoryId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, method: "DELETE", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @description Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsListIdpGroupsInOrg - * @summary List IdP groups for a team - * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags actions + * @name ActionsGetAllowedActionsOrganization + * @summary Get allowed actions for an organization + * @request GET:/orgs/{org}/actions/permissions/selected-actions */ - teamsListIdpGroupsInOrg: ( + actionsGetAllowedActionsOrganization: ( org: string, - teamSlug: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, method: "GET", format: "json", ...params, }), /** - * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * @description Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." If the organization belongs to an enterprise that has \`selected\` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories in the organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`administration\` organization permission to use this API. * - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg - * @summary Create or update IdP group connections - * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags actions + * @name ActionsSetAllowedActionsOrganization + * @summary Set allowed actions for an organization + * @request PUT:/orgs/{org}/actions/permissions/selected-actions */ - teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + actionsSetAllowedActionsOrganization: ( org: string, - teamSlug: string, - data: { - /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ - groups: { - /** Description of the IdP group. */ - group_description: string; - /** ID of the IdP group. */ - group_id: string; - /** Name of the IdP group. */ - group_name: string; - }[]; - }, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags teams - * @name TeamsListChildInOrg - * @summary List child teams - * @request GET:/orgs/{org}/teams/{team_slug}/teams + * @tags actions + * @name ActionsListSelfHostedRunnerGroupsForOrg + * @summary List self-hosted runner groups for an organization + * @request GET:/orgs/{org}/actions/runner-groups */ - teamsListChildInOrg: ( + actionsListSelfHostedRunnerGroupsForOrg: ( org: string, - teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -24196,58 +22183,48 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, + this.request< + { + runner_groups: RunnerGroupsOrg[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups\`, method: "GET", query: query, format: "json", ...params, }), - }; - projects = { - /** - * No description - * - * @tags projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} - */ - projectsGetCard: (cardId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "GET", - format: "json", - ...params, - }), /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Creates a new self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @tags actions + * @name ActionsCreateSelfHostedRunnerGroupForOrg + * @summary Create a self-hosted runner group for an organization + * @request POST:/orgs/{org}/actions/runner-groups */ - projectsUpdateCard: ( - cardId: number, + actionsCreateSelfHostedRunnerGroupForOrg: ( + org: string, data: { + /** Name of the runner group. */ + name: string; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + /** List of repository IDs that can access the runner group. */ + selected_repository_ids?: number[]; /** - * Whether or not the card is archived - * @example false - */ - archived?: boolean; - /** - * The project card's note - * @example "Update all gems" + * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. + * @default "all" */ - note?: string | null; + visibility?: "selected" | "all" | "private"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -24255,122 +22232,46 @@ export class Api< }), /** - * No description - * - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} - */ - projectsDeleteCard: (cardId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url?: string; - errors?: string[]; - message?: string; - } - >({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "DELETE", - ...params, - }), - - /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Gets a specific self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @tags actions + * @name ActionsGetSelfHostedRunnerGroupForOrg + * @summary Get a self-hosted runner group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - projectsMoveCard: ( - cardId: number, - data: { - /** - * The unique identifier of the column the card should be moved to - * @example 42 - */ - column_id?: number; - /** - * The position of the card in a column - * @pattern ^(?:top|bottom|after:\\d+)$ - * @example "bottom" - */ - position: string; - }, + actionsGetSelfHostedRunnerGroupForOrg: ( + org: string, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request< - object, - | BasicError - | { - documentation_url?: string; - errors?: { - code?: string; - field?: string; - message?: string; - resource?: string; - }[]; - message?: string; - } - | ValidationError - | { - code?: string; - documentation_url?: string; - errors?: { - code?: string; - message?: string; - }[]; - message?: string; - } - >({ - path: \`/projects/columns/cards/\${cardId}/moves\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * No description - * - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} - */ - projectsGetColumn: (columnId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/columns/\${columnId}\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_id} + * @tags actions + * @name ActionsUpdateSelfHostedRunnerGroupForOrg + * @summary Update a self-hosted runner group for an organization + * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - projectsUpdateColumn: ( - columnId: number, + actionsUpdateSelfHostedRunnerGroupForOrg: ( + org: string, + runnerGroupId: number, data: { - /** - * Name of the project column - * @example "Remaining tasks" - */ - name: string; + /** Name of the runner group. */ + name?: string; + /** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: \`all\`, \`selected\`, or \`private\`. */ + visibility?: "selected" | "all" | "private"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -24379,250 +22280,230 @@ export class Api< }), /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Deletes a self-hosted runner group for an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @tags actions + * @name ActionsDeleteSelfHostedRunnerGroupFromOrg + * @summary Delete a self-hosted runner group from an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - projectsDeleteColumn: (columnId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/columns/\${columnId}\`, + actionsDeleteSelfHostedRunnerGroupFromOrg: ( + org: string, + runnerGroupId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", ...params, }), /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists the repositories with access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @tags actions + * @name ActionsListRepoAccessToSelfHostedRunnerGroupInOrg + * @summary List repository access to a self-hosted runner group in an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - projectsListCards: ( - columnId: number, - query?: { - /** - * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. - * @default "not_archived" - */ - archived_state?: "all" | "archived" | "not_archived"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( + org: string, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, + this.request< + { + repositories: Repository[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsCreateCard - * @summary Create a project card - * @request POST:/projects/columns/{column_id}/cards + * @tags actions + * @name ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Set repository access for a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories */ - projectsCreateCard: ( - columnId: number, - data: - | { - /** - * The project card's note - * @example "Update all gems" - */ - note: string | null; - } - | { - /** - * The unique identifier of the content associated with the card - * @example 42 - */ - content_id: number; - /** - * The piece of content associated with the card - * @example "PullRequest" - */ - content_type: string; - }, + actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( + org: string, + runnerGroupId: number, + data: { + /** List of repository IDs that can access the runner group. */ + selected_repository_ids: number[]; + }, params: RequestParams = {}, ) => - this.request< - ProjectCard, - | BasicError - | (ValidationError | ValidationErrorSimple) - | { - code?: string; - documentation_url?: string; - errors?: { - code?: string; - message?: string; - }[]; - message?: string; - } - >({ - path: \`/projects/columns/\${columnId}/cards\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @tags actions + * @name ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Add repository access to a self-hosted runner group in an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} */ - projectsMoveColumn: ( - columnId: number, - data: { - /** - * The position of the column in a project - * @pattern ^(?:first|last|after:\\d+)$ - * @example "last" - */ - position: string; - }, + actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( + org: string, + runnerGroupId: number, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/moves\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsGet - * @summary Get a project - * @request GET:/projects/{project_id} + * @tags actions + * @name ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg + * @summary Remove repository access to a self-hosted runner group in an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} */ - projectsGet: (projectId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/\${projectId}\`, - method: "GET", - format: "json", + actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( + org: string, + runnerGroupId: number, + repositoryId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Lists self-hosted runners that are in a specific organization group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsUpdate - * @summary Update a project - * @request PATCH:/projects/{project_id} + * @tags actions + * @name ActionsListSelfHostedRunnersInGroupForOrg + * @summary List self-hosted runners in a group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners */ - projectsUpdate: ( - projectId: number, - data: { - /** - * Body of the project - * @example "This project represents the sprint of the first week in January" - */ - body?: string | null; + actionsListSelfHostedRunnersInGroupForOrg: ( + org: string, + runnerGroupId: number, + query?: { /** - * Name of the project - * @example "Week One Sprint" + * Page number of the results to fetch. + * @default 1 */ - name?: string; - /** The baseline permission that all organization members have on this project */ - organization_permission?: "read" | "write" | "admin" | "none"; - /** Whether or not this project can be seen by everyone. */ - private?: boolean; + page?: number; /** - * State of the project; either 'open' or 'closed' - * @example "open" + * Results per page (max 100) + * @default 30 */ - state?: string; + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request< + { + runners: Runner[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Replaces the list of self-hosted runners that are part of an organization runner group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * + * @tags actions + * @name ActionsSetSelfHostedRunnersInGroupForOrg + * @summary Set self-hosted runners in a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners + */ + actionsSetSelfHostedRunnersInGroupForOrg: ( + org: string, + runnerGroupId: number, + data: { + /** List of runner IDs to add to the runner group. */ + runners: number[]; }, params: RequestParams = {}, ) => - this.request< - Project, - | BasicError - | { - documentation_url?: string; - errors?: string[]; - message?: string; - } - | void - | ValidationErrorSimple - >({ - path: \`/projects/\${projectId}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Adds a self-hosted runner to a runner group configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsDelete - * @summary Delete a project - * @request DELETE:/projects/{project_id} + * @tags actions + * @name ActionsAddSelfHostedRunnerToGroupForOrg + * @summary Add a self-hosted runner to a group for an organization + * @request PUT:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} */ - projectsDelete: (projectId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url?: string; - errors?: string[]; - message?: string; - } - >({ - path: \`/projects/\${projectId}\`, + actionsAddSelfHostedRunnerToGroupForOrg: ( + org: string, + runnerGroupId: number, + runnerId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "PUT", + ...params, + }), + + /** + * @description The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * + * @tags actions + * @name ActionsRemoveSelfHostedRunnerFromGroupForOrg + * @summary Remove a self-hosted runner from a group for an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} + */ + actionsRemoveSelfHostedRunnerFromGroupForOrg: ( + org: string, + runnerGroupId: number, + runnerId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...params, }), /** - * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. + * @description Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsListCollaborators - * @summary List project collaborators - * @request GET:/projects/{project_id}/collaborators + * @tags actions + * @name ActionsListSelfHostedRunnersForOrg + * @summary List self-hosted runners for an organization + * @request GET:/orgs/{org}/actions/runners */ - projectsListCollaborators: ( - projectId: number, + actionsListSelfHostedRunnersForOrg: ( + org: string, query?: { - /** - * Filters the collaborators by their affiliation. Can be one of: - * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. - * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: "outside" | "direct" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -24637,15 +22518,13 @@ export class Api< params: RequestParams = {}, ) => this.request< - SimpleUser[], - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError + { + runners: Runner[]; + total_count: number; + }, + any >({ - path: \`/projects/\${projectId}/collaborators\`, + path: \`/orgs/\${org}/actions/runners\`, method: "GET", query: query, format: "json", @@ -24653,107 +22532,108 @@ export class Api< }), /** - * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsAddCollaborator - * @summary Add project collaborator - * @request PUT:/projects/{project_id}/collaborators/{username} + * @tags actions + * @name ActionsListRunnerApplicationsForOrg + * @summary List runner applications for an organization + * @request GET:/orgs/{org}/actions/runners/downloads */ - projectsAddCollaborator: ( - projectId: number, - username: string, - data: { - /** - * The permission to grant the collaborator. - * @default "write" - * @example "write" - */ - permission?: "read" | "write" | "admin"; - }, + actionsListRunnerApplicationsForOrg: ( + org: string, params: RequestParams = {}, ) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/runners/downloads\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org --token TOKEN \`\`\` * - * @tags projects - * @name ProjectsRemoveCollaborator - * @summary Remove user as a collaborator - * @request DELETE:/projects/{project_id}/collaborators/{username} + * @tags actions + * @name ActionsCreateRegistrationTokenForOrg + * @summary Create a registration token for an organization + * @request POST:/orgs/{org}/actions/runners/registration-token */ - projectsRemoveCollaborator: ( - projectId: number, - username: string, + actionsCreateRegistrationTokenForOrg: ( + org: string, params: RequestParams = {}, ) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/runners/registration-token\`, + method: "POST", + format: "json", ...params, }), /** - * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. + * @description Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from an organization, replace \`TOKEN\` with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * - * @tags projects - * @name ProjectsGetPermissionForUser - * @summary Get project permission for a user - * @request GET:/projects/{project_id}/collaborators/{username}/permission + * @tags actions + * @name ActionsCreateRemoveTokenForOrg + * @summary Create a remove token for an organization + * @request POST:/orgs/{org}/actions/runners/remove-token */ - projectsGetPermissionForUser: ( - projectId: number, - username: string, + actionsCreateRemoveTokenForOrg: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/actions/runners/remove-token\`, + method: "POST", + format: "json", + ...params, + }), + + /** + * @description Gets a specific self-hosted runner configured in an organization. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. + * + * @tags actions + * @name ActionsGetSelfHostedRunnerForOrg + * @summary Get a self-hosted runner for an organization + * @request GET:/orgs/{org}/actions/runners/{runner_id} + */ + actionsGetSelfHostedRunnerForOrg: ( + org: string, + runnerId: number, params: RequestParams = {}, ) => - this.request< - RepositoryCollaboratorPermission, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. * - * @tags projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromOrg + * @summary Delete a self-hosted runner from an organization + * @request DELETE:/orgs/{org}/actions/runners/{runner_id} + */ + actionsDeleteSelfHostedRunnerFromOrg: ( + org: string, + runnerId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * + * @tags actions + * @name ActionsListOrgSecrets + * @summary List organization secrets + * @request GET:/orgs/{org}/actions/secrets */ - projectsListColumns: ( - projectId: number, + actionsListOrgSecrets: ( + org: string, query?: { /** * Page number of the results to fetch. @@ -24768,8 +22648,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}/columns\`, + this.request< + { + secrets: OrganizationActionsSecret[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/secrets\`, method: "GET", query: query, format: "json", @@ -24777,440 +22663,360 @@ export class Api< }), /** - * No description - * - * @tags projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns - */ - projectsCreateColumn: ( - projectId: number, - data: { - /** - * Name of the project column - * @example "Remaining tasks" - */ - name: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/\${projectId}/columns\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - }; - rateLimit = { - /** - * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * - * @tags rate-limit - * @name RateLimitGet - * @summary Get rate limit status for the authenticated user - * @request GET:/rate_limit + * @tags actions + * @name ActionsGetOrgPublicKey + * @summary Get an organization public key + * @request GET:/orgs/{org}/actions/secrets/public-key */ - rateLimitGet: (params: RequestParams = {}) => - this.request({ - path: \`/rate_limit\`, + actionsGetOrgPublicKey: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/actions/secrets/public-key\`, method: "GET", format: "json", ...params, }), - }; - reactions = { - /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). - * - * @tags reactions - * @name ReactionsDeleteLegacy - * @summary Delete a reaction (Legacy) - * @request DELETE:/reactions/{reaction_id} - * @deprecated - */ - reactionsDeleteLegacy: (reactionId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/reactions/\${reactionId}\`, - method: "DELETE", - ...params, - }), - }; - repos = { + /** - * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. + * @description Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * - * @tags repos - * @name ReposGet - * @summary Get a repository - * @request GET:/repos/{owner}/{repo} + * @tags actions + * @name ActionsGetOrgSecret + * @summary Get an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name} */ - reposGet: (owner: string, repo: string, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, + actionsGetOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "GET", format: "json", ...params, }), /** - * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. + * @description Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` * - * @tags repos - * @name ReposUpdate - * @summary Update a repository - * @request PATCH:/repos/{owner}/{repo} + * @tags actions + * @name ActionsCreateOrUpdateOrgSecret + * @summary Create or update an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name} */ - reposUpdate: ( - owner: string, - repo: string, + actionsCreateOrUpdateOrgSecret: ( + org: string, + secretName: string, data: { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: string[]; /** - * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. - * @default true - */ - allow_merge_commit?: boolean; - /** - * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. - * @default true - */ - allow_rebase_merge?: boolean; - /** - * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. - * @default true - */ - allow_squash_merge?: boolean; - /** - * \`true\` to archive this repository. **Note**: You cannot unarchive repositories through the API. - * @default false - */ - archived?: boolean; - /** Updates the default branch for this repository. */ - default_branch?: string; - /** - * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. - * @default false - */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; - /** - * Either \`true\` to enable issues for this repository or \`false\` to disable them. - * @default true - */ - has_issues?: boolean; - /** - * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. - * @default true - */ - has_projects?: boolean; - /** - * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. - * @default true - */ - has_wiki?: boolean; - /** A URL with more information about the repository. */ - homepage?: string; - /** - * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. - * @default false - */ - is_template?: boolean; - /** The name of the repository. */ - name?: string; - /** - * Either \`true\` to make the repository private or \`false\` to make it public. Default: \`false\`. - * **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. - * @default false + * Configures the access that repositories have to the organization secret. Can be one of: + * \\- \`all\` - All repositories in an organization can access the secret. + * \\- \`private\` - Private repositories in an organization can access the secret. + * \\- \`selected\` - Only specific repositories can access the secret. */ - private?: boolean; - /** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ - visibility?: "public" | "private" | "visibility" | "internal"; + visibility?: "all" | "private" | "selected"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. - * - * @tags repos - * @name ReposDelete - * @summary Delete a repository - * @request DELETE:/repos/{owner}/{repo} - */ - reposDelete: (owner: string, repo: string, params: RequestParams = {}) => - this.request< - void, - | { - documentation_url?: string; - message?: string; - } - | BasicError - >({ - path: \`/repos/\${owner}/\${repo}\`, - method: "DELETE", ...params, }), /** - * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Deletes a secret in an organization using the secret name. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsListArtifactsForRepo - * @summary List artifacts for a repository - * @request GET:/repos/{owner}/{repo}/actions/artifacts + * @name ActionsDeleteOrgSecret + * @summary Delete an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} */ - actionsListArtifactsForRepo: ( - owner: string, - repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + actionsDeleteOrgSecret: ( + org: string, + secretName: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Lists all repositories that have been selected when the \`visibility\` for repository access to a secret is set to \`selected\`. You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. + * + * @tags actions + * @name ActionsListSelectedReposForOrgSecret + * @summary List selected repositories for an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories + */ + actionsListSelectedReposForOrgSecret: ( + org: string, + secretName: string, params: RequestParams = {}, ) => this.request< { - artifacts: Artifact[]; + repositories: MinimalRepository[]; total_count: number; }, any >({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Replaces all repositories for an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsGetArtifact - * @summary Get an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @name ActionsSetSelectedReposForOrgSecret + * @summary Set selected repositories for an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - actionsGetArtifact: ( - owner: string, - repo: string, - artifactId: number, + actionsSetSelectedReposForOrgSecret: ( + org: string, + secretName: string, + data: { + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the \`visibility\` is set to \`selected\`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Adds a repository to an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsDeleteArtifact - * @summary Delete an artifact - * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @name ActionsAddSelectedRepoToOrgSecret + * @summary Add selected repository to an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - actionsDeleteArtifact: ( - owner: string, - repo: string, - artifactId: number, + actionsAddSelectedRepoToOrgSecret: ( + org: string, + secretName: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Removes a repository from an organization secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the \`admin:org\` scope to use this endpoint. GitHub Apps must have the \`secrets\` organization permission to use this endpoint. * * @tags actions - * @name ActionsDownloadArtifact - * @summary Download an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + * @name ActionsRemoveSelectedRepoFromOrgSecret + * @summary Remove selected repository from an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - actionsDownloadArtifact: ( - owner: string, - repo: string, - artifactId: number, - archiveFormat: string, + actionsRemoveSelectedRepoFromOrgSecret: ( + org: string, + secretName: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description **Note:** The audit log REST API is currently in beta and is subject to change. Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." To use this endpoint, you must be an organization owner, and you must use an access token with the \`admin:org\` scope. GitHub Apps must have the \`organization_administration\` read permission to use this endpoint. * - * @tags actions - * @name ActionsGetJobForWorkflowRun - * @summary Get a job for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} + * @tags orgs + * @name OrgsGetAuditLog + * @summary Get the audit log for an organization + * @request GET:/orgs/{org}/audit-log */ - actionsGetJobForWorkflowRun: ( - owner: string, - repo: string, - jobId: number, + orgsGetAuditLog: ( + org: string, + query?: { + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: string; + /** + * The event types to include: + * + * - \`web\` - returns web (non-Git) events + * - \`git\` - returns Git events + * - \`all\` - returns both web and Git events + * + * The default is \`web\`. + */ + include?: "web" | "git" | "all"; + /** + * The order of audit log events. To list newest events first, specify \`desc\`. To list oldest events first, specify \`asc\`. + * + * The default is \`desc\`. + */ + order?: "desc" | "asc"; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, + this.request({ + path: \`/orgs/\${org}/audit-log\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description List the users blocked by an organization. * - * @tags actions - * @name ActionsDownloadJobLogsForWorkflowRun - * @summary Download job logs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs + * @tags orgs + * @name OrgsListBlockedUsers + * @summary List users blocked by an organization + * @request GET:/orgs/{org}/blocks */ - actionsDownloadJobLogsForWorkflowRun: ( - owner: string, - repo: string, - jobId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, + orgsListBlockedUsers: (org: string, params: RequestParams = {}) => + this.request< + SimpleUser[], + { + documentation_url: string; + message: string; + } + >({ + path: \`/orgs/\${org}/blocks\`, method: "GET", + format: "json", ...params, }), /** - * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * No description * - * @tags actions - * @name ActionsGetGithubActionsPermissionsRepository - * @summary Get GitHub Actions permissions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions + * @tags orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - actionsGetGithubActionsPermissionsRepository: ( - owner: string, - repo: string, + orgsCheckBlockedUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, method: "GET", - format: "json", ...params, }), /** - * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * No description * - * @tags actions - * @name ActionsSetGithubActionsPermissionsRepository - * @summary Set GitHub Actions permissions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions + * @tags orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} */ - actionsSetGithubActionsPermissionsRepository: ( - owner: string, - repo: string, - data: { - /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ - allowed_actions?: AllowedActions; - /** Whether GitHub Actions is enabled on the repository. */ - enabled: ActionsEnabled; - }, + orgsBlockUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, method: "PUT", - body: data, - type: ContentType.Json, ...params, }), /** - * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * No description * - * @tags actions - * @name ActionsGetAllowedActionsRepository - * @summary Get allowed actions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @tags orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - actionsGetAllowedActionsRepository: ( - owner: string, - repo: string, + orgsUnblockUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`read:org\` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + * + * @tags orgs + * @name OrgsListSamlSsoAuthorizations + * @summary List SAML SSO authorizations for an organization + * @request GET:/orgs/{org}/credential-authorizations + */ + orgsListSamlSsoAuthorizations: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/credential-authorizations\`, method: "GET", format: "json", ...params, }), /** - * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. + * @description Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). An authenticated organization owner with the \`admin:org\` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. * - * @tags actions - * @name ActionsSetAllowedActionsRepository - * @summary Set allowed actions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @tags orgs + * @name OrgsRemoveSamlSsoAuthorization + * @summary Remove a SAML SSO authorization for an organization + * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} */ - actionsSetAllowedActionsRepository: ( - owner: string, - repo: string, - data: SelectedActions, + orgsRemoveSamlSsoAuthorization: ( + org: string, + credentialId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, + method: "DELETE", ...params, }), /** - * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * No description * - * @tags actions - * @name ActionsListSelfHostedRunnersForRepo - * @summary List self-hosted runners for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners + * @tags activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - actionsListSelfHostedRunnersForRepo: ( - owner: string, - repo: string, + activityListPublicOrgEvents: ( + org: string, query?: { /** * Page number of the results to fetch. @@ -25225,14 +23031,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - runners: Runner[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/runners\`, + this.request({ + path: \`/orgs/\${org}/events\`, method: "GET", query: query, format: "json", @@ -25240,274 +23040,299 @@ export class Api< }), /** - * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure. * - * @tags actions - * @name ActionsListRunnerApplicationsForRepo - * @summary List runner applications for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/downloads + * @tags orgs + * @name OrgsListFailedInvitations + * @summary List failed organization invitations + * @request GET:/orgs/{org}/failed_invitations */ - actionsListRunnerApplicationsForRepo: ( - owner: string, - repo: string, + orgsListFailedInvitations: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, + this.request({ + path: \`/orgs/\${org}/failed_invitations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` + * No description * - * @tags actions - * @name ActionsCreateRegistrationTokenForRepo - * @summary Create a registration token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + * @tags orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - actionsCreateRegistrationTokenForRepo: ( - owner: string, - repo: string, + orgsListWebhooks: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/hooks\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` + * @description Here's how you can create a hook that posts payloads in JSON format: * - * @tags actions - * @name ActionsCreateRemoveTokenForRepo - * @summary Create a remove token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + * @tags orgs + * @name OrgsCreateWebhook + * @summary Create an organization webhook + * @request POST:/orgs/{org}/hooks */ - actionsCreateRemoveTokenForRepo: ( - owner: string, - repo: string, + orgsCreateWebhook: ( + org: string, + data: { + /** + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true + */ + active?: boolean; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ + config: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""password"" */ + password?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + /** @example ""kdaigle"" */ + username?: string; + }; + /** + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] + */ + events?: string[]; + /** Must be passed as "web". */ + name: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, + this.request({ + path: \`/orgs/\${org}/hooks\`, method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * @description Returns a webhook configured in an organization. To get only the webhook \`config\` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." * - * @tags actions - * @name ActionsGetSelfHostedRunnerForRepo - * @summary Get a self-hosted runner for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags orgs + * @name OrgsGetWebhook + * @summary Get an organization webhook + * @request GET:/orgs/{org}/hooks/{hook_id} */ - actionsGetSelfHostedRunnerForRepo: ( - owner: string, - repo: string, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + orgsGetWebhook: (org: string, hookId: number, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, method: "GET", format: "json", ...params, }), /** - * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. - * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromRepo - * @summary Delete a self-hosted runner from a repository - * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} - */ - actionsDeleteSelfHostedRunnerFromRepo: ( - owner: string, - repo: string, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Updates a webhook configured in an organization. When you update a webhook, the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." * - * @tags actions - * @name ActionsListWorkflowRunsForRepo - * @summary List workflow runs for a repository - * @request GET:/repos/{owner}/{repo}/actions/runs + * @tags orgs + * @name OrgsUpdateWebhook + * @summary Update an organization webhook + * @request PATCH:/orgs/{org}/hooks/{hook_id} */ - actionsListWorkflowRunsForRepo: ( - owner: string, - repo: string, - query?: { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; + orgsUpdateWebhook: ( + org: string, + hookId: number, + data: { /** - * Page number of the results to fetch. - * @default 1 + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - page?: number; + active?: boolean; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ + config?: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + }; /** - * Results per page (max 100) - * @default 30 + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] */ - per_page?: number; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: "completed" | "status" | "conclusion"; + events?: string[]; + /** @example ""web"" */ + name?: string; }, params: RequestParams = {}, ) => - this.request< - { - total_count: number; - workflow_runs: WorkflowRun[]; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/runs\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * No description * - * @tags actions - * @name ActionsGetWorkflowRun - * @summary Get a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - actionsGetWorkflowRun: ( - owner: string, - repo: string, - runId: number, + orgsDeleteWebhook: ( + org: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "DELETE", ...params, }), /** - * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:read\` permission. * - * @tags actions - * @name ActionsDeleteWorkflowRun - * @summary Delete a workflow run - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags orgs + * @name OrgsGetWebhookConfigForOrg + * @summary Get a webhook configuration for an organization + * @request GET:/orgs/{org}/hooks/{hook_id}/config */ - actionsDeleteWorkflowRun: ( - owner: string, - repo: string, - runId: number, + orgsGetWebhookConfigForOrg: ( + org: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "GET", + format: "json", ...params, }), /** - * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." Access tokens must have the \`admin:org_hook\` scope, and GitHub Apps must have the \`organization_hooks:write\` permission. * - * @tags actions - * @name ActionsListWorkflowRunArtifacts - * @summary List workflow run artifacts - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + * @tags orgs + * @name OrgsUpdateWebhookConfigForOrg + * @summary Update a webhook configuration for an organization + * @request PATCH:/orgs/{org}/hooks/{hook_id}/config */ - actionsListWorkflowRunArtifacts: ( - owner: string, - repo: string, - runId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + orgsUpdateWebhookConfigForOrg: ( + org: string, + hookId: number, + data: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; }, params: RequestParams = {}, ) => - this.request< - { - artifacts: Artifact[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags actions - * @name ActionsCancelWorkflowRun - * @summary Cancel a workflow run - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + * @tags orgs + * @name OrgsPingWebhook + * @summary Ping an organization webhook + * @request POST:/orgs/{org}/hooks/{hook_id}/pings */ - actionsCancelWorkflowRun: ( - owner: string, - repo: string, - runId: number, + orgsPingWebhook: ( + org: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, method: "POST", ...params, }), /** - * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * @description Enables an authenticated GitHub App to find the organization's installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags actions - * @name ActionsListJobsForWorkflowRun - * @summary List jobs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs + * @tags apps + * @name AppsGetOrgInstallation + * @summary Get an organization installation for the authenticated app + * @request GET:/orgs/{org}/installation */ - actionsListJobsForWorkflowRun: ( - owner: string, - repo: string, - runId: number, + appsGetOrgInstallation: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/installation\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with \`admin:read\` scope to use this endpoint. + * + * @tags orgs + * @name OrgsListAppInstallations + * @summary List app installations for an organization + * @request GET:/orgs/{org}/installations + */ + orgsListAppInstallations: ( + org: string, query?: { - /** - * Filters jobs by their \`completed_at\` timestamp. Can be one of: - * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. - * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. - * @default "latest" - */ - filter?: "latest" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -25523,12 +23348,12 @@ export class Api< ) => this.request< { - jobs: Job[]; + installations: Installation[]; total_count: number; }, any >({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, + path: \`/orgs/\${org}/installations\`, method: "GET", query: query, format: "json", @@ -25536,97 +23361,74 @@ export class Api< }), /** - * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. * - * @tags actions - * @name ActionsDownloadWorkflowRunLogs - * @summary Download workflow run logs - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @tags interactions + * @name InteractionsGetRestrictionsForOrg + * @summary Get interaction restrictions for an organization + * @request GET:/orgs/{org}/interaction-limits */ - actionsDownloadWorkflowRunLogs: ( - owner: string, - repo: string, - runId: number, + interactionsGetRestrictionsForOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, method: "GET", + format: "json", ...params, }), /** - * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. - * - * @tags actions - * @name ActionsDeleteWorkflowRunLogs - * @summary Delete workflow run logs - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs - */ - actionsDeleteWorkflowRunLogs: ( - owner: string, - repo: string, - runId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, - method: "DELETE", - ...params, - }), - - /** - * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. * - * @tags actions - * @name ActionsReRunWorkflow - * @summary Re-run a workflow - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun + * @tags interactions + * @name InteractionsSetRestrictionsForOrg + * @summary Set interaction restrictions for an organization + * @request PUT:/orgs/{org}/interaction-limits */ - actionsReRunWorkflow: ( - owner: string, - repo: string, - runId: number, + interactionsSetRestrictionsForOrg: ( + org: string, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), - /** - * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. - * - * @tags actions - * @name ActionsGetWorkflowRunUsage - * @summary Get workflow run usage - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing + /** + * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. + * + * @tags interactions + * @name InteractionsRemoveRestrictionsForOrg + * @summary Remove interaction restrictions for an organization + * @request DELETE:/orgs/{org}/interaction-limits */ - actionsGetWorkflowRunUsage: ( - owner: string, - repo: string, - runId: number, + interactionsRemoveRestrictionsForOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "DELETE", ...params, }), /** - * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. * - * @tags actions - * @name ActionsListRepoSecrets - * @summary List repository secrets - * @request GET:/repos/{owner}/{repo}/actions/secrets + * @tags orgs + * @name OrgsListPendingInvitations + * @summary List pending organization invitations + * @request GET:/orgs/{org}/invitations */ - actionsListRepoSecrets: ( - owner: string, - repo: string, + orgsListPendingInvitations: ( + org: string, query?: { /** * Page number of the results to fetch. @@ -25641,14 +23443,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - secrets: ActionsSecret[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/secrets\`, + this.request({ + path: \`/orgs/\${org}/invitations\`, method: "GET", query: query, format: "json", @@ -25656,106 +23452,173 @@ export class Api< }), /** - * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags actions - * @name ActionsGetRepoPublicKey - * @summary Get a repository public key - * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key + * @tags orgs + * @name OrgsCreateInvitation + * @summary Create an organization invitation + * @request POST:/orgs/{org}/invitations */ - actionsGetRepoPublicKey: ( - owner: string, - repo: string, + orgsCreateInvitation: ( + org: string, + data: { + /** **Required unless you provide \`invitee_id\`**. Email address of the person you are inviting, which can be an existing GitHub user. */ + email?: string; + /** **Required unless you provide \`email\`**. GitHub user ID for the person you are inviting. */ + invitee_id?: number; + /** + * Specify role for new member. Can be one of: + * \\* \`admin\` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + * \\* \`direct_member\` - Non-owner organization members with ability to see other members and join teams by invitation. + * \\* \`billing_manager\` - Non-owner organization members with ability to manage the billing settings of your organization. + * @default "direct_member" + */ + role?: "admin" | "direct_member" | "billing_manager"; + /** Specify IDs for the teams you want to invite new members to. */ + team_ids?: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/invitations\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). * - * @tags actions - * @name ActionsGetRepoSecret - * @summary Get a repository secret - * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags orgs + * @name OrgsCancelInvitation + * @summary Cancel an organization invitation + * @request DELETE:/orgs/{org}/invitations/{invitation_id} */ - actionsGetRepoSecret: ( - owner: string, - repo: string, - secretName: string, + orgsCancelInvitation: ( + org: string, + invitationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}\`, + method: "DELETE", ...params, }), /** - * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` + * @description List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. * - * @tags actions - * @name ActionsCreateOrUpdateRepoSecret - * @summary Create or update a repository secret - * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags orgs + * @name OrgsListInvitationTeams + * @summary List organization invitation teams + * @request GET:/orgs/{org}/invitations/{invitation_id}/teams */ - actionsCreateOrUpdateRepoSecret: ( - owner: string, - repo: string, - secretName: string, - data: { - /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. */ - encrypted_value?: string; - /** ID of the key you used to encrypt the secret. */ - key_id?: string; + orgsListInvitationTeams: ( + org: string, + invitationId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. + * @description List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags actions - * @name ActionsDeleteRepoSecret - * @summary Delete a repository secret - * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags issues + * @name IssuesListForOrg + * @summary List organization issues assigned to the authenticated user + * @request GET:/orgs/{org}/issues */ - actionsDeleteRepoSecret: ( - owner: string, - repo: string, - secretName: string, + issuesListForOrg: ( + org: string, + query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: "created" | "updated" | "comments"; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/issues\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. * - * @tags actions - * @name ActionsListRepoWorkflows - * @summary List repository workflows - * @request GET:/repos/{owner}/{repo}/actions/workflows + * @tags orgs + * @name OrgsListMembers + * @summary List organization members + * @request GET:/orgs/{org}/members */ - actionsListRepoWorkflows: ( - owner: string, - repo: string, + orgsListMembers: ( + org: string, query?: { + /** + * Filter members returned in the list. Can be one of: + * \\* \`2fa_disabled\` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \\* \`all\` - All members the authenticated user can see. + * @default "all" + */ + filter?: "2fa_disabled" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -25766,17 +23629,19 @@ export class Api< * @default 30 */ per_page?: number; + /** + * Filter members returned by their role. Can be one of: + * \\* \`all\` - All members of the organization, regardless of role. + * \\* \`admin\` - Organization owners. + * \\* \`member\` - Non-owner organization members. + * @default "all" + */ + role?: "all" | "admin" | "member"; }, - params: RequestParams = {}, - ) => - this.request< - { - total_count: number; - workflows: Workflow[]; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/members\`, method: "GET", query: query, format: "json", @@ -25784,113 +23649,124 @@ export class Api< }), /** - * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Check if a user is, publicly or privately, a member of the organization. * - * @tags actions - * @name ActionsGetWorkflow - * @summary Get a workflow - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + * @tags orgs + * @name OrgsCheckMembershipForUser + * @summary Check organization membership for a user + * @request GET:/orgs/{org}/members/{username} */ - actionsGetWorkflow: ( - owner: string, - repo: string, - workflowId: number | string, + orgsCheckMembershipForUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, method: "GET", - format: "json", ...params, }), /** - * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description 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. * - * @tags actions - * @name ActionsDisableWorkflow - * @summary Disable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + * @tags orgs + * @name OrgsRemoveMember + * @summary Remove an organization member + * @request DELETE:/orgs/{org}/members/{username} */ - actionsDisableWorkflow: ( - owner: string, - repo: string, - workflowId: number | string, + orgsRemoveMember: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "DELETE", ...params, }), /** - * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. * - * @tags actions - * @name ActionsCreateWorkflowDispatch - * @summary Create a workflow dispatch event - * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + * @tags orgs + * @name OrgsGetMembershipForUser + * @summary Get organization membership for a user + * @request GET:/orgs/{org}/memberships/{username} */ - actionsCreateWorkflowDispatch: ( - owner: string, - repo: string, - workflowId: number | string, + orgsGetMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Only authenticated organization owners can add a member to the organization or update the member's role. * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent. **Rate limits** To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + * + * @tags orgs + * @name OrgsSetMembershipForUser + * @summary Set organization membership for a user + * @request PUT:/orgs/{org}/memberships/{username} + */ + orgsSetMembershipForUser: ( + org: string, + username: string, data: { - /** Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when \`inputs\` are omitted. */ - inputs?: Record; - /** The git reference for the workflow. The reference can be a branch or tag name. */ - ref: string; + /** + * The role to give the user in the organization. Can be one of: + * \\* \`admin\` - The user will become an owner of the organization. + * \\* \`member\` - The user will become a non-owner member of the organization. + * @default "member" + */ + role?: "admin" | "member"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * @description In order to remove a user's membership with an organization, the authenticated user must be an organization owner. If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. * - * @tags actions - * @name ActionsEnableWorkflow - * @summary Enable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + * @tags orgs + * @name OrgsRemoveMembershipForUser + * @summary Remove organization membership for a user + * @request DELETE:/orgs/{org}/memberships/{username} */ - actionsEnableWorkflow: ( - owner: string, - repo: string, - workflowId: number | string, + orgsRemoveMembershipForUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "DELETE", ...params, }), /** - * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. + * @description Lists the most recent migrations. * - * @tags actions - * @name ActionsListWorkflowRuns - * @summary List workflow runs - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - actionsListWorkflowRuns: ( - owner: string, - repo: string, - workflowId: number | string, + migrationsListForOrg: ( + org: string, query?: { - /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ - actor?: string; - /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ - branch?: string; - /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ - event?: string; /** * Page number of the results to fetch. * @default 1 @@ -25901,19 +23777,11 @@ export class Api< * @default 30 */ per_page?: number; - /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ - status?: "completed" | "status" | "conclusion"; }, params: RequestParams = {}, ) => - this.request< - { - total_count: number; - workflow_runs: WorkflowRun[]; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, + this.request({ + path: \`/orgs/\${org}/migrations\`, method: "GET", query: query, format: "json", @@ -25921,128 +23789,130 @@ export class Api< }), /** - * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * @description Initiates the generation of a migration archive. * - * @tags actions - * @name ActionsGetWorkflowUsage - * @summary Get workflow usage - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - actionsGetWorkflowUsage: ( - owner: string, - repo: string, - workflowId: number | string, + migrationsStartForOrg: ( + org: string, + data: { + exclude?: string[]; + /** + * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). + * @default false + */ + exclude_attachments?: boolean; + /** + * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. + * @default false + */ + lock_repositories?: boolean; + /** A list of arrays indicating which repositories should be migrated. */ + repositories: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/migrations\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. + * @description Fetches the status of a migration. The \`state\` of a migration can be one of the following values: * \`pending\`, which means the migration hasn't started yet. * \`exporting\`, which means the migration is in progress. * \`exported\`, which means the migration finished successfully. * \`failed\`, which means the migration failed. * - * @tags issues - * @name IssuesListAssignees - * @summary List assignees - * @request GET:/repos/{owner}/{repo}/assignees + * @tags migrations + * @name MigrationsGetStatusForOrg + * @summary Get an organization migration status + * @request GET:/orgs/{org}/migrations/{migration_id} */ - issuesListAssignees: ( - owner: string, - repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + migrationsGetStatusForOrg: ( + org: string, + migrationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. + * @description Fetches the URL to a migration archive. * - * @tags issues - * @name IssuesCheckUserCanBeAssigned - * @summary Check if a user can be assigned - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @tags migrations + * @name MigrationsDownloadArchiveForOrg + * @summary Download an organization migration archive + * @request GET:/orgs/{org}/migrations/{migration_id}/archive */ - issuesCheckUserCanBeAssigned: ( - owner: string, - repo: string, - assignee: string, + migrationsDownloadArchiveForOrg: ( + org: string, + migrationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "GET", ...params, }), /** - * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. * - * @tags repos - * @name ReposEnableAutomatedSecurityFixes - * @summary Enable automated security fixes - * @request PUT:/repos/{owner}/{repo}/automated-security-fixes + * @tags migrations + * @name MigrationsDeleteArchiveForOrg + * @summary Delete an organization migration archive + * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive */ - reposEnableAutomatedSecurityFixes: ( - owner: string, - repo: string, + migrationsDeleteArchiveForOrg: ( + org: string, + migrationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + method: "DELETE", ...params, }), /** - * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". + * @description Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. * - * @tags repos - * @name ReposDisableAutomatedSecurityFixes - * @summary Disable automated security fixes - * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + * @tags migrations + * @name MigrationsUnlockRepoForOrg + * @summary Unlock an organization repository + * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock */ - reposDisableAutomatedSecurityFixes: ( - owner: string, - repo: string, + migrationsUnlockRepoForOrg: ( + org: string, + migrationId: number, + repoName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, method: "DELETE", ...params, }), /** - * No description + * @description List all the repositories for this organization migration. * - * @tags repos - * @name ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches + * @tags migrations + * @name MigrationsListReposForOrg + * @summary List repositories in an organization migration + * @request GET:/orgs/{org}/migrations/{migration_id}/repositories */ - reposListBranches: ( - owner: string, - repo: string, + migrationsListReposForOrg: ( + org: string, + migrationId: number, query?: { /** * Page number of the results to fetch. @@ -26054,13 +23924,11 @@ export class Api< * @default 30 */ per_page?: number; - /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ - protected?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, method: "GET", query: query, format: "json", @@ -26068,489 +23936,553 @@ export class Api< }), /** - * No description - * - * @tags repos - * @name ReposGetBranch - * @summary Get a branch - * @request GET:/repos/{owner}/{repo}/branches/{branch} - */ - reposGetBranch: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => - this.request< - BranchWithProtection, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description List all users who are outside collaborators of an organization. * - * @tags repos - * @name ReposGetBranchProtection - * @summary Get branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags orgs + * @name OrgsListOutsideCollaborators + * @summary List outside collaborators for an organization + * @request GET:/orgs/{org}/outside_collaborators */ - reposGetBranchProtection: ( - owner: string, - repo: string, - branch: string, + orgsListOutsideCollaborators: ( + org: string, + query?: { + /** + * Filter the list of outside collaborators. Can be one of: + * \\* \`2fa_disabled\`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \\* \`all\`: All outside collaborators. + * @default "all" + */ + filter?: "2fa_disabled" | "all"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + this.request({ + path: \`/orgs/\${org}/outside_collaborators\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. + * @description When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". * - * @tags repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags orgs + * @name OrgsConvertMemberToOutsideCollaborator + * @summary Convert an organization member to outside collaborator + * @request PUT:/orgs/{org}/outside_collaborators/{username} */ - reposUpdateBranchProtection: ( - owner: string, - repo: string, - branch: string, - data: { - /** Allows deletion of the protected branch by anyone with write access to the repository. Set to \`false\` to prevent deletion of the protected branch. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ - allow_deletions?: boolean; - /** Permits force pushes to the protected branch by anyone with write access to the repository. Set to \`true\` to allow force pushes. Set to \`false\` or \`null\` to block force pushes. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ - allow_force_pushes?: boolean | null; - /** Enforce all configured restrictions for administrators. Set to \`true\` to enforce required status checks for repository administrators. Set to \`null\` to disable. */ - enforce_admins: boolean | null; - /** Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to \`true\` to enforce a linear commit history. Set to \`false\` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: \`false\`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ - required_linear_history?: boolean; - /** Require at least one approving review on a pull request, before merging. Set to \`null\` to disable. */ - required_pull_request_reviews: { - /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ - dismiss_stale_reviews?: boolean; - /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ - dismissal_restrictions?: { - /** The list of team \`slug\`s with dismissal access */ - teams?: string[]; - /** The list of user \`login\`s with dismissal access */ - users?: string[]; - }; - /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ - require_code_owner_reviews?: boolean; - /** Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ - required_approving_review_count?: number; - } | null; - /** Require status checks to pass before merging. Set to \`null\` to disable. */ - required_status_checks: { - /** The list of status checks to require in order to merge into this branch */ - contexts: string[]; - /** Require branches to be up to date before merging. */ - strict: boolean; - } | null; - /** Restrict who can push to the protected branch. User, app, and team \`restrictions\` are only available for organization-owned repositories. Set to \`null\` to disable. */ - restrictions: { - /** The list of app \`slug\`s with push access */ - apps?: string[]; - /** The list of team \`slug\`s with push access */ - teams: string[]; - /** The list of user \`login\`s with push access */ - users: string[]; - } | null; - }, + orgsConvertMemberToOutsideCollaborator: ( + org: string, + username: string, params: RequestParams = {}, ) => this.request< - ProtectedBranch, - | BasicError + void, | { - documentation_url: string; - message: string; + documentation_url?: string; + message?: string; } - | ValidationErrorSimple + | BasicError >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, method: "PUT", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Removing a user from this list will remove them from all the organization's repositories. * - * @tags repos - * @name ReposDeleteBranchProtection - * @summary Delete branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags orgs + * @name OrgsRemoveOutsideCollaborator + * @summary Remove outside collaborator from an organization + * @request DELETE:/orgs/{org}/outside_collaborators/{username} */ - reposDeleteBranchProtection: ( - owner: string, - repo: string, - branch: string, + orgsRemoveOutsideCollaborator: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + this.request< + void, + { + documentation_url?: string; + message?: string; + } + >({ + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Lists the projects in an organization. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags repos - * @name ReposGetAdminBranchProtection - * @summary Get admin branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags projects + * @name ProjectsListForOrg + * @summary List organization projects + * @request GET:/orgs/{org}/projects */ - reposGetAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, + projectsListForOrg: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + this.request({ + path: \`/orgs/\${org}/projects\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @description Creates an organization project board. Returns a \`404 Not Found\` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags repos - * @name ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags projects + * @name ProjectsCreateForOrg + * @summary Create an organization project + * @request POST:/orgs/{org}/projects */ - reposSetAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, + projectsCreateForOrg: ( + org: string, + data: { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + this.request({ + path: \`/orgs/\${org}/projects\`, method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @description Members of an organization can choose to have their membership publicized or not. * - * @tags repos - * @name ReposDeleteAdminBranchProtection - * @summary Delete admin branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags orgs + * @name OrgsListPublicMembers + * @summary List public organization members + * @request GET:/orgs/{org}/public_members */ - reposDeleteAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, + orgsListPublicMembers: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/public_members\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * No description * - * @tags repos - * @name ReposGetPullRequestReviewProtection - * @summary Get pull request review protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - reposGetPullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, + orgsCheckPublicMembershipForUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, method: "GET", - format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. + * @description The user can publicize their own membership. (A user cannot publicize the membership for another user.) Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags repos - * @name ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags orgs + * @name OrgsSetPublicMembershipForAuthenticatedUser + * @summary Set public organization membership for the authenticated user + * @request PUT:/orgs/{org}/public_members/{username} */ - reposUpdatePullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, - data: { - /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ - dismiss_stale_reviews?: boolean; - /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ - dismissal_restrictions?: { - /** The list of team \`slug\`s with dismissal access */ - teams?: string[]; - /** The list of user \`login\`s with dismissal access */ - users?: string[]; - }; - /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ - require_code_owner_reviews?: boolean; - /** Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ - required_approving_review_count?: number; - }, + orgsSetPublicMembershipForAuthenticatedUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "PUT", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * No description * - * @tags repos - * @name ReposDeletePullRequestReviewProtection - * @summary Delete pull request review protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} */ - reposDeletePullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, + orgsRemovePublicMembershipForAuthenticatedUser: ( + org: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. + * @description Lists repositories for the specified organization. * * @tags repos - * @name ReposGetCommitSignatureProtection - * @summary Get commit signature protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @name ReposListForOrg + * @summary List organization repositories + * @request GET:/orgs/{org}/repos */ - reposGetCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, + reposListForOrg: ( + org: string, + query?: { + /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "created" + */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** Specifies the types of repositories you want returned. Can be one of \`all\`, \`public\`, \`private\`, \`forks\`, \`sources\`, \`member\`, \`internal\`. Default: \`all\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`type\` can also be \`internal\`. */ + type?: + | "all" + | "public" + | "private" + | "forks" + | "sources" + | "member" + | "internal"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + this.request({ + path: \`/orgs/\${org}/repos\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. + * @description Creates a new repository in the specified organization. The authenticated user must be a member of the organization. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository * * @tags repos - * @name ReposCreateCommitSignatureProtection - * @summary Create commit signature protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @name ReposCreateInOrg + * @summary Create an organization repository + * @request POST:/orgs/{org}/repos */ - reposCreateCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, + reposCreateInOrg: ( + org: string, + data: { + /** + * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. + * @default true + */ + allow_merge_commit?: boolean; + /** + * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. + * @default true + */ + allow_rebase_merge?: boolean; + /** + * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. + * @default true + */ + allow_squash_merge?: boolean; + /** + * Pass \`true\` to create an initial commit with empty README. + * @default false + */ + auto_init?: boolean; + /** + * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. + * @default false + */ + delete_branch_on_merge?: boolean; + /** A short description of the repository. */ + description?: string; + /** Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ + gitignore_template?: string; + /** + * Either \`true\` to enable issues for this repository or \`false\` to disable them. + * @default true + */ + has_issues?: boolean; + /** + * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. + * @default true + */ + has_projects?: boolean; + /** + * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. + * @default true + */ + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. + * @default false + */ + is_template?: boolean; + /** Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the \`license_template\` string. For example, "mit" or "mpl-2.0". */ + license_template?: string; + /** The name of the repository. */ + name: string; + /** + * Either \`true\` to create a private repository or \`false\` to create a public one. + * @default false + */ + private?: boolean; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; + /** + * Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. + * The \`visibility\` parameter overrides the \`private\` parameter when you use both parameters with the \`nebula-preview\` preview header. + */ + visibility?: "public" | "private" | "visibility" | "internal"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + this.request({ + path: \`/orgs/\${org}/repos\`, method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. - * - * @tags repos - * @name ReposDeleteCommitSignatureProtection - * @summary Delete commit signature protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures - */ - reposDeleteCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "DELETE", - ...params, - }), - - /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags repos - * @name ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags billing + * @name BillingGetGithubActionsBillingOrg + * @summary Get GitHub Actions billing for an organization + * @request GET:/orgs/{org}/settings/billing/actions */ - reposGetStatusChecksProtection: ( - owner: string, - repo: string, - branch: string, + billingGetGithubActionsBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + this.request({ + path: \`/orgs/\${org}/settings/billing/actions\`, method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + * @description Gets the free and paid storage usued for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags repos - * @name ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags billing + * @name BillingGetGithubPackagesBillingOrg + * @summary Get GitHub Packages billing for an organization + * @request GET:/orgs/{org}/settings/billing/packages */ - reposUpdateStatusCheckProtection: ( - owner: string, - repo: string, - branch: string, - data: { - /** The list of status checks to require in order to merge into this branch */ - contexts?: string[]; - /** Require branches to be up to date before merging. */ - strict?: boolean; - }, + billingGetGithubPackagesBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/settings/billing/packages\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`repo\` or \`admin:org\` scope. * - * @tags repos - * @name ReposRemoveStatusCheckProtection - * @summary Remove status check protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags billing + * @name BillingGetSharedStorageBillingOrg + * @summary Get shared storage billing for an organization + * @request GET:/orgs/{org}/settings/billing/shared-storage */ - reposRemoveStatusCheckProtection: ( - owner: string, - repo: string, - branch: string, + billingGetSharedStorageBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/settings/billing/shared-storage\`, + method: "GET", + format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups available in an organization. You can limit your page results using the \`per_page\` parameter. GitHub generates a url-encoded \`page\` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." The \`per_page\` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user \`octocat\` wants to see two groups per page in \`octo-org\` via cURL, it would look like this: * - * @tags repos - * @name ReposGetAllStatusCheckContexts - * @summary Get all status check contexts - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags teams + * @name TeamsListIdpGroupsForOrg + * @summary List IdP groups for an organization + * @request GET:/orgs/{org}/team-sync/groups */ - reposGetAllStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, + teamsListIdpGroupsForOrg: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + this.request({ + path: \`/orgs/\${org}/team-sync/groups\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Lists all teams in an organization that are visible to the authenticated user. * - * @tags repos - * @name ReposAddStatusCheckContexts - * @summary Add status check contexts - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags teams + * @name TeamsList + * @summary List teams + * @request GET:/orgs/{org}/teams */ - reposAddStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, - data: { - /** contexts parameter */ - contexts: string[]; + teamsList: ( + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". * - * @tags repos - * @name ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags teams + * @name TeamsCreate + * @summary Create a team + * @request POST:/orgs/{org}/teams */ - reposSetStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, + teamsCreate: ( + org: string, data: { - /** contexts parameter */ - contexts: string[]; + /** The description of the team. */ + description?: string; + /** List GitHub IDs for organization members who will become team maintainers. */ + maintainers?: string[]; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ + permission?: "pull" | "push" | "admin"; + /** + * The level of privacy this team should have. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * Default: \`secret\` + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + * Default for child team: \`closed\` + */ + privacy?: "secret" | "closed"; + /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ + repo_names?: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -26558,114 +24490,155 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description Gets a team using the team's \`slug\`. GitHub generates the \`slug\` from the team \`name\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`. * - * @tags repos - * @name ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags teams + * @name TeamsGetByName + * @summary Get a team by name + * @request GET:/orgs/{org}/teams/{team_slug} */ - reposRemoveStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, - data: { - /** contexts parameter */ - contexts: string[]; - }, + teamsGetByName: ( + org: string, + teamSlug: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. + * @description To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`. * - * @tags repos - * @name ReposGetAccessRestrictions - * @summary Get access restrictions - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags teams + * @name TeamsUpdateInOrg + * @summary Update a team + * @request PATCH:/orgs/{org}/teams/{team_slug} */ - reposGetAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsUpdateInOrg: ( + org: string, + teamSlug: string, + data: { + /** The description of the team. */ + description?: string; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ + permission?: "pull" | "push" | "admin"; + /** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. When a team is nested, the \`privacy\` for parent teams cannot be \`secret\`. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + */ + privacy?: "secret" | "closed"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. + * @description To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`. * - * @tags repos - * @name ReposDeleteAccessRestrictions - * @summary Delete access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags teams + * @name TeamsDeleteInOrg + * @summary Delete a team + * @request DELETE:/orgs/{org}/teams/{team_slug} */ - reposDeleteAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsDeleteInOrg: ( + org: string, + teamSlug: string, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + path: \`/orgs/\${org}/teams/\${teamSlug}\`, method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. + * @description List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`. * - * @tags repos - * @name ReposGetAppsWithAccessToProtectedBranch - * @summary Get apps with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags teams + * @name TeamsListDiscussionsInOrg + * @summary List discussions + * @request GET:/orgs/{org}/teams/{team_slug}/discussions */ - reposGetAppsWithAccessToProtectedBranch: ( - owner: string, - repo: string, - branch: string, + teamsListDiscussionsInOrg: ( + org: string, + teamSlug: string, + query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`. * - * @tags repos - * @name ReposAddAppAccessRestrictions - * @summary Add app access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags teams + * @name TeamsCreateDiscussionInOrg + * @summary Create a discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions */ - reposAddAppAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsCreateDiscussionInOrg: ( + org: string, + teamSlug: string, data: { - /** apps parameter */ - apps: string[]; + /** The discussion post's body text. */ + body: string; + /** + * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * @default false + */ + private?: boolean; + /** The discussion post's title. */ + title: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, method: "POST", body: data, type: ContentType.Json, @@ -26674,53 +24647,49 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags repos - * @name ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags teams + * @name TeamsGetDiscussionInOrg + * @summary Get a discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - reposSetAppAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** apps parameter */ - apps: string[]; - }, + teamsGetDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags repos - * @name ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags teams + * @name TeamsUpdateDiscussionInOrg + * @summary Update a discussion + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - reposRemoveAppAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsUpdateDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, data: { - /** apps parameter */ - apps: string[]; + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -26728,46 +24697,84 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. + * @description Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`. * - * @tags repos - * @name ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags teams + * @name TeamsDeleteDiscussionInOrg + * @summary Delete a discussion + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + */ + teamsDeleteDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "DELETE", + ...params, + }), + + /** + * @description List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. + * + * @tags teams + * @name TeamsListDiscussionCommentsInOrg + * @summary List discussion comments + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - reposGetTeamsWithAccessToProtectedBranch: ( - owner: string, - repo: string, - branch: string, + teamsListDiscussionCommentsInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`. * - * @tags repos - * @name ReposAddTeamAccessRestrictions - * @summary Add team access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags teams + * @name TeamsCreateDiscussionCommentInOrg + * @summary Create a discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - reposAddTeamAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsCreateDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, data: { - /** teams parameter */ - teams: string[]; + /** The discussion comment's body text. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, method: "POST", body: data, type: ContentType.Json, @@ -26776,53 +24783,49 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags repos - * @name ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags teams + * @name TeamsGetDiscussionCommentInOrg + * @summary Get a discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - reposSetTeamAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** teams parameter */ - teams: string[]; - }, + teamsGetDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "GET", format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags repos - * @name ReposRemoveTeamAccessRestrictions - * @summary Remove team access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags teams + * @name TeamsUpdateDiscussionCommentInOrg + * @summary Update a discussion comment + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - reposRemoveTeamAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + teamsUpdateDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, data: { - /** teams parameter */ - teams: string[]; + /** The discussion comment's body text. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -26830,74 +24833,101 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. + * @description Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`. * - * @tags repos - * @name ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags teams + * @name TeamsDeleteDiscussionCommentInOrg + * @summary Delete a discussion comment + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - reposGetUsersWithAccessToProtectedBranch: ( - owner: string, - repo: string, - branch: string, + teamsDeleteDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * - * @tags repos - * @name ReposAddUserAccessRestrictions - * @summary Add user access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags reactions + * @name ReactionsListForTeamDiscussionCommentInOrg + * @summary List reactions for a team discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - reposAddUserAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** users parameter */ - users: string[]; + reactionsListForTeamDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, + query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`. * - * @tags repos - * @name ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags reactions + * @name ReactionsCreateForTeamDiscussionCommentInOrg + * @summary Create reaction for a team discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions */ - reposSetUserAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + reactionsCreateForTeamDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, data: { - /** users parameter */ - users: string[]; + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -26905,183 +24935,99 @@ export class Api< }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags repos - * @name ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users - */ - reposRemoveUserAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** users parameter */ - users: string[]; - }, + * @tags reactions + * @name ReactionsDeleteForTeamDiscussionComment + * @summary Delete team discussion comment reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id} + */ + reactionsDeleteForTeamDiscussionComment: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, method: "DELETE", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. + * @description List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * - * @tags repos - * @name ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @tags reactions + * @name ReactionsListForTeamDiscussionInOrg + * @summary List reactions for a team discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - reposRenameBranch: ( - owner: string, - repo: string, - branch: string, - data: { - /** The new name of the branch. */ - new_name: string; + reactionsListForTeamDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. + * @description Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`. * - * @tags checks - * @name ChecksCreate - * @summary Create a check run - * @request POST:/repos/{owner}/{repo}/check-runs + * @tags reactions + * @name ReactionsCreateForTeamDiscussionInOrg + * @summary Create reaction for a team discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - checksCreate: ( - owner: string, - repo: string, - data: ( - | { - status?: "completed"; - [key: string]: any; - } - | { - status?: "queued" | "in_progress"; - [key: string]: any; - } - ) & { - /** - * Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [\`check_run.requested_action\` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." - * @maxItems 3 - */ - actions?: { - /** - * A short explanation of what this action would do. The maximum size is 40 characters. - * @maxLength 40 - */ - description: string; - /** - * A reference for the action on the integrator's system. The maximum size is 20 characters. - * @maxLength 20 - */ - identifier: string; - /** - * The text to be displayed on a button in the web UI. The maximum size is 20 characters. - * @maxLength 20 - */ - label: string; - }[]; - /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - completed_at?: string; - /** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. - */ - conclusion?: - | "success" - | "failure" - | "neutral" - | "cancelled" - | "skipped" - | "timed_out" - | "action_required"; - /** The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. */ - details_url?: string; - /** A reference for the run on the integrator's system. */ - external_id?: string; - /** The SHA of the commit. */ - head_sha: string; - /** The name of the check. For example, "code-coverage". */ - name: string; - /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object) description. */ - output?: { - /** - * Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter. - * @maxItems 50 - */ - annotations?: { - /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ - annotation_level: "notice" | "warning" | "failure"; - /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - end_column?: number; - /** The end line of the annotation. */ - end_line: number; - /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ - message: string; - /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ - path: string; - /** Details about this annotation. The maximum size is 64 KB. */ - raw_details?: string; - /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - start_column?: number; - /** The start line of the annotation. */ - start_line: number; - /** The title that represents the annotation. The maximum size is 255 characters. */ - title?: string; - }[]; - /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#images-object) description for details. */ - images?: { - /** The alternative text for the image. */ - alt: string; - /** A short image description. */ - caption?: string; - /** The full URL of the image. */ - image_url: string; - }[]; - /** - * The summary of the check run. This parameter supports Markdown. - * @maxLength 65535 - */ - summary: string; - /** - * The details of the check run. This parameter supports Markdown. - * @maxLength 65535 - */ - text?: string; - /** The title of the check run. */ - title: string; - }; - /** The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - started_at?: string; - /** - * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. - * @default "queued" - */ - status?: "queued" | "in_progress" | "completed"; + reactionsCreateForTeamDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + data: { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -27090,165 +25036,70 @@ export class Api< }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description **Note:** You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`. Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags checks - * @name ChecksGet - * @summary Get a check run - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags reactions + * @name ReactionsDeleteForTeamDiscussion + * @summary Delete team discussion reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} */ - checksGet: ( - owner: string, - repo: string, - checkRunId: number, + reactionsDeleteForTeamDiscussion: ( + org: string, + teamSlug: string, + discussionNumber: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. + * @description The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`. * - * @tags checks - * @name ChecksUpdate - * @summary Update a check run - * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} - */ - checksUpdate: ( - owner: string, - repo: string, - checkRunId: number, - data: ( - | { - status?: "completed"; - [key: string]: any; - } - | { - status?: "queued" | "in_progress"; - [key: string]: any; - } - ) & { + * @tags teams + * @name TeamsListPendingInvitationsInOrg + * @summary List pending team invitations + * @request GET:/orgs/{org}/teams/{team_slug}/invitations + */ + teamsListPendingInvitationsInOrg: ( + org: string, + teamSlug: string, + query?: { /** - * Possible further actions the integrator can perform, which a user may trigger. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." - * @maxItems 3 + * Page number of the results to fetch. + * @default 1 */ - actions?: { - /** - * A short explanation of what this action would do. The maximum size is 40 characters. - * @maxLength 40 - */ - description: string; - /** - * A reference for the action on the integrator's system. The maximum size is 20 characters. - * @maxLength 20 - */ - identifier: string; - /** - * The text to be displayed on a button in the web UI. The maximum size is 20 characters. - * @maxLength 20 - */ - label: string; - }[]; - /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - completed_at?: string; + page?: number; /** - * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. - * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + * Results per page (max 100) + * @default 30 */ - conclusion?: - | "success" - | "failure" - | "neutral" - | "cancelled" - | "skipped" - | "timed_out" - | "action_required"; - /** The URL of the integrator's site that has the full details of the check. */ - details_url?: string; - /** A reference for the run on the integrator's system. */ - external_id?: string; - /** The name of the check. For example, "code-coverage". */ - name?: string; - /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object-1) description. */ - output?: { - /** - * Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. - * @maxItems 50 - */ - annotations?: { - /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ - annotation_level: "notice" | "warning" | "failure"; - /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - end_column?: number; - /** The end line of the annotation. */ - end_line: number; - /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ - message: string; - /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ - path: string; - /** Details about this annotation. The maximum size is 64 KB. */ - raw_details?: string; - /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ - start_column?: number; - /** The start line of the annotation. */ - start_line: number; - /** The title that represents the annotation. The maximum size is 255 characters. */ - title?: string; - }[]; - /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ - images?: { - /** The alternative text for the image. */ - alt: string; - /** A short image description. */ - caption?: string; - /** The full URL of the image. */ - image_url: string; - }[]; - /** - * Can contain Markdown. - * @maxLength 65535 - */ - summary: string; - /** - * Can contain Markdown. - * @maxLength 65535 - */ - text?: string; - /** **Required**. */ - title?: string; - }; - /** This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - started_at?: string; - /** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: "queued" | "in_progress" | "completed"; + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. + * @description Team members will include the members of child teams. To list members in a team, the team must be visible to the authenticated user. * - * @tags checks - * @name ChecksListAnnotations - * @summary List check run annotations - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + * @tags teams + * @name TeamsListMembersInOrg + * @summary List team members + * @request GET:/orgs/{org}/teams/{team_slug}/members */ - checksListAnnotations: ( - owner: string, - repo: string, - checkRunId: number, + teamsListMembersInOrg: ( + org: string, + teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -27260,11 +25111,19 @@ export class Api< * @default 30 */ per_page?: number; + /** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ + role?: "member" | "maintainer" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, method: "GET", query: query, format: "json", @@ -27272,59 +25131,62 @@ export class Api< }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. + * @description Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). * - * @tags checks - * @name ChecksCreateSuite - * @summary Create a check suite - * @request POST:/repos/{owner}/{repo}/check-suites + * @tags teams + * @name TeamsGetMembershipForUserInOrg + * @summary Get team membership for a user + * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - checksCreateSuite: ( - owner: string, - repo: string, - data: { - /** The sha of the head commit. */ - head_sha: string; - }, + teamsGetMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "GET", format: "json", ...params, }), /** - * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person 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. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`. * - * @tags checks - * @name ChecksSetSuitesPreferences - * @summary Update repository preferences for check suites - * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserInOrg + * @summary Add or update team membership for a user + * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - checksSetSuitesPreferences: ( - owner: string, - repo: string, + teamsAddOrUpdateMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, data: { - /** Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [\`auto_trigger_checks\` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ - auto_trigger_checks?: { - /** The \`id\` of the GitHub App. */ - app_id: number; - /** - * Set to \`true\` to enable automatic creation of CheckSuite events upon pushes to the repository, or \`false\` to disable them. - * @default true - */ - setting: boolean; - }[]; + /** + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" + */ + role?: "member" | "maintainer"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, - method: "PATCH", + this.request< + TeamMembership, + void | { + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; + } + >({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -27332,46 +25194,37 @@ export class Api< }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`. * - * @tags checks - * @name ChecksGetSuite - * @summary Get a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} + * @tags teams + * @name TeamsRemoveMembershipForUserInOrg + * @summary Remove team membership for a user + * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - checksGetSuite: ( - owner: string, - repo: string, - checkSuiteId: number, + teamsRemoveMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description Lists the organization projects for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects\`. * - * @tags checks - * @name ChecksListForSuite - * @summary List check runs in a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs - */ - checksListForSuite: ( - owner: string, - repo: string, - checkSuiteId: number, + * @tags teams + * @name TeamsListProjectsInOrg + * @summary List team projects + * @request GET:/orgs/{org}/teams/{team_slug}/projects + */ + teamsListProjectsInOrg: ( + org: string, + teamSlug: string, query?: { - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: "latest" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -27382,19 +25235,11 @@ export class Api< * @default 30 */ per_page?: number; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: "queued" | "in_progress" | "completed"; }, params: RequestParams = {}, ) => - this.request< - { - check_runs: CheckRun[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, method: "GET", query: query, format: "json", @@ -27402,53 +25247,111 @@ export class Api< }), /** - * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. + * @description Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. * - * @tags checks - * @name ChecksRerequestSuite - * @summary Rerequest a check suite - * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + * @tags teams + * @name TeamsCheckPermissionsForProjectInOrg + * @summary Check team permissions for a project + * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - checksRerequestSuite: ( - owner: string, - repo: string, - checkSuiteId: number, + teamsCheckPermissionsForProjectInOrg: ( + org: string, + teamSlug: string, + projectId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @description Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. * - * @tags code-scanning - * @name CodeScanningListAlertsForRepo - * @summary List code scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsInOrg + * @summary Add or update team project permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - codeScanningListAlertsForRepo: ( - owner: string, - repo: string, - query?: { - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAlertRef; - /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ - state?: CodeScanningAlertState; + teamsAddOrUpdateProjectPermissionsInOrg: ( + org: string, + teamSlug: string, + projectId: number, + data: { + /** + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + permission?: "read" | "write" | "admin"; }, params: RequestParams = {}, ) => this.request< - CodeScanningAlertCodeScanningAlertItems[], - void | { - code?: string; + void, + { documentation_url?: string; message?: string; } >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * @description Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. This endpoint removes the project from the team, but does not delete the project. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}\`. + * + * @tags teams + * @name TeamsRemoveProjectInOrg + * @summary Remove a project from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} + */ + teamsRemoveProjectInOrg: ( + org: string, + teamSlug: string, + projectId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Lists a team's repositories visible to the authenticated user. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`. + * + * @tags teams + * @name TeamsListReposInOrg + * @summary List team repositories + * @request GET:/orgs/{org}/teams/{team_slug}/repos + */ + teamsListReposInOrg: ( + org: string, + teamSlug: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, method: "GET", query: query, format: "json", @@ -27456,154 +25359,149 @@ export class Api< }), /** - * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. + * @description Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`application/vnd.github.v3.repository+json\` accept header. If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. * - * @tags code-scanning - * @name CodeScanningGetAlert - * @summary Get a code scanning alert - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags teams + * @name TeamsCheckPermissionsForRepoInOrg + * @summary Check team permissions for a repository + * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - codeScanningGetAlert: ( + teamsCheckPermissionsForRepoInOrg: ( + org: string, + teamSlug: string, owner: string, repo: string, - alertNumber: number, params: RequestParams = {}, ) => - this.request< - CodeScanningAlertCodeScanningAlert, - | void - | BasicError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "GET", format: "json", ...params, }), /** - * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @description To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". * - * @tags code-scanning - * @name CodeScanningUpdateAlert - * @summary Update a code scanning alert - * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsInOrg + * @summary Add or update team repository permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - codeScanningUpdateAlert: ( + teamsAddOrUpdateRepoPermissionsInOrg: ( + org: string, + teamSlug: string, owner: string, repo: string, - alertNumber: AlertNumber, data: { - /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ - dismissed_reason?: CodeScanningAlertDismissedReason; - /** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ - state: CodeScanningAlertSetState; + /** + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * \\* \`maintain\` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. + * \\* \`triage\` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. + */ + permission?: "pull" | "push" | "admin" | "maintain" | "triage"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * @description If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`. * - * @tags code-scanning - * @name CodeScanningListRecentAnalyses - * @summary List recent code scanning analyses for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/analyses + * @tags teams + * @name TeamsRemoveRepoInOrg + * @summary Remove a repository from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - codeScanningListRecentAnalyses: ( + teamsRemoveRepoInOrg: ( + org: string, + teamSlug: string, owner: string, repo: string, - query?: { - /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ - ref?: CodeScanningAnalysisRef; - /** Set a single code scanning tool name to filter alerts by tool. */ - tool_name?: CodeScanningAnalysisToolName; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "DELETE", ...params, }), /** - * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. * - * @tags code-scanning - * @name CodeScanningUploadSarif - * @summary Upload a SARIF file - * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs + * @tags teams + * @name TeamsListIdpGroupsInOrg + * @summary List IdP groups for a team + * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + */ + teamsListIdpGroupsInOrg: ( + org: string, + teamSlug: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings\`. + * + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg + * @summary Create or update IdP group connections + * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - codeScanningUploadSarif: ( - owner: string, - repo: string, + teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + org: string, + teamSlug: string, data: { - /** - * The base directory used in the analysis, as it appears in the SARIF file. - * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. - * @format uri - * @example "file:///github/workspace/" - */ - checkout_uri?: string; - /** The commit SHA of the code scanning analysis file. */ - commit_sha: CodeScanningAnalysisCommitSha; - /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ - ref: CodeScanningAnalysisRef; - /** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ - sarif: CodeScanningAnalysisSarifFile; - /** - * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. - * @format date - */ - started_at?: string; - /** The name of the tool used to generate the code scanning analysis alert. */ - tool_name: CodeScanningAnalysisToolName; + /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups: { + /** Description of the IdP group. */ + group_description: string; + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + }[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * @description Lists the child teams of the team specified by \`{team_slug}\`. **Note:** You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`. * - * @tags repos - * @name ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @tags teams + * @name TeamsListChildInOrg + * @summary List child teams + * @request GET:/orgs/{org}/teams/{team_slug}/teams */ - reposListCollaborators: ( - owner: string, - repo: string, + teamsListChildInOrg: ( + org: string, + teamSlug: string, query?: { - /** - * Filter collaborators returned by their affiliation. Can be one of: - * \\* \`outside\`: All outside collaborators of an organization-owned repository. - * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \\* \`all\`: All collaborators the authenticated user can see. - * @default "all" - */ - affiliation?: "outside" | "direct" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -27617,65 +25515,58 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, method: "GET", query: query, format: "json", ...params, }), - + }; + projects = { /** - * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. + * No description * - * @tags repos - * @name ReposCheckCollaborator - * @summary Check if a user is a repository collaborator - * @request GET:/repos/{owner}/{repo}/collaborators/{username} + * @tags projects + * @name ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - reposCheckCollaborator: ( - owner: string, - repo: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + projectsGetCard: (cardId: number, params: RequestParams = {}) => + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, method: "GET", + format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + * No description * - * @tags repos - * @name ReposAddCollaborator - * @summary Add a repository collaborator - * @request PUT:/repos/{owner}/{repo}/collaborators/{username} + * @tags projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - reposAddCollaborator: ( - owner: string, - repo: string, - username: string, + projectsUpdateCard: ( + cardId: number, data: { /** - * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: - * \\* \`pull\` - can pull, but not push to or administer this repository. - * \\* \`push\` - can pull and push, but not administer this repository. - * \\* \`admin\` - can pull, push and administer this repository. - * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. - * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. - * @default "push" + * Whether or not the card is archived + * @example false */ - permission?: "pull" | "push" | "admin" | "maintain" | "triage"; - /** @example ""push"" */ - permissions?: string; + archived?: boolean; + /** + * The project card's note + * @example "Update all gems" + */ + note?: string | null; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "PUT", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -27685,73 +25576,79 @@ export class Api< /** * No description * - * @tags repos - * @name ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @tags projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - reposRemoveCollaborator: ( - owner: string, - repo: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + projectsDeleteCard: (cardId: number, params: RequestParams = {}) => + this.request< + void, + | BasicError + | { + documentation_url?: string; + errors?: string[]; + message?: string; + } + >({ + path: \`/projects/columns/cards/\${cardId}\`, method: "DELETE", ...params, }), /** - * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. - * - * @tags repos - * @name ReposGetCollaboratorPermissionLevel - * @summary Get repository permissions for a user - * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission - */ - reposGetCollaboratorPermissionLevel: ( - owner: string, - repo: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. + * No description * - * @tags repos - * @name ReposListCommitCommentsForRepo - * @summary List commit comments for a repository - * @request GET:/repos/{owner}/{repo}/comments + * @tags projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - reposListCommitCommentsForRepo: ( - owner: string, - repo: string, - query?: { + projectsMoveCard: ( + cardId: number, + data: { /** - * Page number of the results to fetch. - * @default 1 + * The unique identifier of the column the card should be moved to + * @example 42 */ - page?: number; + column_id?: number; /** - * Results per page (max 100) - * @default 30 + * The position of the card in a column + * @pattern ^(?:top|bottom|after:\\d+)$ + * @example "bottom" */ - per_page?: number; + position: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments\`, - method: "GET", - query: query, + this.request< + object, + | BasicError + | { + documentation_url?: string; + errors?: { + code?: string; + field?: string; + message?: string; + resource?: string; + }[]; + message?: string; + } + | ValidationError + | { + code?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + message?: string; + } + >({ + path: \`/projects/columns/cards/\${cardId}/moves\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -27759,19 +25656,14 @@ export class Api< /** * No description * - * @tags repos - * @name ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @tags projects + * @name ProjectsGetColumn + * @summary Get a project column + * @request GET:/projects/columns/{column_id} */ - reposGetCommitComment: ( - owner: string, - repo: string, - commentId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + projectsGetColumn: (columnId: number, params: RequestParams = {}) => + this.request({ + path: \`/projects/columns/\${columnId}\`, method: "GET", format: "json", ...params, @@ -27780,23 +25672,24 @@ export class Api< /** * No description * - * @tags repos - * @name ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - reposUpdateCommitComment: ( - owner: string, - repo: string, - commentId: number, + projectsUpdateColumn: ( + columnId: number, data: { - /** The contents of the comment */ - body: string; + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + this.request({ + path: \`/projects/columns/\${columnId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -27807,46 +25700,34 @@ export class Api< /** * No description * - * @tags repos - * @name ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @tags projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - reposDeleteCommitComment: ( - owner: string, - repo: string, - commentId: number, - params: RequestParams = {}, - ) => + projectsDeleteColumn: (columnId: number, params: RequestParams = {}) => this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + path: \`/projects/columns/\${columnId}\`, method: "DELETE", ...params, }), /** - * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * No description * - * @tags reactions - * @name ReactionsListForCommitComment - * @summary List reactions for a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - reactionsListForCommitComment: ( - owner: string, - repo: string, - commentId: number, + projectsListCards: ( + columnId: number, query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" + */ + archived_state?: "all" | "archived" | "not_archived"; /** * Page number of the results to fetch. * @default 1 @@ -27860,15 +25741,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, method: "GET", query: query, format: "json", @@ -27876,40 +25750,52 @@ export class Api< }), /** - * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. + * @description **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags reactions - * @name ReactionsCreateForCommitComment - * @summary Create reaction for a commit comment - * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags projects + * @name ProjectsCreateCard + * @summary Create a project card + * @request POST:/projects/columns/{column_id}/cards */ - reactionsCreateForCommitComment: ( - owner: string, - repo: string, - commentId: number, - data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; - }, + projectsCreateCard: ( + columnId: number, + data: + | { + /** + * The project card's note + * @example "Update all gems" + */ + note: string | null; + } + | { + /** + * The unique identifier of the content associated with the card + * @example 42 + */ + content_id: number; + /** + * The piece of content associated with the card + * @example "PullRequest" + */ + content_type: string; + }, params: RequestParams = {}, ) => this.request< - Reaction, + ProjectCard, + | BasicError + | (ValidationError | ValidationErrorSimple) | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + message?: string; } - | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + path: \`/projects/columns/\${columnId}/cards\`, method: "POST", body: data, type: ContentType.Json, @@ -27918,110 +25804,144 @@ export class Api< }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * No description * - * @tags reactions - * @name ReactionsDeleteForCommitComment - * @summary Delete a commit comment reaction - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - reactionsDeleteForCommitComment: ( - owner: string, - repo: string, - commentId: number, - reactionId: number, + projectsMoveColumn: ( + columnId: number, + data: { + /** + * The position of the column in a project + * @pattern ^(?:first|last|after:\\d+)$ + * @example "last" + */ + position: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/projects/columns/\${columnId}/moves\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Gets a project by its \`id\`. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags repos - * @name ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @tags projects + * @name ProjectsGet + * @summary Get a project + * @request GET:/projects/{project_id} */ - reposListCommits: ( - owner: string, - repo: string, - query?: { - /** GitHub login or email address by which to filter by commit author. */ - author?: string; + projectsGet: (projectId: number, params: RequestParams = {}) => + this.request({ + path: \`/projects/\${projectId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Updates a project board's information. Returns a \`404 Not Found\` status if projects are disabled. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * + * @tags projects + * @name ProjectsUpdate + * @summary Update a project + * @request PATCH:/projects/{project_id} + */ + projectsUpdate: ( + projectId: number, + data: { /** - * Page number of the results to fetch. - * @default 1 + * Body of the project + * @example "This project represents the sprint of the first week in January" */ - page?: number; - /** Only commits containing this file path will be returned. */ - path?: string; + body?: string | null; /** - * Results per page (max 100) - * @default 30 + * Name of the project + * @example "Week One Sprint" */ - per_page?: number; - /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ - sha?: string; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - until?: string; + name?: string; + /** The baseline permission that all organization members have on this project */ + organization_permission?: "read" | "write" | "admin" | "none"; + /** Whether or not this project can be seen by everyone. */ + private?: boolean; + /** + * State of the project; either 'open' or 'closed' + * @example "open" + */ + state?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits\`, - method: "GET", - query: query, + this.request< + Project, + | BasicError + | { + documentation_url?: string; + errors?: string[]; + message?: string; + } + | void + | ValidationErrorSimple + >({ + path: \`/projects/\${projectId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. * - * @tags repos - * @name ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @tags projects + * @name ProjectsDelete + * @summary Delete a project + * @request DELETE:/projects/{project_id} */ - reposListBranchesForHeadCommit: ( - owner: string, - repo: string, - commitSha: string, - params: RequestParams = {}, - ) => + projectsDelete: (projectId: number, params: RequestParams = {}) => this.request< - BranchShort[], + void, + | BasicError | { - documentation_url: string; - message: string; + documentation_url?: string; + errors?: string[]; + message?: string; } - | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, - method: "GET", - format: "json", + path: \`/projects/\${projectId}\`, + method: "DELETE", ...params, }), /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * @description Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project \`admin\` to list collaborators. * - * @tags repos - * @name ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @tags projects + * @name ProjectsListCollaborators + * @summary List project collaborators + * @request GET:/projects/{project_id}/collaborators */ - reposListCommentsForCommit: ( - owner: string, - repo: string, - commitSha: string, + projectsListCollaborators: ( + projectId: number, query?: { + /** + * Filters the collaborators by their affiliation. Can be one of: + * \\* \`outside\`: Outside collaborators of a project that are not a member of the project's organization. + * \\* \`direct\`: Collaborators with permissions to a project, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ + affiliation?: "outside" | "direct" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -28035,8 +25955,16 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + this.request< + SimpleUser[], + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators\`, method: "GET", query: query, format: "json", @@ -28044,168 +25972,108 @@ export class Api< }), /** - * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project \`admin\` to add a collaborator. * - * @tags repos - * @name ReposCreateCommitComment - * @summary Create a commit comment - * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @tags projects + * @name ProjectsAddCollaborator + * @summary Add project collaborator + * @request PUT:/projects/{project_id}/collaborators/{username} */ - reposCreateCommitComment: ( - owner: string, - repo: string, - commitSha: string, + projectsAddCollaborator: ( + projectId: number, + username: string, data: { - /** The contents of the comment. */ - body: string; - /** **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ - line?: number; - /** Relative path of the file to comment on. */ - path?: string; - /** Line index in the diff to comment on. */ - position?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. - * - * @tags repos - * @name ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls - */ - reposListPullRequestsAssociatedWithCommit: ( - owner: string, - repo: string, - commitSha: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; /** - * Results per page (max 100) - * @default 30 + * The permission to grant the collaborator. + * @default "write" + * @example "write" */ - per_page?: number; + permission?: "read" | "write" | "admin"; }, params: RequestParams = {}, ) => this.request< - PullRequestSimple[], - { - documentation_url: string; - message: string; - } + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, - method: "GET", - query: query, - format: "json", + path: \`/projects/\${projectId}/collaborators/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. * - * @tags repos - * @name ReposGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/commits/{ref} + * @tags projects + * @name ProjectsRemoveCollaborator + * @summary Remove user as a collaborator + * @request DELETE:/projects/{project_id}/collaborators/{username} */ - reposGetCommit: ( - owner: string, - repo: string, - ref: string, + projectsRemoveCollaborator: ( + projectId: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, - method: "GET", - format: "json", + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * @description Returns the collaborator's permission level for an organization project. Possible values for the \`permission\` key: \`admin\`, \`write\`, \`read\`, \`none\`. You must be an organization owner or a project \`admin\` to review a user's permission level. * - * @tags checks - * @name ChecksListForRef - * @summary List check runs for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs + * @tags projects + * @name ProjectsGetPermissionForUser + * @summary Get project permission for a user + * @request GET:/projects/{project_id}/collaborators/{username}/permission */ - checksListForRef: ( - owner: string, - repo: string, - ref: string, - query?: { - /** Returns check runs with the specified \`name\`. */ - check_name?: string; - /** - * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. - * @default "latest" - */ - filter?: "latest" | "all"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ - status?: "queued" | "in_progress" | "completed"; - }, + projectsGetPermissionForUser: ( + projectId: number, + username: string, params: RequestParams = {}, ) => this.request< - { - check_runs: CheckRun[]; - total_count: number; - }, - any + RepositoryCollaboratorPermission, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, + path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. + * No description * - * @tags checks - * @name ChecksListSuitesForRef - * @summary List check suites for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites + * @tags projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - checksListSuitesForRef: ( - owner: string, - repo: string, - ref: string, + projectsListColumns: ( + projectId: number, query?: { - /** - * Filters check suites by GitHub App \`id\`. - * @example 1 - */ - app_id?: number; - /** Returns check runs with the specified \`name\`. */ - check_name?: string; /** * Page number of the results to fetch. * @default 1 @@ -28219,14 +26087,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - check_suites: CheckSuite[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, + this.request({ + path: \`/projects/\${projectId}/columns\`, method: "GET", query: query, format: "json", @@ -28234,465 +26096,440 @@ export class Api< }), /** - * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` + * No description * - * @tags repos - * @name ReposGetCombinedStatusForRef - * @summary Get the combined status for a specific reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - reposGetCombinedStatusForRef: ( - owner: string, - repo: string, - ref: string, + projectsCreateColumn: ( + projectId: number, + data: { + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, + this.request({ + path: \`/projects/\${projectId}/columns\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + rateLimit = { + /** + * @description **Note:** Accessing this endpoint does not count against your REST API rate limit. **Note:** The \`rate\` object is deprecated. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object. + * + * @tags rate-limit + * @name RateLimitGet + * @summary Get rate limit status for the authenticated user + * @request GET:/rate_limit + */ + rateLimitGet: (params: RequestParams = {}) => + this.request({ + path: \`/rate_limit\`, + method: "GET", + format: "json", + ...params, + }), + }; + reactions = { + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + * + * @tags reactions + * @name ReactionsDeleteLegacy + * @summary Delete a reaction (Legacy) + * @request DELETE:/reactions/{reaction_id} + * @deprecated + */ + reactionsDeleteLegacy: (reactionId: number, params: RequestParams = {}) => + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/reactions/\${reactionId}\`, + method: "DELETE", + ...params, + }), + }; + repos = { + /** + * @description When you pass the \`scarlet-witch-preview\` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network. + * + * @tags repos + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} + */ + reposGet: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}\`, method: "GET", format: "json", ...params, }), /** - * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. + * @description **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. * * @tags repos - * @name ReposListCommitStatusesForRef - * @summary List commit statuses for a reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + * @name ReposUpdate + * @summary Update a repository + * @request PATCH:/repos/{owner}/{repo} */ - reposListCommitStatusesForRef: ( + reposUpdate: ( owner: string, repo: string, - ref: string, - query?: { + data: { /** - * Page number of the results to fetch. - * @default 1 + * Either \`true\` to allow merging pull requests with a merge commit, or \`false\` to prevent merging pull requests with merge commits. + * @default true */ - page?: number; + allow_merge_commit?: boolean; /** - * Results per page (max 100) - * @default 30 + * Either \`true\` to allow rebase-merging pull requests, or \`false\` to prevent rebase-merging. + * @default true */ - per_page?: number; + allow_rebase_merge?: boolean; + /** + * Either \`true\` to allow squash-merging pull requests, or \`false\` to prevent squash-merging. + * @default true + */ + allow_squash_merge?: boolean; + /** + * \`true\` to archive this repository. **Note**: You cannot unarchive repositories through the API. + * @default false + */ + archived?: boolean; + /** Updates the default branch for this repository. */ + default_branch?: string; + /** + * Either \`true\` to allow automatically deleting head branches when pull requests are merged, or \`false\` to prevent automatic deletion. + * @default false + */ + delete_branch_on_merge?: boolean; + /** A short description of the repository. */ + description?: string; + /** + * Either \`true\` to enable issues for this repository or \`false\` to disable them. + * @default true + */ + has_issues?: boolean; + /** + * Either \`true\` to enable projects for this repository or \`false\` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is \`false\`, and if you pass \`true\`, the API returns an error. + * @default true + */ + has_projects?: boolean; + /** + * Either \`true\` to enable the wiki for this repository or \`false\` to disable it. + * @default true + */ + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Either \`true\` to make this repo available as a template repository or \`false\` to prevent it. + * @default false + */ + is_template?: boolean; + /** The name of the repository. */ + name?: string; + /** + * Either \`true\` to make the repository private or \`false\` to make it public. Default: \`false\`. + * **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a \`422\` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + * @default false + */ + private?: boolean; + /** Can be \`public\` or \`private\`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, \`visibility\` can also be \`internal\`. The \`visibility\` parameter overrides the \`private\` parameter when you use both along with the \`nebula-preview\` preview header. */ + visibility?: "public" | "private" | "visibility" | "internal"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. + * @description Deleting a repository requires admin access. If OAuth is used, the \`delete_repo\` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a \`403 Forbidden\` response. * - * @tags codes-of-conduct - * @name CodesOfConductGetForRepo - * @summary Get the code of conduct for a repository - * @request GET:/repos/{owner}/{repo}/community/code_of_conduct + * @tags repos + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - codesOfConductGetForRepo: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, - method: "GET", - format: "json", + reposDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request< + void, + | { + documentation_url?: string; + message?: string; + } + | BasicError + >({ + path: \`/repos/\${owner}/\${repo}\`, + method: "DELETE", ...params, }), /** - * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. + * @description Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposGetCommunityProfileMetrics - * @summary Get community profile metrics - * @request GET:/repos/{owner}/{repo}/community/profile + * @tags actions + * @name ActionsListArtifactsForRepo + * @summary List artifacts for a repository + * @request GET:/repos/{owner}/{repo}/actions/artifacts */ - reposGetCommunityProfileMetrics: ( + actionsListArtifactsForRepo: ( owner: string, repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/profile\`, + this.request< + { + artifacts: Artifact[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCompareCommits - * @summary Compare two commits - * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} + * @tags actions + * @name ActionsGetArtifact + * @summary Get an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposCompareCommits: ( + actionsGetArtifact: ( owner: string, repo: string, - base: string, - head: string, + artifactId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. + * @description Deletes an artifact for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposGetContent - * @summary Get repository content - * @request GET:/repos/{owner}/{repo}/contents/{path} + * @tags actions + * @name ActionsDeleteArtifact + * @summary Delete an artifact + * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposGetContent: ( + actionsDeleteArtifact: ( owner: string, repo: string, - path: string, - query?: { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; - }, + artifactId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + method: "DELETE", ...params, }), /** - * @description Creates a new file or replaces an existing file in a repository. + * @description Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateOrUpdateFileContents - * @summary Create or update file contents - * @request PUT:/repos/{owner}/{repo}/contents/{path} + * @tags actions + * @name ActionsDownloadArtifact + * @summary Download an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} */ - reposCreateOrUpdateFileContents: ( + actionsDownloadArtifact: ( owner: string, repo: string, - path: string, - data: { - /** The author of the file. Default: The \`committer\` or the authenticated user if you omit \`committer\`. */ - author?: { - /** @example ""2013-01-15T17:13:22+05:00"" */ - date?: string; - /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ - email: string; - /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ - name: string; - }; - /** The branch name. Default: the repository’s default branch (usually \`master\`) */ - branch?: string; - /** The person that committed the file. Default: the authenticated user. */ - committer?: { - /** @example ""2013-01-05T13:13:22+05:00"" */ - date?: string; - /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ - email: string; - /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ - name: string; - }; - /** The new file content, using Base64 encoding. */ - content: string; - /** The commit message. */ - message: string; - /** **Required if you are updating a file**. The blob SHA of the file being replaced. */ - sha?: string; - }, + artifactId: number, + archiveFormat: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, + method: "GET", ...params, }), /** - * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. + * @description Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposDeleteFile - * @summary Delete a file - * @request DELETE:/repos/{owner}/{repo}/contents/{path} + * @tags actions + * @name ActionsGetJobForWorkflowRun + * @summary Get a job for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} */ - reposDeleteFile: ( + actionsGetJobForWorkflowRun: ( owner: string, repo: string, - path: string, - data: { - /** object containing information about the author. */ - author?: { - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The branch name. Default: the repository’s default branch (usually \`master\`) */ - branch?: string; - /** object containing information about the committer. */ - committer?: { - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The commit message. */ - message: string; - /** The blob SHA of the file being replaced. */ - sha: string; - }, + jobId: number, params: RequestParams = {}, ) => - this.request< - FileCommit, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. + * @description Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @tags actions + * @name ActionsDownloadJobLogsForWorkflowRun + * @summary Download job logs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs */ - reposListContributors: ( + actionsDownloadJobLogsForWorkflowRun: ( owner: string, repo: string, - query?: { - /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ - anon?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + jobId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contributors\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description Simple filtering of deployments is available via query parameters: + * @description Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @tags actions + * @name ActionsGetGithubActionsPermissionsRepository + * @summary Get GitHub Actions permissions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions */ - reposListDeployments: ( + actionsGetGithubActionsPermissionsRepository: ( owner: string, repo: string, - query?: { - /** - * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). - * @default "none" - */ - environment?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * The name of the ref. This can be a branch, tag, or SHA. - * @default "none" - */ - ref?: string; - /** - * The SHA recorded at creation time. - * @default "none" - */ - sha?: string; - /** - * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "none" - */ - task?: string; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. + * @description Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as \`allowed_actions\` to \`selected\` actions, then you cannot override them for the repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposCreateDeployment - * @summary Create a deployment - * @request POST:/repos/{owner}/{repo}/deployments + * @tags actions + * @name ActionsSetGithubActionsPermissionsRepository + * @summary Set GitHub Actions permissions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions */ - reposCreateDeployment: ( + actionsSetGithubActionsPermissionsRepository: ( owner: string, repo: string, data: { - /** - * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. - * @default true - */ - auto_merge?: boolean; - /** @example ""1776-07-04T00:00:00.000-07:52"" */ - created_at?: string; - /** - * Short description of the deployment. - * @default "" - */ - description?: string | null; - /** - * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). - * @default "production" - */ - environment?: string; - /** JSON payload with extra information about the deployment. */ - payload?: Record | string; - /** - * Specifies if the given environment is one that end-users directly interact with. Default: \`true\` when \`environment\` is \`production\` and \`false\` otherwise. - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - */ - production_environment?: boolean; - /** The ref to deploy. This can be a branch, tag, or SHA. */ - ref: string; - /** The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ - required_contexts?: string[]; - /** - * Specifies a task to execute (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "deploy" - */ - task?: string; - /** - * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: \`false\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default false - */ - transient_environment?: boolean; + /** The permissions policy that controls the actions that are allowed to run. Can be one of: \`all\`, \`local_only\`, or \`selected\`. */ + allowed_actions?: AllowedActions; + /** Whether GitHub Actions is enabled on the repository. */ + enabled: ActionsEnabled; }, params: RequestParams = {}, ) => - this.request< - Deployment, - | { - /** @example ""https://docs.github.com/rest/reference/repos#create-a-deployment"" */ - documentation_url?: string; - message?: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/deployments\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags actions + * @name ActionsGetAllowedActionsRepository + * @summary Get allowed actions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - reposGetDeployment: ( + actionsGetAllowedActionsRepository: ( owner: string, repo: string, - deploymentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, method: "GET", format: "json", ...params, }), /** - * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." + * @description Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." If the repository belongs to an organization or enterprise that has \`selected\` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. To use the \`patterns_allowed\` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the \`patterns_allowed\` setting only applies to public repositories. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`administration\` repository permission to use this API. * - * @tags repos - * @name ReposDeleteDeployment - * @summary Delete a deployment - * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags actions + * @name ActionsSetAllowedActionsRepository + * @summary Set allowed actions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - reposDeleteDeployment: ( + actionsSetAllowedActionsRepository: ( owner: string, repo: string, - deploymentId: number, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Users with pull access can view deployment statuses for a deployment: + * @description Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @tags actions + * @name ActionsListSelfHostedRunnersForRepo + * @summary List self-hosted runners for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners */ - reposListDeploymentStatuses: ( + actionsListSelfHostedRunnersForRepo: ( owner: string, repo: string, - deploymentId: number, query?: { /** * Page number of the results to fetch. @@ -28707,8 +26544,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + this.request< + { + runners: Runner[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runners\`, method: "GET", query: query, format: "json", @@ -28716,137 +26559,124 @@ export class Api< }), /** - * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. + * @description Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposCreateDeploymentStatus - * @summary Create a deployment status - * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @tags actions + * @name ActionsListRunnerApplicationsForRepo + * @summary List runner applications for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/downloads */ - reposCreateDeploymentStatus: ( + actionsListRunnerApplicationsForRepo: ( owner: string, repo: string, - deploymentId: number, - data: { - /** - * Adds a new \`inactive\` status to all prior non-transient, non-production environment deployments with the same repository and \`environment\` name as the created status's deployment. An \`inactive\` status is only added to deployments that had a \`success\` state. Default: \`true\` - * **Note:** To add an \`inactive\` status to \`production\` environments, you must use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - */ - auto_inactive?: boolean; - /** - * A short description of the status. The maximum description length is 140 characters. - * @default "" - */ - description?: string; - /** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ - environment?: "production" | "staging" | "qa"; - /** - * Sets the URL for accessing your environment. Default: \`""\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default "" - */ - environment_url?: string; - /** - * The full URL of the deployment's output. This parameter replaces \`target_url\`. We will continue to accept \`target_url\` to support legacy uses, but we recommend replacing \`target_url\` with \`log_url\`. Setting \`log_url\` will automatically set \`target_url\` to the same value. Default: \`""\` - * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. - * @default "" - */ - log_url?: string; - /** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ - state: - | "error" - | "failure" - | "inactive" - | "in_progress" - | "queued" - | "pending" - | "success"; - /** - * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the \`log_url\` parameter, which replaces \`target_url\`. - * @default "" - */ - target_url?: string; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Returns a token that you can pass to the \`config\` script. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using registration token Configure your self-hosted runner, replacing \`TOKEN\` with the registration token provided by this endpoint. \`\`\` ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN \`\`\` + * + * @tags actions + * @name ActionsCreateRegistrationTokenForRepo + * @summary Create a registration token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + */ + actionsCreateRegistrationTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, method: "POST", - body: data, - type: ContentType.Json, format: "json", ...params, }), /** - * @description Users with pull access can view a deployment status for a deployment: + * @description Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the \`repo\` scope to use this endpoint. #### Example using remove token To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. \`\`\` ./config.sh remove --token TOKEN \`\`\` * - * @tags repos - * @name ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @tags actions + * @name ActionsCreateRemoveTokenForRepo + * @summary Create a remove token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token */ - reposGetDeploymentStatus: ( + actionsCreateRemoveTokenForRepo: ( owner: string, repo: string, - deploymentId: number, - statusId: number, params: RequestParams = {}, ) => - this.request< - DeploymentStatus, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, + method: "POST", format: "json", ...params, }), /** - * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. + * @description Gets a specific self-hosted runner configured in a repository. You must authenticate using an access token with the \`repo\` scope to use this endpoint. * - * @tags repos - * @name ReposCreateDispatchEvent - * @summary Create a repository dispatch event - * @request POST:/repos/{owner}/{repo}/dispatches + * @tags actions + * @name ActionsGetSelfHostedRunnerForRepo + * @summary Get a self-hosted runner for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + */ + actionsGetSelfHostedRunnerForRepo: ( + owner: string, + repo: string, + runnerId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. You must authenticate using an access token with the \`repo\` scope to use this endpoint. + * + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromRepo + * @summary Delete a self-hosted runner from a repository + * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - reposCreateDispatchEvent: ( + actionsDeleteSelfHostedRunnerFromRepo: ( owner: string, repo: string, - data: { - /** JSON payload with extra information about the webhook event that your action or worklow may use. */ - client_payload?: Record; - /** A custom webhook event name. */ - event_type: string; - }, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/dispatches\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @tags actions + * @name ActionsListWorkflowRunsForRepo + * @summary List workflow runs for a repository + * @request GET:/repos/{owner}/{repo}/actions/runs */ - activityListRepoEvents: ( + actionsListWorkflowRunsForRepo: ( owner: string, repo: string, query?: { + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; /** * Page number of the results to fetch. * @default 1 @@ -28857,11 +26687,19 @@ export class Api< * @default 30 */ per_page?: number; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: "completed" | "status" | "conclusion"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/events\`, + this.request< + { + total_count: number; + workflow_runs: WorkflowRun[]; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runs\`, method: "GET", query: query, format: "json", @@ -28869,16 +26707,58 @@ export class Api< }), /** - * No description + * @description Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @tags actions + * @name ActionsGetWorkflowRun + * @summary Get a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} */ - reposListForks: ( + actionsGetWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * + * @tags actions + * @name ActionsDeleteWorkflowRun + * @summary Delete a workflow run + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + */ + actionsDeleteWorkflowRun: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. + * + * @tags actions + * @name ActionsListWorkflowRunArtifacts + * @summary List workflow run artifacts + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + */ + actionsListWorkflowRunArtifacts: ( owner: string, repo: string, + runId: number, query?: { /** * Page number of the results to fetch. @@ -28890,16 +26770,17 @@ export class Api< * @default 30 */ per_page?: number; - /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ - sort?: "newest" | "oldest" | "stargazers"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, + this.request< + { + artifacts: Artifact[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, method: "GET", query: query, format: "json", @@ -28907,166 +26788,164 @@ export class Api< }), /** - * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). + * @description Cancels a workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags repos - * @name ReposCreateFork - * @summary Create a fork - * @request POST:/repos/{owner}/{repo}/forks + * @tags actions + * @name ActionsCancelWorkflowRun + * @summary Cancel a workflow run + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel */ - reposCreateFork: ( + actionsCancelWorkflowRun: ( owner: string, repo: string, - data: { - /** Optional parameter to specify the organization name if forking into an organization. */ - organization?: string; - }, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, method: "POST", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * - * @tags git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @tags actions + * @name ActionsListJobsForWorkflowRun + * @summary List jobs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs */ - gitCreateBlob: ( + actionsListJobsForWorkflowRun: ( owner: string, repo: string, - data: { - /** The new blob's content. */ - content: string; + runId: number, + query?: { /** - * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. - * @default "utf-8" + * Filters jobs by their \`completed_at\` timestamp. Can be one of: + * \\* \`latest\`: Returns jobs from the most recent execution of the workflow run. + * \\* \`all\`: Returns all jobs for a workflow run, including from old executions of the workflow run. + * @default "latest" */ - encoding?: string; + filter?: "latest" | "all"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + { + jobs: Job[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. + * @description Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for \`Location:\` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags git - * @name GitGetBlob - * @summary Get a blob - * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} + * @tags actions + * @name ActionsDownloadWorkflowRunLogs + * @summary Download workflow run logs + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - gitGetBlob: ( + actionsDownloadWorkflowRunLogs: ( owner: string, repo: string, - fileSha: string, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "GET", - format: "json", ...params, }), /** - * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Deletes all logs for a workflow run. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags git - * @name GitCreateCommit - * @summary Create a commit - * @request POST:/repos/{owner}/{repo}/git/commits + * @tags actions + * @name ActionsDeleteWorkflowRunLogs + * @summary Delete workflow run logs + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - gitCreateCommit: ( + actionsDeleteWorkflowRunLogs: ( owner: string, - repo: string, - data: { - /** Information about the author of the commit. By default, the \`author\` will be the authenticated user and the current date. See the \`author\` and \`committer\` object below for details. */ - author?: { - /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** Information about the person who is making the commit. By default, \`committer\` will use the information set in \`author\`. See the \`author\` and \`committer\` object below for details. */ - committer?: { - /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author (or committer) of the commit */ - email?: string; - /** The name of the author (or committer) of the commit */ - name?: string; - }; - /** The commit message */ - message: string; - /** The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ - parents?: string[]; - /** The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the \`gpgsig\` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a \`signature\` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ - signature?: string; - /** The SHA of the tree object this commit points to */ - tree: string; - }, + repo: string, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + method: "DELETE", + ...params, + }), + + /** + * @description Re-runs your workflow run using its \`id\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * + * @tags actions + * @name ActionsReRunWorkflow + * @summary Re-run a workflow + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun + */ + actionsReRunWorkflow: ( + owner: string, + repo: string, + runId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, method: "POST", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags git - * @name GitGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} + * @tags actions + * @name ActionsGetWorkflowRunUsage + * @summary Get workflow run usage + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing */ - gitGetCommit: ( + actionsGetWorkflowRunUsage: ( owner: string, repo: string, - commitSha: string, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, method: "GET", format: "json", ...params, }), /** - * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. + * @description Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags git - * @name GitListMatchingRefs - * @summary List matching references - * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + * @tags actions + * @name ActionsListRepoSecrets + * @summary List repository secrets + * @request GET:/repos/{owner}/{repo}/actions/secrets */ - gitListMatchingRefs: ( + actionsListRepoSecrets: ( owner: string, repo: string, - ref: string, query?: { /** * Page number of the results to fetch. @@ -29081,8 +26960,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, + this.request< + { + secrets: ActionsSecret[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/secrets\`, method: "GET", query: query, format: "json", @@ -29090,258 +26975,241 @@ export class Api< }), /** - * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * @description Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags git - * @name GitGetRef - * @summary Get a reference - * @request GET:/repos/{owner}/{repo}/git/ref/{ref} + * @tags actions + * @name ActionsGetRepoPublicKey + * @summary Get a repository public key + * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key */ - gitGetRef: ( + actionsGetRepoPublicKey: ( owner: string, repo: string, - ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, method: "GET", format: "json", ...params, }), /** - * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. + * @description Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags git - * @name GitCreateRef - * @summary Create a reference - * @request POST:/repos/{owner}/{repo}/git/refs + * @tags actions + * @name ActionsGetRepoSecret + * @summary Get a repository secret + * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - gitCreateRef: ( + actionsGetRepoSecret: ( owner: string, repo: string, - data: { - /** @example ""refs/heads/newbranch"" */ - key?: string; - /** The name of the fully qualified reference (ie: \`refs/heads/master\`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ - ref: string; - /** The SHA1 value for this reference. */ - sha: string; - }, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. \`\`\` const sodium = require('tweetsodium'); const key = "base64-encoded-public-key"; const value = "plain-text-secret"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); \`\`\` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. \`\`\` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: """Encrypt a Unicode string using the public key.""" public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) return b64encode(encrypted).decode("utf-8") \`\`\` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. \`\`\` var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); \`\`\` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. \`\`\`ruby require "rbnacl" require "base64" key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt("my_secret") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) \`\`\` * - * @tags git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @tags actions + * @name ActionsCreateOrUpdateRepoSecret + * @summary Create or update a repository secret + * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - gitUpdateRef: ( + actionsCreateOrUpdateRepoSecret: ( owner: string, repo: string, - ref: string, + secretName: string, data: { - /** - * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to \`false\` will make sure you're not overwriting work. - * @default false - */ - force?: boolean; - /** The SHA1 value to set this reference to */ - sha: string; + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @description Deletes a secret in a repository using the secret name. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`secrets\` repository permission to use this endpoint. * - * @tags git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + * @tags actions + * @name ActionsDeleteRepoSecret + * @summary Delete a repository secret + * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - gitDeleteRef: ( + actionsDeleteRepoSecret: ( owner: string, repo: string, - ref: string, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, method: "DELETE", ...params, }), /** - * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags git - * @name GitCreateTag - * @summary Create a tag object - * @request POST:/repos/{owner}/{repo}/git/tags + * @tags actions + * @name ActionsListRepoWorkflows + * @summary List repository workflows + * @request GET:/repos/{owner}/{repo}/actions/workflows */ - gitCreateTag: ( + actionsListRepoWorkflows: ( owner: string, repo: string, - data: { - /** The tag message. */ - message: string; - /** 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; - /** An object with information about the individual creating the tag. */ - tagger?: { - /** When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - date?: string; - /** The email of the author of the tag */ - email?: string; - /** The name of the author of the tag */ - name?: string; - }; - /** 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"; + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + { + total_count: number; + workflows: Workflow[]; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | + * @description Gets a specific workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags git - * @name GitGetTag - * @summary Get a tag - * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} + * @tags actions + * @name ActionsGetWorkflow + * @summary Get a workflow + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} */ - gitGetTag: ( + actionsGetWorkflow: ( owner: string, repo: string, - tagSha: string, + workflowId: number | string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, method: "GET", format: "json", ...params, }), /** - * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." + * @description Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. + * + * @tags actions + * @name ActionsDisableWorkflow + * @summary Disable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + */ + actionsDisableWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, + method: "PUT", + ...params, + }), + + /** + * @description You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." * - * @tags git - * @name GitCreateTree - * @summary Create a tree - * @request POST:/repos/{owner}/{repo}/git/trees + * @tags actions + * @name ActionsCreateWorkflowDispatch + * @summary Create a workflow dispatch event + * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches */ - gitCreateTree: ( + actionsCreateWorkflowDispatch: ( owner: string, repo: string, + workflowId: number | string, data: { - /** - * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by \`base_tree\` and entries defined in the \`tree\` parameter. Entries defined in the \`tree\` parameter will overwrite items from \`base_tree\` with the same \`path\`. If you're creating new changes on a branch, then normally you'd set \`base_tree\` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. - * If not provided, GitHub will create a new Git tree object from only the entries defined in the \`tree\` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the \`tree\` parameter will be listed as deleted by the new commit. - */ - base_tree?: string; - /** Objects (of \`path\`, \`mode\`, \`type\`, and \`sha\`) specifying a tree structure. */ - tree: { - /** - * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or \`tree.sha\`. - * - * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. - */ - content?: string; - /** The file mode; 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. */ - mode?: "100644" | "100755" | "040000" | "160000" | "120000"; - /** The file referenced in the tree. */ - path?: string; - /** - * The SHA1 checksum ID of the object in the tree. Also called \`tree.sha\`. If the value is \`null\` then the file will be deleted. - * - * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. - */ - sha?: string | null; - /** Either \`blob\`, \`tree\`, or \`commit\`. */ - type?: "blob" | "tree" | "commit"; - }[]; + /** Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when \`inputs\` are omitted. */ + inputs?: Record; + /** The git reference for the workflow. The reference can be a branch or tag name. */ + ref: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. + * @description Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You must authenticate using an access token with the \`repo\` scope to use this endpoint. GitHub Apps must have the \`actions:write\` permission to use this endpoint. * - * @tags git - * @name GitGetTree - * @summary Get a tree - * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} + * @tags actions + * @name ActionsEnableWorkflow + * @summary Enable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable */ - gitGetTree: ( + actionsEnableWorkflow: ( owner: string, repo: string, - treeSha: string, - query?: { - /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ - recursive?: string; - }, + workflowId: number | string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, + method: "PUT", ...params, }), /** - * No description + * @description List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. * - * @tags repos - * @name ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @tags actions + * @name ActionsListWorkflowRuns + * @summary List workflow runs + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs */ - reposListWebhooks: ( + actionsListWorkflowRuns: ( owner: string, repo: string, + workflowId: number | string, query?: { + /** Returns someone's workflow runs. Use the login for the user who created the \`push\` associated with the check suite or workflow run. */ + actor?: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the \`push\`. */ + branch?: string; + /** Returns workflow run triggered by the event you specify. For example, \`push\`, \`pull_request\` or \`issue\`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: string; /** * Page number of the results to fetch. * @default 1 @@ -29352,11 +27220,19 @@ export class Api< * @default 30 */ per_page?: number; + /** Returns workflow runs associated with the check run \`status\` or \`conclusion\` you specify. For example, a conclusion can be \`success\` or a status can be \`completed\`. For more information, see the \`status\` and \`conclusion\` options available in "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: "completed" | "status" | "conclusion"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, + this.request< + { + total_count: number; + workflow_runs: WorkflowRun[]; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, method: "GET", query: query, format: "json", @@ -29364,292 +27240,267 @@ export class Api< }), /** - * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. - * - * @tags repos - * @name ReposCreateWebhook - * @summary Create a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks - */ - reposCreateWebhook: ( - owner: string, - repo: string, - data: { - /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true - */ - active?: boolean; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ - config: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** @example ""sha256"" */ - digest?: string; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** @example ""abc"" */ - token?: string; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - }; - /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] - */ - events?: string[]; - /** Use \`web\` to create a webhook. Default: \`web\`. This parameter only accepts the value \`web\`. */ - name?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." + * @description Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the \`repo\` scope. GitHub Apps must have the \`actions:read\` permission to use this endpoint. * - * @tags repos - * @name ReposGetWebhook - * @summary Get a repository webhook - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags actions + * @name ActionsGetWorkflowUsage + * @summary Get workflow usage + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing */ - reposGetWebhook: ( + actionsGetWorkflowUsage: ( owner: string, repo: string, - hookId: number, + workflowId: number | string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, method: "GET", format: "json", ...params, }), /** - * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." + * @description Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. * - * @tags repos - * @name ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags issues + * @name IssuesListAssignees + * @summary List assignees + * @request GET:/repos/{owner}/{repo}/assignees */ - reposUpdateWebhook: ( + issuesListAssignees: ( owner: string, repo: string, - hookId: number, - data: { + query?: { /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true + * Page number of the results to fetch. + * @default 1 */ - active?: boolean; - /** Determines a list of events to be added to the list of events that the Hook triggers for. */ - add_events?: string[]; - /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ - config?: { - /** @example ""bar@example.com"" */ - address?: string; - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** @example ""The Serious Room"" */ - room?: string; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url: WebhookConfigUrl; - }; + page?: number; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. - * @default ["push"] + * Results per page (max 100) + * @default 30 */ - events?: string[]; - /** Determines a list of events to be removed from the list of events that the Hook triggers for. */ - remove_events?: string[]; + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/assignees\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Checks if a user has permission to be assigned to an issue in this repository. If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned. Otherwise a \`404\` status code is returned. * - * @tags repos - * @name ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags issues + * @name IssuesCheckUserCanBeAssigned + * @summary Check if a user can be assigned + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - reposDeleteWebhook: ( + issuesCheckUserCanBeAssigned: ( owner: string, repo: string, - hookId: number, + assignee: string, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "DELETE", + path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + method: "GET", ...params, }), /** - * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. + * @description Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". * * @tags repos - * @name ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposEnableAutomatedSecurityFixes + * @summary Enable automated security fixes + * @request PUT:/repos/{owner}/{repo}/automated-security-fixes */ - reposGetWebhookConfigForRepo: ( + reposEnableAutomatedSecurityFixes: ( owner: string, repo: string, - hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "PUT", ...params, }), /** - * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. + * @description Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". * * @tags repos - * @name ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes */ - reposUpdateWebhookConfigForRepo: ( + reposDisableAutomatedSecurityFixes: ( owner: string, repo: string, - hookId: number, - data: { - /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ - content_type?: WebhookConfigContentType; - /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ - insecure_ssl?: WebhookConfigInsecureSsl; - /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ - secret?: WebhookConfigSecret; - /** The URL to which the payloads will be delivered. */ - url?: WebhookConfigUrl; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "DELETE", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * No description * * @tags repos - * @name ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches */ - reposPingWebhook: ( + reposListBranches: ( owner: string, repo: string, - hookId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Setting to \`true\` returns only protected branches. When set to \`false\`, only unprotected branches are returned. Omitting this parameter returns all branches. */ + protected?: boolean; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description 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/:hook_id/test\` + * No description * * @tags repos - * @name ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - reposTestPushWebhook: ( + reposGetBranch: ( owner: string, repo: string, - hookId: number, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, - method: "POST", + this.request< + BranchWithProtection, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, + method: "GET", + format: "json", ...params, }), /** - * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags migrations - * @name MigrationsGetImportStatus - * @summary Get an import status - * @request GET:/repos/{owner}/{repo}/import + * @tags repos + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - migrationsGetImportStatus: ( + reposGetBranchProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "GET", format: "json", ...params, }), /** - * @description Start a source import to a GitHub repository using GitHub Importer. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. **Note**: The list of users, apps, and teams in total is limited to 100 items. * - * @tags migrations - * @name MigrationsStartImport - * @summary Start an import - * @request PUT:/repos/{owner}/{repo}/import + * @tags repos + * @name ReposUpdateBranchProtection + * @summary Update branch protection + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection */ - migrationsStartImport: ( + reposUpdateBranchProtection: ( owner: string, repo: string, + branch: string, data: { - /** For a tfvc import, the name of the project that is being imported. */ - tfvc_project?: string; - /** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ - vcs?: "subversion" | "git" | "mercurial" | "tfvc"; - /** If authentication is required, the password to provide to \`vcs_url\`. */ - vcs_password?: string; - /** The URL of the originating repository. */ - vcs_url: string; - /** If authentication is required, the username to provide to \`vcs_url\`. */ - vcs_username?: string; + /** Allows deletion of the protected branch by anyone with write access to the repository. Set to \`false\` to prevent deletion of the protected branch. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ + allow_deletions?: boolean; + /** Permits force pushes to the protected branch by anyone with write access to the repository. Set to \`true\` to allow force pushes. Set to \`false\` or \`null\` to block force pushes. Default: \`false\`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ + allow_force_pushes?: boolean | null; + /** Enforce all configured restrictions for administrators. Set to \`true\` to enforce required status checks for repository administrators. Set to \`null\` to disable. */ + enforce_admins: boolean | null; + /** Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to \`true\` to enforce a linear commit history. Set to \`false\` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: \`false\`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ + required_linear_history?: boolean; + /** Require at least one approving review on a pull request, before merging. Set to \`null\` to disable. */ + required_pull_request_reviews: { + /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of team \`slug\`s with dismissal access */ + teams?: string[]; + /** The list of user \`login\`s with dismissal access */ + users?: string[]; + }; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ + require_code_owner_reviews?: boolean; + /** Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; + } | null; + /** Require status checks to pass before merging. Set to \`null\` to disable. */ + required_status_checks: { + /** The list of status checks to require in order to merge into this branch */ + contexts: string[]; + /** Require branches to be up to date before merging. */ + strict: boolean; + } | null; + /** Restrict who can push to the protected branch. User, app, and team \`restrictions\` are only available for organization-owned repositories. Set to \`null\` to disable. */ + restrictions: { + /** The list of app \`slug\`s with push access */ + apps?: string[]; + /** The list of team \`slug\`s with push access */ + teams: string[]; + /** The list of user \`login\`s with push access */ + users: string[]; + } | null; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + this.request< + ProtectedBranch, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, method: "PUT", body: data, type: ContentType.Json, @@ -29658,151 +27509,139 @@ export class Api< }), /** - * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags migrations - * @name MigrationsUpdateImport - * @summary Update an import - * @request PATCH:/repos/{owner}/{repo}/import + * @tags repos + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - migrationsUpdateImport: ( + reposDeleteBranchProtection: ( owner: string, repo: string, - data: { - /** @example ""project1"" */ - tfvc_project?: string; - /** @example ""git"" */ - vcs?: string; - /** The password to provide to the originating repository. */ - vcs_password?: string; - /** The username to provide to the originating repository. */ - vcs_username?: string; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + method: "DELETE", ...params, }), /** - * @description Stop an import for a repository. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @tags repos + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - migrationsCancelImport: ( + reposGetAdminBranchProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "GET", + format: "json", ...params, }), /** - * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * - * @tags migrations - * @name MigrationsGetCommitAuthors - * @summary Get commit authors - * @request GET:/repos/{owner}/{repo}/import/authors + * @tags repos + * @name ReposSetAdminBranchProtection + * @summary Set admin branch protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - migrationsGetCommitAuthors: ( + reposSetAdminBranchProtection: ( owner: string, repo: string, - query?: { - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "POST", format: "json", ...params, }), /** - * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * - * @tags migrations - * @name MigrationsMapCommitAuthor - * @summary Map a commit author - * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} + * @tags repos + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - migrationsMapCommitAuthor: ( + reposDeleteAdminBranchProtection: ( owner: string, repo: string, - authorId: number, - data: { - /** The new Git author email. */ - email?: string; - /** The new Git author name. */ - name?: string; - /** @example ""can't touch this"" */ - remote_id?: string; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "DELETE", ...params, }), /** - * @description List files larger than 100MB found during the import + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags migrations - * @name MigrationsGetLargeFiles - * @summary Get large files - * @request GET:/repos/{owner}/{repo}/import/large_files + * @tags repos + * @name ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - migrationsGetLargeFiles: ( + reposGetPullRequestReviewProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/large_files\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "GET", format: "json", ...params, }), /** - * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **Note**: Passing new arrays of \`users\` and \`teams\` replaces their previous values. * - * @tags migrations - * @name MigrationsSetLfsPreference - * @summary Update Git LFS preference - * @request PATCH:/repos/{owner}/{repo}/import/lfs + * @tags repos + * @name ReposUpdatePullRequestReviewProtection + * @summary Update pull request review protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - migrationsSetLfsPreference: ( + reposUpdatePullRequestReviewProtection: ( owner: string, repo: string, + branch: string, data: { - /** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ - use_lfs: "opt_in" | "opt_out"; + /** Set to \`true\` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Specify which users and teams can dismiss pull request reviews. Pass an empty \`dismissal_restrictions\` object to disable. User and team \`dismissal_restrictions\` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of team \`slug\`s with dismissal access */ + teams?: string[]; + /** The list of user \`login\`s with dismissal access */ + users?: string[]; + }; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ + require_code_owner_reviews?: boolean; + /** Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/lfs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, method: "PATCH", body: data, type: ContentType.Json, @@ -29811,140 +27650,130 @@ export class Api< }), /** - * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags apps - * @name AppsGetRepoInstallation - * @summary Get a repository installation for the authenticated app - * @request GET:/repos/{owner}/{repo}/installation + * @tags repos + * @name ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - appsGetRepoInstallation: ( + reposDeletePullRequestReviewProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/installation\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "DELETE", ...params, }), /** - * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. **Note**: You must enable branch protection to require signed commits. * - * @tags interactions - * @name InteractionsGetRestrictionsForRepo - * @summary Get interaction restrictions for a repository - * @request GET:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - interactionsGetRestrictionsForRepo: ( + reposGetCommitSignatureProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "GET", format: "json", ...params, }), /** - * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. * - * @tags interactions - * @name InteractionsSetRestrictionsForRepo - * @summary Set interaction restrictions for a repository - * @request PUT:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - interactionsSetRestrictionsForRepo: ( + reposCreateCommitSignatureProtection: ( owner: string, repo: string, - data: InteractionLimit, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "POST", format: "json", ...params, }), /** - * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. * - * @tags interactions - * @name InteractionsRemoveRestrictionsForRepo - * @summary Remove interaction restrictions for a repository - * @request DELETE:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - interactionsRemoveRestrictionsForRepo: ( + reposDeleteCommitSignatureProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "DELETE", ...params, }), /** - * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * @tags repos - * @name ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @name ReposGetStatusChecksProtection + * @summary Get status checks protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - reposListInvitations: ( + reposGetStatusChecksProtection: ( owner: string, repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. * * @tags repos - * @name ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @name ReposUpdateStatusCheckProtection + * @summary Update status check protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - reposUpdateInvitation: ( + reposUpdateStatusCheckProtection: ( owner: string, repo: string, - invitationId: number, + branch: string, data: { - /** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ - permissions?: "read" | "write" | "maintain" | "triage" | "admin"; + /** The list of status checks to require in order to merge into this branch */ + contexts?: string[]; + /** Require branches to be up to date before merging. */ + strict?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, method: "PATCH", body: data, type: ContentType.Json, @@ -29953,132 +27782,121 @@ export class Api< }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * @tags repos + * @name ReposRemoveStatusCheckProtection + * @summary Remove status check protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + */ + reposRemoveStatusCheckProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "DELETE", + ...params, + }), + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * @tags repos + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + */ + reposGetAllStatusCheckContexts: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * @tags repos - * @name ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposDeleteInvitation: ( + reposAddStatusCheckContexts: ( owner: string, repo: string, - invitationId: number, + branch: string, + data: { + /** contexts parameter */ + contexts: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags issues - * @name IssuesListForRepo - * @summary List repository issues - * @request GET:/repos/{owner}/{repo}/issues + * @tags repos + * @name ReposSetStatusCheckContexts + * @summary Set status check contexts + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - issuesListForRepo: ( + reposSetStatusCheckContexts: ( owner: string, repo: string, - query?: { - /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ - assignee?: string; - /** The user that created the issue. */ - creator?: string; - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** A user that's mentioned in the issue. */ - mentioned?: string; - /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ - milestone?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ - sort?: "created" | "updated" | "comments"; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; + branch: string, + data: { + /** contexts parameter */ + contexts: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags issues - * @name IssuesCreate - * @summary Create an issue - * @request POST:/repos/{owner}/{repo}/issues + * @tags repos + * @name ReposRemoveStatusCheckContexts + * @summary Remove status check contexts + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - issuesCreate: ( + reposRemoveStatusCheckContexts: ( owner: string, repo: string, + branch: string, data: { - /** Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ - assignee?: string | null; - /** Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ - assignees?: string[]; - /** The contents of the issue. */ - body?: string; - /** Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ - labels?: ( - | string - | { - color?: string | null; - description?: string | null; - id?: number; - name?: string; - } - )[]; - /** The \`number\` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ */ - milestone?: string | number | null; - /** The title of the issue. */ - title: string | number; + /** contexts parameter */ + contexts: string[]; }, params: RequestParams = {}, ) => - this.request< - Issue, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -30086,202 +27904,142 @@ export class Api< }), /** - * @description By default, Issue Comments are ordered by ascending ID. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. * - * @tags issues - * @name IssuesListCommentsForRepo - * @summary List issue comments for a repository - * @request GET:/repos/{owner}/{repo}/issues/comments + * @tags repos + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - issuesListCommentsForRepo: ( + reposGetAccessRestrictions: ( owner: string, repo: string, - query?: { - /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Disables the ability to restrict who can push to this branch. * - * @tags issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposDeleteAccessRestrictions + * @summary Delete access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - issuesGetComment: ( + reposDeleteAccessRestrictions: ( owner: string, repo: string, - commentId: number, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + method: "DELETE", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. * - * @tags issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - issuesUpdateComment: ( + reposGetAppsWithAccessToProtectedBranch: ( owner: string, repo: string, - commentId: number, - data: { - /** The contents of the comment. */ - body: string; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified apps push access for this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - issuesDeleteComment: ( + reposAddAppAccessRestrictions: ( owner: string, repo: string, - commentId: number, + branch: string, + data: { + /** apps parameter */ + apps: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags reactions - * @name ReactionsListForIssueComment - * @summary List reactions for an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags repos + * @name ReposSetAppAccessRestrictions + * @summary Set app access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reactionsListForIssueComment: ( + reposSetAppAccessRestrictions: ( owner: string, repo: string, - commentId: number, - query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + branch: string, + data: { + /** apps parameter */ + apps: string[]; }, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of an app to push to this branch. Only installed GitHub Apps with \`write\` access to the \`contents\` permission can be added as authorized actors on a protected branch. | Type | Description | | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | The GitHub Apps that have push access to this branch. Use the app's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags reactions - * @name ReactionsCreateForIssueComment - * @summary Create reaction for an issue comment - * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags repos + * @name ReposRemoveAppAccessRestrictions + * @summary Remove app access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reactionsCreateForIssueComment: ( + reposRemoveAppAccessRestrictions: ( owner: string, repo: string, - commentId: number, + branch: string, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** apps parameter */ + apps: string[]; }, params: RequestParams = {}, ) => - this.request< - Reaction, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -30289,177 +28047,148 @@ export class Api< }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the teams who have push access to this branch. The list includes child teams. * - * @tags reactions - * @name ReactionsDeleteForIssueComment - * @summary Delete an issue comment reaction - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + * @tags repos + * @name ReposGetTeamsWithAccessToProtectedBranch + * @summary Get teams with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - reactionsDeleteForIssueComment: ( + reposGetTeamsWithAccessToProtectedBranch: ( owner: string, repo: string, - commentId: number, - reactionId: number, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified teams push access for this branch. You can also give push access to child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @tags repos + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - issuesListEventsForRepo: ( + reposAddTeamAccessRestrictions: ( owner: string, repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + branch: string, + data: { + /** teams parameter */ + teams: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. | Type | Description | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | \`array\` | The teams that can have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + * @tags repos + * @name ReposSetTeamAccessRestrictions + * @summary Set team access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - issuesGetEvent: ( + reposSetTeamAccessRestrictions: ( owner: string, repo: string, - eventId: number, + branch: string, + data: { + /** teams parameter */ + teams: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a team to push to this branch. You can also remove push access for child teams. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Teams that should no longer have push access. Use the team's \`slug\`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesGet - * @summary Get an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + * @tags repos + * @name ReposRemoveTeamAccessRestrictions + * @summary Remove team access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - issuesGet: ( + reposRemoveTeamAccessRestrictions: ( owner: string, repo: string, - issueNumber: number, + branch: string, + data: { + /** teams parameter */ + teams: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Issue owners and users with push access can edit an issue. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists the people who have push access to this branch. * - * @tags issues - * @name IssuesUpdate - * @summary Update an issue - * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} + * @tags repos + * @name ReposGetUsersWithAccessToProtectedBranch + * @summary Get users with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - issuesUpdate: ( + reposGetUsersWithAccessToProtectedBranch: ( owner: string, repo: string, - issueNumber: number, - data: { - /** Login for the user that this issue should be assigned to. **This field is deprecated.** */ - assignee?: string | null; - /** Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (\`[]\`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ - assignees?: string[]; - /** The contents of the issue. */ - body?: string; - /** Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (\`[]\`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ - labels?: ( - | string - | { - color?: string | null; - description?: string | null; - id?: number; - name?: string; - } - )[]; - /** The \`number\` of the milestone to associate this issue with or \`null\` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._ */ - milestone?: string | number | null; - /** State of the issue. Either \`open\` or \`closed\`. */ - state?: "open" | "closed"; - /** The title of the issue. */ - title?: string | number; - }, + branch: string, params: RequestParams = {}, ) => - this.request< - Issue, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "GET", format: "json", ...params, }), /** - * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesAddAssignees - * @summary Add assignees to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags repos + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - issuesAddAssignees: ( + reposAddUserAccessRestrictions: ( owner: string, repo: string, - issueNumber: number, + branch: string, data: { - /** Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ - assignees?: string[]; + /** users parameter */ + users: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, method: "POST", body: data, type: ContentType.Json, @@ -30468,26 +28197,26 @@ export class Api< }), /** - * @description Removes one or more assignees from an issue. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesRemoveAssignees - * @summary Remove assignees from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags repos + * @name ReposSetUserAccessRestrictions + * @summary Set user access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - issuesRemoveAssignees: ( + reposSetUserAccessRestrictions: ( owner: string, repo: string, - issueNumber: number, + branch: string, data: { - /** Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ - assignees?: string[]; + /** users parameter */ + users: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -30495,61 +28224,52 @@ export class Api< }), /** - * @description Issue Comments are ordered by ascending ID. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | * - * @tags issues - * @name IssuesListComments - * @summary List issue comments - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags repos + * @name ReposRemoveUserAccessRestrictions + * @summary Remove user access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - issuesListComments: ( + reposRemoveUserAccessRestrictions: ( owner: string, repo: string, - issueNumber: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + branch: string, + data: { + /** users parameter */ + users: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description Renames a branch in a repository. **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the \`contents:write\` repository permission. To rename the default branch: * Users must have admin or owner permissions. * GitHub Apps must have the \`administration:write\` repository permission. * - * @tags issues - * @name IssuesCreateComment - * @summary Create an issue comment - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags repos + * @name ReposRenameBranch + * @summary Rename a branch + * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename */ - issuesCreateComment: ( + reposRenameBranch: ( owner: string, repo: string, - issueNumber: number, + branch: string, data: { - /** The contents of the comment. */ - body: string; + /** The new name of the branch. */ + new_name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, method: "POST", body: data, type: ContentType.Json, @@ -30558,93 +28278,129 @@ export class Api< }), /** - * No description + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Creates a new check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to create check runs. In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. * - * @tags issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @tags checks + * @name ChecksCreate + * @summary Create a check run + * @request POST:/repos/{owner}/{repo}/check-runs */ - issuesListEvents: ( + checksCreate: ( owner: string, repo: string, - issueNumber: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + data: ( + | { + status?: "completed"; + [key: string]: any; + } + | { + status?: "queued" | "in_progress"; + [key: string]: any; + } + ) & { /** - * Results per page (max 100) - * @default 30 + * Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [\`check_run.requested_action\` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." + * @maxItems 3 */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * No description - * - * @tags issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels - */ - issuesListLabelsOnIssue: ( - owner: string, - repo: string, - issueNumber: number, - query?: { + actions?: { + /** + * A short explanation of what this action would do. The maximum size is 40 characters. + * @maxLength 40 + */ + description: string; + /** + * A reference for the action on the integrator's system. The maximum size is 20 characters. + * @maxLength 20 + */ + identifier: string; + /** + * The text to be displayed on a button in the web UI. The maximum size is 20 characters. + * @maxLength 20 + */ + label: string; + }[]; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + completed_at?: string; /** - * Page number of the results to fetch. - * @default 1 + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. When the conclusion is \`action_required\`, additional details should be provided on the site specified by \`details_url\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. */ - page?: number; + conclusion?: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required"; + /** The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** The SHA of the commit. */ + head_sha: string; + /** The name of the check. For example, "code-coverage". */ + name: string; + /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object) description. */ + output?: { + /** + * Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter. + * @maxItems 50 + */ + annotations?: { + /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ + annotation_level: "notice" | "warning" | "failure"; + /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + end_column?: number; + /** The end line of the annotation. */ + end_line: number; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ + path: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + start_column?: number; + /** The start line of the annotation. */ + start_line: number; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#images-object) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** A short image description. */ + caption?: string; + /** The full URL of the image. */ + image_url: string; + }[]; + /** + * The summary of the check run. This parameter supports Markdown. + * @maxLength 65535 + */ + summary: string; + /** + * The details of the check run. This parameter supports Markdown. + * @maxLength 65535 + */ + text?: string; + /** The title of the check run. */ + title: string; + }; + /** The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + started_at?: string; /** - * Results per page (max 100) - * @default 30 + * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. + * @default "queued" */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * No description - * - * @tags issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels - */ - issuesAddLabels: ( - owner: string, - repo: string, - issueNumber: number, - data: { - /** The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ - labels: string[]; + status?: "queued" | "in_progress" | "completed"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs\`, method: "POST", body: data, type: ContentType.Json, @@ -30653,149 +28409,166 @@ export class Api< }), /** - * @description Removes any previous labels and sets the new labels for an issue. - * - * @tags issues - * @name IssuesSetLabels - * @summary Set labels for an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels - */ - issuesSetLabels: ( - owner: string, - repo: string, - issueNumber: number, - data: { - /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ - labels?: string[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * No description - * - * @tags issues - * @name IssuesRemoveAllLabels - * @summary Remove all labels from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels - */ - issuesRemoveAllLabels: ( - owner: string, - repo: string, - issueNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "DELETE", - ...params, - }), - - /** - * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Gets a single check run using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. * - * @tags issues - * @name IssuesRemoveLabel - * @summary Remove a label from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + * @tags checks + * @name ChecksGet + * @summary Get a check run + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - issuesRemoveLabel: ( + checksGet: ( owner: string, repo: string, - issueNumber: number, - name: string, + checkRunId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. * - * @tags issues - * @name IssuesLock - * @summary Lock an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags checks + * @name ChecksUpdate + * @summary Update a check run + * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - issuesLock: ( + checksUpdate: ( owner: string, repo: string, - issueNumber: number, - data: { + checkRunId: number, + data: ( + | { + status?: "completed"; + [key: string]: any; + } + | { + status?: "queued" | "in_progress"; + [key: string]: any; + } + ) & { /** - * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - * \\* \`off-topic\` - * \\* \`too heated\` - * \\* \`resolved\` - * \\* \`spam\` + * Possible further actions the integrator can perform, which a user may trigger. Each action includes a \`label\`, \`identifier\` and \`description\`. A maximum of three actions are accepted. See the [\`actions\` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." + * @maxItems 3 */ - lock_reason?: "off-topic" | "too heated" | "resolved" | "spam"; - } | null, + actions?: { + /** + * A short explanation of what this action would do. The maximum size is 40 characters. + * @maxLength 40 + */ + description: string; + /** + * A reference for the action on the integrator's system. The maximum size is 20 characters. + * @maxLength 20 + */ + identifier: string; + /** + * The text to be displayed on a button in the web UI. The maximum size is 20 characters. + * @maxLength 20 + */ + label: string; + }[]; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + completed_at?: string; + /** + * **Required if you provide \`completed_at\` or a \`status\` of \`completed\`**. The final conclusion of the check. Can be one of \`success\`, \`failure\`, \`neutral\`, \`cancelled\`, \`skipped\`, \`timed_out\`, or \`action_required\`. + * **Note:** Providing \`conclusion\` will automatically set the \`status\` parameter to \`completed\`. Only GitHub can change a check run conclusion to \`stale\`. + */ + conclusion?: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required"; + /** The URL of the integrator's site that has the full details of the check. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** The name of the check. For example, "code-coverage". */ + name?: string; + /** Check runs can accept a variety of data in the \`output\` object, including a \`title\` and \`summary\` and can optionally provide descriptive details about the run. See the [\`output\` object](https://docs.github.com/rest/reference/checks#output-object-1) description. */ + output?: { + /** + * Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [\`annotations\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. + * @maxItems 50 + */ + annotations?: { + /** The level of the annotation. Can be one of \`notice\`, \`warning\`, or \`failure\`. */ + annotation_level: "notice" | "warning" | "failure"; + /** The end column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + end_column?: number; + /** The end line of the annotation. */ + end_line: number; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The path of the file to add an annotation to. For example, \`assets/css/main.css\`. */ + path: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + /** The start column of the annotation. Annotations only support \`start_column\` and \`end_column\` on the same line. Omit this parameter if \`start_line\` and \`end_line\` have different values. */ + start_column?: number; + /** The start line of the annotation. */ + start_line: number; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [\`images\` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** A short image description. */ + caption?: string; + /** The full URL of the image. */ + image_url: string; + }[]; + /** + * Can contain Markdown. + * @maxLength 65535 + */ + summary: string; + /** + * Can contain Markdown. + * @maxLength 65535 + */ + text?: string; + /** **Required**. */ + title?: string; + }; + /** This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + started_at?: string; + /** The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: "queued" | "in_progress" | "completed"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description Users with push access can unlock an issue's conversation. - * - * @tags issues - * @name IssuesUnlock - * @summary Unlock an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock - */ - issuesUnlock: ( - owner: string, - repo: string, - issueNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "DELETE", - ...params, - }), - - /** - * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * @description Lists annotations for a check run using the annotation \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the \`repo\` scope to get annotations for a check run in a private repository. * - * @tags reactions - * @name ReactionsListForIssue - * @summary List reactions for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags checks + * @name ChecksListAnnotations + * @summary List check run annotations + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations */ - reactionsListForIssue: ( + checksListAnnotations: ( owner: string, repo: string, - issueNumber: number, + checkRunId: number, query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; /** * Page number of the results to fetch. * @default 1 @@ -30809,15 +28582,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, method: "GET", query: query, format: "json", @@ -30825,40 +28591,24 @@ export class Api< }), /** - * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the \`checks:write\` permission to create check suites. * - * @tags reactions - * @name ReactionsCreateForIssue - * @summary Create reaction for an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags checks + * @name ChecksCreateSuite + * @summary Create a check suite + * @request POST:/repos/{owner}/{repo}/check-suites */ - reactionsCreateForIssue: ( + checksCreateSuite: ( owner: string, repo: string, - issueNumber: number, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** The sha of the head commit. */ + head_sha: string; }, params: RequestParams = {}, ) => - this.request< - Reaction, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites\`, method: "POST", body: data, type: ContentType.Json, @@ -30867,39 +28617,80 @@ export class Api< }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + * @description Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. * - * @tags reactions - * @name ReactionsDeleteForIssue - * @summary Delete an issue reaction - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + * @tags checks + * @name ChecksSetSuitesPreferences + * @summary Update repository preferences for check suites + * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences */ - reactionsDeleteForIssue: ( + checksSetSuitesPreferences: ( owner: string, repo: string, - issueNumber: number, - reactionId: number, + data: { + /** Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [\`auto_trigger_checks\` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ + auto_trigger_checks?: { + /** The \`id\` of the GitHub App. */ + app_id: number; + /** + * Set to \`true\` to enable automatic creation of CheckSuite events upon pushes to the repository, or \`false\` to disable them. + * @default true + */ + setting: boolean; + }[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Gets a single check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. * - * @tags issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @tags checks + * @name ChecksGetSuite + * @summary Get a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} */ - issuesListEventsForTimeline: ( + checksGetSuite: ( owner: string, repo: string, - issueNumber: number, + checkSuiteId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a check suite using its \`id\`. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. + * + * @tags checks + * @name ChecksListForSuite + * @summary List check runs in a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + */ + checksListForSuite: ( + owner: string, + repo: string, + checkSuiteId: number, query?: { + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: "latest" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -30910,18 +28701,19 @@ export class Api< * @default 30 */ per_page?: number; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: "queued" | "in_progress" | "completed"; }, params: RequestParams = {}, ) => this.request< - IssueEventForIssue[], - | BasicError - | { - documentation_url: string; - message: string; - } + { + check_runs: CheckRun[]; + total_count: number; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, method: "GET", query: query, format: "json", @@ -30929,32 +28721,53 @@ export class Api< }), /** - * No description + * @description Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared. To rerequest a check suite, your GitHub App must have the \`checks:read\` permission on a private repository or pull access to a public repository. * - * @tags repos - * @name ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @tags checks + * @name ChecksRerequestSuite + * @summary Rerequest a check suite + * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest */ - reposListDeployKeys: ( + checksRerequestSuite: ( + owner: string, + repo: string, + checkSuiteId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, + method: "POST", + ...params, + }), + + /** + * @description Lists all open code scanning alerts for the default branch (usually \`main\` or \`master\`). You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. + * + * @tags code-scanning + * @name CodeScanningListAlertsForRepo + * @summary List code scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts + */ + codeScanningListAlertsForRepo: ( owner: string, repo: string, query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAlertRef; + /** Set to \`open\`, \`fixed\`, or \`dismissed\` to list code scanning alerts in a specific state. */ + state?: CodeScanningAlertState; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, + this.request< + CodeScanningAlertCodeScanningAlertItems[], + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, method: "GET", query: query, format: "json", @@ -30962,33 +28775,58 @@ export class Api< }), /** - * @description You can create a read-only deploy key. + * @description Gets a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. The security \`alert_number\` is found at the end of the security alert's URL. For example, the security alert ID for \`https://github.com/Octo-org/octo-repo/security/code-scanning/88\` is \`88\`. * - * @tags repos - * @name ReposCreateDeployKey - * @summary Create a deploy key - * @request POST:/repos/{owner}/{repo}/keys + * @tags code-scanning + * @name CodeScanningGetAlert + * @summary Get a code scanning alert + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + */ + codeScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: number, + params: RequestParams = {}, + ) => + this.request< + CodeScanningAlertCodeScanningAlert, + | void + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Updates the status of a single code scanning alert. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. + * + * @tags code-scanning + * @name CodeScanningUpdateAlert + * @summary Update a code scanning alert + * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - reposCreateDeployKey: ( + codeScanningUpdateAlert: ( owner: string, repo: string, + alertNumber: AlertNumber, data: { - /** The contents of the key. */ - key: string; - /** - * If \`true\`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. - * - * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." - */ - read_only?: boolean; - /** A name for the key. */ - title?: string; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: \`false positive\`, \`won't fix\`, and \`used in tests\`. */ + dismissed_reason?: CodeScanningAlertDismissedReason; + /** Sets the state of the code scanning alert. Can be one of \`open\` or \`dismissed\`. You must provide \`dismissed_reason\` when you set the state to \`dismissed\`. */ + state: CodeScanningAlertSetState; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -30996,58 +28834,95 @@ export class Api< }), /** - * No description + * @description List the details of recent code scanning analyses for a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` read permission to use this endpoint. * - * @tags repos - * @name ReposGetDeployKey - * @summary Get a deploy key - * @request GET:/repos/{owner}/{repo}/keys/{key_id} + * @tags code-scanning + * @name CodeScanningListRecentAnalyses + * @summary List recent code scanning analyses for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/analyses */ - reposGetDeployKey: ( + codeScanningListRecentAnalyses: ( owner: string, repo: string, - keyId: number, + query?: { + /** Set a full Git reference to list alerts for a specific branch. The \`ref\` must be formatted as \`refs/heads/\`. */ + ref?: CodeScanningAnalysisRef; + /** Set a single code scanning tool name to filter alerts by tool. */ + tool_name?: CodeScanningAnalysisToolName; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. + * @description Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the \`security_events\` scope to use this endpoint. GitHub Apps must have the \`security_events\` write permission to use this endpoint. * - * @tags repos - * @name ReposDeleteDeployKey - * @summary Delete a deploy key - * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + * @tags code-scanning + * @name CodeScanningUploadSarif + * @summary Upload a SARIF file + * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs */ - reposDeleteDeployKey: ( + codeScanningUploadSarif: ( owner: string, repo: string, - keyId: number, + data: { + /** + * The base directory used in the analysis, as it appears in the SARIF file. + * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. + * @format uri + * @example "file:///github/workspace/" + */ + checkout_uri?: string; + /** The commit SHA of the code scanning analysis file. */ + commit_sha: CodeScanningAnalysisCommitSha; + /** The full Git reference of the code scanning analysis file, formatted as \`refs/heads/\`. */ + ref: CodeScanningAnalysisRef; + /** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [\`gzip\`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. */ + sarif: CodeScanningAnalysisSarifFile; + /** + * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date + */ + started_at?: string; + /** The name of the tool used to generate the code scanning analysis alert. */ + tool_name: CodeScanningAnalysisToolName; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, + method: "POST", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. * - * @tags issues - * @name IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @tags repos + * @name ReposListCollaborators + * @summary List repository collaborators + * @request GET:/repos/{owner}/{repo}/collaborators */ - issuesListLabelsForRepo: ( + reposListCollaborators: ( owner: string, repo: string, query?: { + /** + * Filter collaborators returned by their affiliation. Can be one of: + * \\* \`outside\`: All outside collaborators of an organization-owned repository. + * \\* \`direct\`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \\* \`all\`: All collaborators the authenticated user can see. + * @default "all" + */ + affiliation?: "outside" | "direct" | "all"; /** * Page number of the results to fetch. * @default 1 @@ -31061,8 +28936,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", query: query, format: "json", @@ -31070,52 +28945,58 @@ export class Api< }), /** - * No description + * @description For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Team members will include the members of child teams. * - * @tags issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @tags repos + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} */ - issuesCreateLabel: ( + reposCheckCollaborator: ( owner: string, repo: string, - data: { - /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ - color?: string; - /** A short description of the label. */ - description?: string; - /** The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ - name: string; - }, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "GET", ...params, }), /** - * No description + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). **Rate limits** To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. * - * @tags issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @tags repos + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - issuesGetLabel: ( + reposAddCollaborator: ( owner: string, repo: string, - name: string, + username: string, + data: { + /** + * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: + * \\* \`pull\` - can pull, but not push to or administer this repository. + * \\* \`push\` - can pull and push, but not administer this repository. + * \\* \`admin\` - can pull, push and administer this repository. + * \\* \`maintain\` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. + * \\* \`triage\` - Recommended for contributors who need to proactively manage issues and pull requests without write access. + * @default "push" + */ + permission?: "pull" | "push" | "admin" | "maintain" | "triage"; + /** @example ""push"" */ + permissions?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -31123,89 +29004,93 @@ export class Api< /** * No description * - * @tags issues - * @name IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} */ - issuesUpdateLabel: ( + reposRemoveCollaborator: ( owner: string, repo: string, - name: string, - data: { - /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ - color?: string; - /** A short description of the label. */ - description?: string; - /** The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ - new_name?: string; - }, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. * - * @tags issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @tags repos + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - issuesDeleteLabel: ( + reposGetCollaboratorPermissionLevel: ( owner: string, repo: string, - name: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, + method: "GET", + format: "json", ...params, }), /** - * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. + * @description Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. * * @tags repos - * @name ReposListLanguages - * @summary List repository languages - * @request GET:/repos/{owner}/{repo}/languages + * @name ReposListCommitCommentsForRepo + * @summary List commit comments for a repository + * @request GET:/repos/{owner}/{repo}/comments */ - reposListLanguages: ( + reposListCommitCommentsForRepo: ( owner: string, repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/languages\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. + * No description * - * @tags licenses - * @name LicensesGetForRepo - * @summary Get the license for a repository - * @request GET:/repos/{owner}/{repo}/license + * @tags repos + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - licensesGetForRepo: ( + reposGetCommitComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/license\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, method: "GET", format: "json", ...params, @@ -31215,35 +29100,23 @@ export class Api< * No description * * @tags repos - * @name ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} */ - reposMerge: ( + reposUpdateCommitComment: ( owner: string, repo: string, + commentId: number, data: { - /** The name of the base branch that the head will be merged into. */ - base: string; - /** Commit message to use for the merge commit. If omitted, a default message will be used. */ - commit_message?: string; - /** The head to merge. This can be a branch name or a commit SHA1. */ - head: string; + /** The contents of the comment */ + body: string; }, params: RequestParams = {}, ) => - this.request< - Commit, - | BasicError - | { - /** @example ""https://docs.github.com/rest/reference/repos#perform-a-merge"" */ - documentation_url?: string; - message?: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/merges\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -31253,20 +29126,46 @@ export class Api< /** * No description * - * @tags issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @tags repos + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - issuesListMilestones: ( + reposDeleteCommitComment: ( owner: string, repo: string, + commentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + * + * @tags reactions + * @name ReactionsListForCommitComment + * @summary List reactions for a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions + */ + reactionsListForCommitComment: ( + owner: string, + repo: string, + commentId: number, query?: { - /** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" - */ - direction?: "asc" | "desc"; + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** * Page number of the results to fetch. * @default 1 @@ -31277,21 +29176,18 @@ export class Api< * @default 30 */ per_page?: number; - /** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" - */ - sort?: "due_on" | "completeness"; - /** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -31299,33 +29195,40 @@ export class Api< }), /** - * No description + * @description Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this commit comment. * - * @tags issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @tags reactions + * @name ReactionsCreateForCommitComment + * @summary Create reaction for a commit comment + * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - issuesCreateMilestone: ( + reactionsCreateForCommitComment: ( owner: string, repo: string, + commentId: number, data: { - /** A description of the milestone. */ - description?: string; - /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - due_on?: string; - /** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" - */ - state?: "open" | "closed"; - /** The title of the milestone. */ - title: string; + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -31334,110 +29237,63 @@ export class Api< }), /** - * No description - * - * @tags issues - * @name IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} - */ - issuesGetMilestone: ( - owner: string, - repo: string, - milestoneNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @tags issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} - */ - issuesUpdateMilestone: ( - owner: string, - repo: string, - milestoneNumber: number, - data: { - /** A description of the milestone. */ - description?: string; - /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - due_on?: string; - /** - * The state of the milestone. Either \`open\` or \`closed\`. - * @default "open" - */ - state?: "open" | "closed"; - /** The title of the milestone. */ - title?: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * No description + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). * - * @tags issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags reactions + * @name ReactionsDeleteForCommitComment + * @summary Delete a commit comment reaction + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} */ - issuesDeleteMilestone: ( + reactionsDeleteForCommitComment: ( owner: string, repo: string, - milestoneNumber: number, + commentId: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, method: "DELETE", ...params, }), /** - * No description + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @tags repos + * @name ReposListCommits + * @summary List commits + * @request GET:/repos/{owner}/{repo}/commits */ - issuesListLabelsForMilestone: ( + reposListCommits: ( owner: string, repo: string, - milestoneNumber: number, query?: { + /** GitHub login or email address by which to filter by commit author. */ + author?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; + /** Only commits containing this file path will be returned. */ + path?: string; /** * Results per page (max 100) * @default 30 */ per_page?: number; + /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually \`master\`). */ + sha?: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + until?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits\`, method: "GET", query: query, format: "json", @@ -31445,46 +29301,61 @@ export class Api< }), /** - * @description List all notifications for the current user. + * @description Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. * - * @tags activity - * @name ActivityListRepoNotificationsForAuthenticatedUser - * @summary List repository notifications for the authenticated user - * @request GET:/repos/{owner}/{repo}/notifications + * @tags repos + * @name ReposListBranchesForHeadCommit + * @summary List branches for HEAD commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head */ - activityListRepoNotificationsForAuthenticatedUser: ( + reposListBranchesForHeadCommit: ( + owner: string, + repo: string, + commitSha: string, + params: RequestParams = {}, + ) => + this.request< + BranchShort[], + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * + * @tags repos + * @name ReposListCommentsForCommit + * @summary List commit comments + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + */ + reposListCommentsForCommit: ( owner: string, repo: string, + commitSha: string, query?: { - /** - * If \`true\`, show notifications marked as read. - * @default false - */ - all?: boolean; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; - /** - * If \`true\`, only shows notifications in which the user is directly participating or mentioned. - * @default false - */ - participating?: boolean; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, method: "GET", query: query, format: "json", @@ -31492,165 +29363,168 @@ export class Api< }), /** - * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. + * @description Create a comment for a commit using its \`:commit_sha\`. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags activity - * @name ActivityMarkRepoNotificationsAsRead - * @summary Mark repository notifications as read - * @request PUT:/repos/{owner}/{repo}/notifications + * @tags repos + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - activityMarkRepoNotificationsAsRead: ( + reposCreateCommitComment: ( owner: string, repo: string, + commitSha: string, data: { - /** Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. Default: The current timestamp. */ - last_read_at?: string; + /** The contents of the comment. */ + body: string; + /** **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ + line?: number; + /** Relative path of the file to comment on. */ + path?: string; + /** Line index in the diff to comment on. */ + position?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + method: "POST", body: data, type: ContentType.Json, - ...params, - }), - - /** - * No description - * - * @tags repos - * @name ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages - */ - reposGetPages: (owner: string, repo: string, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "GET", format: "json", ...params, }), /** - * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." + * @description Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. * * @tags repos - * @name ReposCreatePagesSite - * @summary Create a GitHub Pages site - * @request POST:/repos/{owner}/{repo}/pages + * @name ReposListPullRequestsAssociatedWithCommit + * @summary List pull requests associated with a commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls */ - reposCreatePagesSite: ( + reposListPullRequestsAssociatedWithCommit: ( owner: string, repo: string, - data: { - /** The source branch and directory used to publish your Pages site. */ - source: { - /** The repository branch used to publish your site's source files. */ - branch: string; - /** - * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` - * @default "/" - */ - path?: "/" | "/docs"; - }; + commitSha: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => this.request< - Page, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError + PullRequestSimple[], + { + documentation_url: string; + message: string; + } >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). + * @description Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint. **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch \`diff\` and \`patch\` formats. Diffs with binary data will have no \`patch\` property. To return only the SHA-1 hash of the commit reference, you can provide the \`sha\` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the \`Accept\` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * * @tags repos - * @name ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} */ - reposUpdateInformationAboutPagesSite: ( + reposGetCommit: ( owner: string, repo: string, - data: { - /** Specify a custom domain for the repository. Sending a \`null\` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ - cname?: string | null; - /** Configures access controls for the GitHub Pages site. If public is set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to \`internal\` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ - public?: boolean; - /** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ - source: - | "gh-pages" - | "master" - | "master /docs" - | { - /** The repository branch used to publish your site's source files. */ - branch: string; - /** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ - path: "/" | "/docs"; - }; - }, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array. Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the \`repo\` scope to get check runs in a private repository. * - * @tags repos - * @name ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @tags checks + * @name ChecksListForRef + * @summary List check runs for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs */ - reposDeletePagesSite: ( + checksListForRef: ( owner: string, repo: string, + ref: string, + query?: { + /** Returns check runs with the specified \`name\`. */ + check_name?: string; + /** + * Filters check runs by their \`completed_at\` timestamp. Can be one of \`latest\` (returning the most recent check runs) or \`all\`. + * @default "latest" + */ + filter?: "latest" | "all"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Returns check runs with the specified \`status\`. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. */ + status?: "queued" | "in_progress" | "completed"; + }, params: RequestParams = {}, ) => this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError + { + check_runs: CheckRun[]; + total_count: number; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "DELETE", + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @description **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`. Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name. GitHub Apps must have the \`checks:read\` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the \`repo\` scope to get check suites in a private repository. * - * @tags repos - * @name ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @tags checks + * @name ChecksListSuitesForRef + * @summary List check suites for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites */ - reposListPagesBuilds: ( + checksListSuitesForRef: ( owner: string, repo: string, + ref: string, query?: { + /** + * Filters check suites by GitHub App \`id\`. + * @example 1 + */ + app_id?: number; + /** Returns check runs with the specified \`name\`. */ + check_name?: string; /** * Page number of the results to fetch. * @default 1 @@ -31664,8 +29538,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, + this.request< + { + check_suites: CheckSuite[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, method: "GET", query: query, format: "json", @@ -31673,77 +29553,38 @@ export class Api< }), /** - * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. - * - * @tags repos - * @name ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds - */ - reposRequestPagesBuild: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, - method: "POST", - format: "json", - ...params, - }), - - /** - * No description + * @description Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. Additionally, a combined \`state\` is returned. The \`state\` is one of: * **failure** if any of the contexts report as \`error\` or \`failure\` * **pending** if there are no statuses or a context is \`pending\` * **success** if the latest status for all contexts is \`success\` * * @tags repos - * @name ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - reposGetLatestPagesBuild: ( + reposGetCombinedStatusForRef: ( owner: string, repo: string, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`. * * @tags repos - * @name ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} - */ - reposGetPagesBuild: ( - owner: string, - repo: string, - buildId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. - * - * @tags projects - * @name ProjectsListForRepo - * @summary List repository projects - * @request GET:/repos/{owner}/{repo}/projects + * @name ReposListCommitStatusesForRef + * @summary List commit statuses for a reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses */ - projectsListForRepo: ( + reposListCommitStatusesForRef: ( owner: string, repo: string, + ref: string, query?: { /** * Page number of the results to fetch. @@ -31755,16 +29596,11 @@ export class Api< * @default 30 */ per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/projects\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, method: "GET", query: query, format: "json", @@ -31772,156 +29608,87 @@ export class Api< }), /** - * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. + * @description Returns the contents of the repository's code of conduct file, if one is detected. A code of conduct is detected if there is a file named \`CODE_OF_CONDUCT\` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. * - * @tags projects - * @name ProjectsCreateForRepo - * @summary Create a repository project - * @request POST:/repos/{owner}/{repo}/projects + * @tags codes-of-conduct + * @name CodesOfConductGetForRepo + * @summary Get the code of conduct for a repository + * @request GET:/repos/{owner}/{repo}/community/code_of_conduct */ - projectsCreateForRepo: ( + codesOfConductGetForRepo: ( owner: string, repo: string, - data: { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/projects\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, + method: "GET", format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * @description This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\\_TEMPLATE, PULL\\_REQUEST\\_TEMPLATE, README, and CONTRIBUTING files. The \`health_percentage\` score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the \`health_percentage\` is \`100\`. If only one is present, then the \`health_percentage\` is \`25\`. \`content_reports_enabled\` is only returned for organization-owned repositories. * - * @tags pulls - * @name PullsList - * @summary List pull requests - * @request GET:/repos/{owner}/{repo}/pulls + * @tags repos + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - pullsList: ( + reposGetCommunityProfileMetrics: ( owner: string, repo: string, - query?: { - /** Filter pulls by base branch name. Example: \`gh-pages\`. */ - base?: string; - /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ - direction?: "asc" | "desc"; - /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ - head?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). - * @default "created" - */ - sort?: "created" | "updated" | "popularity" | "long-running"; - /** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ - state?: "open" | "closed" | "all"; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/profile\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Both \`:base\` and \`:head\` must be branch names in \`:repo\`. To compare branches across other repositories in the same network as \`:repo\`, use the format \`:branch\`. The response from the API is equivalent to running the \`git log base..head\` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file. **Working with large comparisons** The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) to enumerate all commits in the range. For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags pulls - * @name PullsCreate - * @summary Create a pull request - * @request POST:/repos/{owner}/{repo}/pulls + * @tags repos + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - pullsCreate: ( + reposCompareCommits: ( owner: string, repo: string, - data: { - /** The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ - base: string; - /** The contents of the pull request. */ - body?: string; - /** Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ - draft?: boolean; - /** The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace \`head\` with a user like this: \`username:branch\`. */ - head: string; - /** @example 1 */ - issue?: number; - /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ - maintainer_can_modify?: boolean; - /** The title of the new pull request. */ - title?: string; - }, + base: string, + head: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, + method: "GET", format: "json", ...params, }), /** - * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. + * @description Gets the contents of a file or directory in a repository. Specify the file path or directory in \`:path\`. If you omit \`:path\`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML (when supported). All content types support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent object format. **Note**: * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees API](https://docs.github.com/rest/reference/git#get-a-tree). * This API supports files up to 1 megabyte in size. #### If the content is a directory The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule". #### If the content is a symlink If the requested \`:path\` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself. #### If the content is a submodule The \`submodule_git_url\` identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values. * - * @tags pulls - * @name PullsListReviewCommentsForRepo - * @summary List review comments in a repository - * @request GET:/repos/{owner}/{repo}/pulls/comments + * @tags repos + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} */ - pullsListReviewCommentsForRepo: ( + reposGetContent: ( owner: string, repo: string, + path: string, query?: { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, method: "GET", query: query, format: "json", @@ -31929,47 +29696,104 @@ export class Api< }), /** - * @description Provides details for a review comment. + * @description Creates a new file or replaces an existing file in a repository. * - * @tags pulls - * @name PullsGetReviewComment - * @summary Get a review comment for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags repos + * @name ReposCreateOrUpdateFileContents + * @summary Create or update file contents + * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - pullsGetReviewComment: ( + reposCreateOrUpdateFileContents: ( owner: string, repo: string, - commentId: number, + path: string, + data: { + /** The author of the file. Default: The \`committer\` or the authenticated user if you omit \`committer\`. */ + author?: { + /** @example ""2013-01-15T17:13:22+05:00"" */ + date?: string; + /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ + email: string; + /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ + name: string; + }; + /** The branch name. Default: the repository’s default branch (usually \`master\`) */ + branch?: string; + /** The person that committed the file. Default: the authenticated user. */ + committer?: { + /** @example ""2013-01-05T13:13:22+05:00"" */ + date?: string; + /** The email of the author or committer of the commit. You'll receive a \`422\` status code if \`email\` is omitted. */ + email: string; + /** The name of the author or committer of the commit. You'll receive a \`422\` status code if \`name\` is omitted. */ + name: string; + }; + /** The new file content, using Base64 encoding. */ + content: string; + /** The commit message. */ + message: string; + /** **Required if you are updating a file**. The blob SHA of the file being replaced. */ + sha?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Enables you to edit a review comment. + * @description Deletes a file in a repository. You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author. The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used. You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code. * - * @tags pulls - * @name PullsUpdateReviewComment - * @summary Update a review comment for a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags repos + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - pullsUpdateReviewComment: ( + reposDeleteFile: ( owner: string, repo: string, - commentId: number, + path: string, data: { - /** The text of the reply to the review comment. */ - body: string; + /** object containing information about the author. */ + author?: { + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The branch name. Default: the repository’s default branch (usually \`master\`) */ + branch?: string; + /** object containing information about the committer. */ + committer?: { + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The commit message. */ + message: string; + /** The blob SHA of the file being replaced. */ + sha: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "PATCH", + this.request< + FileCommit, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -31977,48 +29801,57 @@ export class Api< }), /** - * @description Deletes a review comment. + * @description Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. * - * @tags pulls - * @name PullsDeleteReviewComment - * @summary Delete a review comment for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags repos + * @name ReposListContributors + * @summary List repository contributors + * @request GET:/repos/{owner}/{repo}/contributors */ - pullsDeleteReviewComment: ( + reposListContributors: ( owner: string, repo: string, - commentId: number, + query?: { + /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ + anon?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/contributors\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description Simple filtering of deployments is available via query parameters: * - * @tags reactions - * @name ReactionsListForPullRequestReviewComment - * @summary List reactions for a pull request review comment - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments */ - reactionsListForPullRequestReviewComment: ( + reposListDeployments: ( owner: string, repo: string, - commentId: number, query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). + * @default "none" + */ + environment?: string; /** * Page number of the results to fetch. * @default 1 @@ -32029,18 +29862,26 @@ export class Api< * @default 30 */ per_page?: number; + /** + * The name of the ref. This can be a branch, tag, or SHA. + * @default "none" + */ + ref?: string; + /** + * The SHA recorded at creation time. + * @default "none" + */ + sha?: string; + /** + * The name of the task for the deployment (e.g., \`deploy\` or \`deploy:migrations\`). + * @default "none" + */ + task?: string; }, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", query: query, format: "json", @@ -32048,40 +29889,69 @@ export class Api< }), /** - * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. + * @description Deployments offer a few configurable parameters with certain defaults. The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter makes it easier to track which environments have requested deployments. The default environment is \`production\`. The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a \`success\` state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with \`repo\` or \`repo_deployment\` scopes can create a deployment for a given ref. #### Merged branch response You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. #### Merge conflict response This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts. #### Failed commit status checks This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\` status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`. * - * @tags reactions - * @name ReactionsCreateForPullRequestReviewComment - * @summary Create reaction for a pull request review comment - * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags repos + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - reactionsCreateForPullRequestReviewComment: ( + reposCreateDeployment: ( owner: string, repo: string, - commentId: number, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** + * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. + * @default true + */ + auto_merge?: boolean; + /** @example ""1776-07-04T00:00:00.000-07:52"" */ + created_at?: string; + /** + * Short description of the deployment. + * @default "" + */ + description?: string | null; + /** + * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). + * @default "production" + */ + environment?: string; + /** JSON payload with extra information about the deployment. */ + payload?: Record | string; + /** + * Specifies if the given environment is one that end-users directly interact with. Default: \`true\` when \`environment\` is \`production\` and \`false\` otherwise. + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + production_environment?: boolean; + /** The ref to deploy. This can be a branch, tag, or SHA. */ + ref: string; + /** The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ + required_contexts?: string[]; + /** + * Specifies a task to execute (e.g., \`deploy\` or \`deploy:migrations\`). + * @default "deploy" + */ + task?: string; + /** + * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: \`false\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default false + */ + transient_environment?: boolean; }, params: RequestParams = {}, ) => this.request< - Reaction, + Deployment, | { - documentation_url: string; - message: string; + /** @example ""https://docs.github.com/rest/reference/repos#create-a-deployment"" */ + documentation_url?: string; + message?: string; } | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + path: \`/repos/\${owner}/\${repo}/deployments\`, method: "POST", body: data, type: ContentType.Json, @@ -32090,97 +29960,59 @@ export class Api< }), /** - * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). - * - * @tags reactions - * @name ReactionsDeleteForPullRequestComment - * @summary Delete a pull request comment reaction - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} - */ - reactionsDeleteForPullRequestComment: ( - owner: string, - repo: string, - commentId: number, - reactionId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * No description * - * @tags pulls - * @name PullsGet - * @summary Get a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags repos + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} */ - pullsGet: ( + reposGetDeployment: ( owner: string, repo: string, - pullNumber: number, + deploymentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, method: "GET", format: "json", ...params, }), /** - * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + * @description To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with \`repo\` or \`repo_deployment\` scopes can delete an inactive deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." * - * @tags pulls - * @name PullsUpdate - * @summary Update a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags repos + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} */ - pullsUpdate: ( + reposDeleteDeployment: ( owner: string, repo: string, - pullNumber: number, - data: { - /** The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ - base?: string; - /** The contents of the pull request. */ - body?: string; - /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ - maintainer_can_modify?: boolean; - /** State of this Pull Request. Either \`open\` or \`closed\`. */ - state?: "open" | "closed"; - /** The title of the pull request. */ - title?: string; - }, + deploymentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + method: "DELETE", ...params, }), /** - * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. + * @description Users with pull access can view deployment statuses for a deployment: * - * @tags pulls - * @name PullsListReviewComments - * @summary List review comments on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags repos + * @name ReposListDeploymentStatuses + * @summary List deployment statuses + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - pullsListReviewComments: ( + reposListDeploymentStatuses: ( owner: string, repo: string, - pullNumber: number, + deploymentId: number, query?: { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -32191,18 +30023,11 @@ export class Api< * @default 30 */ per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, method: "GET", query: query, format: "json", @@ -32210,41 +30035,62 @@ export class Api< }), /** - * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Users with \`push\` access can create deployment statuses for a given deployment. GitHub Apps require \`read & write\` access to "Deployments" and \`read-only\` access to "Repo contents" (for private repos). OAuth Apps require the \`repo_deployment\` scope. * - * @tags pulls - * @name PullsCreateReviewComment - * @summary Create a review comment for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags repos + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - pullsCreateReviewComment: ( + reposCreateDeploymentStatus: ( owner: string, repo: string, - pullNumber: number, + deploymentId: number, data: { - /** The text of the review comment. */ - body: string; - /** The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the \`position\`. */ - commit_id?: string; - /** @example 2 */ - in_reply_to?: number; - /** **Required with \`comfort-fade\` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ - line?: number; - /** The relative path to the file that necessitates a comment. */ - path: string; - /** **Required without \`comfort-fade\` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ - position?: number; - /** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ - side?: "LEFT" | "RIGHT"; - /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_line\` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ - start_line?: number; - /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ - start_side?: "LEFT" | "RIGHT" | "side"; + /** + * Adds a new \`inactive\` status to all prior non-transient, non-production environment deployments with the same repository and \`environment\` name as the created status's deployment. An \`inactive\` status is only added to deployments that had a \`success\` state. Default: \`true\` + * **Note:** To add an \`inactive\` status to \`production\` environments, you must use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + auto_inactive?: boolean; + /** + * A short description of the status. The maximum description length is 140 characters. + * @default "" + */ + description?: string; + /** Name for the target deployment environment, which can be changed when setting a deploy status. For example, \`production\`, \`staging\`, or \`qa\`. **Note:** This parameter requires you to use the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ + environment?: "production" | "staging" | "qa"; + /** + * Sets the URL for accessing your environment. Default: \`""\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default "" + */ + environment_url?: string; + /** + * The full URL of the deployment's output. This parameter replaces \`target_url\`. We will continue to accept \`target_url\` to support legacy uses, but we recommend replacing \`target_url\` with \`log_url\`. Setting \`log_url\` will automatically set \`target_url\` to the same value. Default: \`""\` + * **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + * @default "" + */ + log_url?: string; + /** The state of the status. Can be one of \`error\`, \`failure\`, \`inactive\`, \`in_progress\`, \`queued\` \`pending\`, or \`success\`. **Note:** To use the \`inactive\` state, you must provide the [\`application/vnd.github.ant-man-preview+json\`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the \`in_progress\` and \`queued\` states, you must provide the [\`application/vnd.github.flash-preview+json\`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to \`inactive\`, the deployment will be shown as \`destroyed\` in GitHub. */ + state: + | "error" + | "failure" + | "inactive" + | "in_progress" + | "queued" + | "pending" + | "success"; + /** + * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the \`log_url\` parameter, which replaces \`target_url\`. + * @default "" + */ + target_url?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, method: "POST", body: data, type: ContentType.Json, @@ -32253,45 +30099,72 @@ export class Api< }), /** - * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Users with pull access can view a deployment status for a deployment: * - * @tags pulls - * @name PullsCreateReplyForReviewComment - * @summary Create a reply for a review comment - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + * @tags repos + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - pullsCreateReplyForReviewComment: ( + reposGetDeploymentStatus: ( + owner: string, + repo: string, + deploymentId: number, + statusId: number, + params: RequestParams = {}, + ) => + this.request< + DeploymentStatus, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with \`repo\` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. - GitHub Apps with both \`metadata:read\` and \`contents:read&write\` permissions. This input example shows how you can use the \`client_payload\` as a test to debug your workflow. + * + * @tags repos + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches + */ + reposCreateDispatchEvent: ( owner: string, repo: string, - pullNumber: number, - commentId: number, data: { - /** The text of the review comment. */ - body: string; + /** JSON payload with extra information about the webhook event that your action or worklow may use. */ + client_payload?: Record; + /** A custom webhook event name. */ + event_type: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/dispatches\`, method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. + * No description * - * @tags pulls - * @name PullsListCommits - * @summary List commits on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events */ - pullsListCommits: ( + activityListRepoEvents: ( owner: string, repo: string, - pullNumber: number, query?: { /** * Page number of the results to fetch. @@ -32306,8 +30179,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/events\`, method: "GET", query: query, format: "json", @@ -32315,17 +30188,16 @@ export class Api< }), /** - * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. + * No description * - * @tags pulls - * @name PullsListFiles - * @summary List pull requests files - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files + * @tags repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks */ - pullsListFiles: ( + reposListForks: ( owner: string, repo: string, - pullNumber: number, query?: { /** * Page number of the results to fetch. @@ -32337,11 +30209,16 @@ export class Api< * @default 30 */ per_page?: number; + /** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ + sort?: "newest" | "oldest" | "stargazers"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, method: "GET", query: query, format: "json", @@ -32349,60 +30226,25 @@ export class Api< }), /** - * No description - * - * @tags pulls - * @name PullsCheckIfMerged - * @summary Check if a pull request has been merged - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge - */ - pullsCheckIfMerged: ( - owner: string, - repo: string, - pullNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, - method: "GET", - ...params, - }), - - /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description Create a fork for the authenticated user. **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). * - * @tags pulls - * @name PullsMerge - * @summary Merge a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags repos + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - pullsMerge: ( + reposCreateFork: ( owner: string, repo: string, - pullNumber: number, data: { - /** Extra detail to append to automatic commit message. */ - commit_message?: string; - /** Title for the automatic commit message. */ - commit_title?: string; - /** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ - merge_method?: "merge" | "squash" | "rebase"; - /** SHA that pull request head must match to allow merge. */ - sha?: string; - } | null, + /** Optional parameter to specify the organization name if forking into an organization. */ + organization?: string; + }, params: RequestParams = {}, ) => - this.request< - PullRequestMergeResult, - | BasicError - | { - documentation_url?: string; - message?: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -32412,220 +30254,205 @@ export class Api< /** * No description * - * @tags pulls - * @name PullsListRequestedReviewers - * @summary List requested reviewers for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags git + * @name GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - pullsListRequestedReviewers: ( + gitCreateBlob: ( owner: string, repo: string, - pullNumber: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + data: { + /** The new blob's content. */ + content: string; /** - * Results per page (max 100) - * @default 30 + * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. + * @default "utf-8" */ - per_page?: number; + encoding?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. * - * @tags pulls - * @name PullsRequestReviewers - * @summary Request reviewers for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags git + * @name GitGetBlob + * @summary Get a blob + * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} */ - pullsRequestReviewers: ( + gitGetBlob: ( owner: string, repo: string, - pullNumber: number, - data: { - /** An array of user \`login\`s that will be requested. */ - reviewers?: string[]; - /** An array of team \`slug\`s that will be requested. */ - team_reviewers?: string[]; - }, + fileSha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags pulls - * @name PullsRemoveRequestedReviewers - * @summary Remove requested reviewers from a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags git + * @name GitCreateCommit + * @summary Create a commit + * @request POST:/repos/{owner}/{repo}/git/commits */ - pullsRemoveRequestedReviewers: ( + gitCreateCommit: ( owner: string, repo: string, - pullNumber: number, data: { - /** An array of user \`login\`s that will be removed. */ - reviewers?: string[]; - /** An array of team \`slug\`s that will be removed. */ - team_reviewers?: string[]; + /** Information about the author of the commit. By default, the \`author\` will be the authenticated user and the current date. See the \`author\` and \`committer\` object below for details. */ + author?: { + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** Information about the person who is making the commit. By default, \`committer\` will use the information set in \`author\`. See the \`author\` and \`committer\` object below for details. */ + committer?: { + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + /** The name of the author (or committer) of the commit */ + name?: string; + }; + /** The commit message */ + message: string; + /** The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ + parents?: string[]; + /** The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the \`gpgsig\` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a \`signature\` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ + signature?: string; + /** The SHA of the tree object this commit points to */ + tree: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description The list of reviews returns in chronological order. + * @description Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags pulls - * @name PullsListReviews - * @summary List reviews for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @tags git + * @name GitGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} */ - pullsListReviews: ( + gitGetCommit: ( owner: string, repo: string, - pullNumber: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + commitSha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + * @description Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array. When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`. * - * @tags pulls - * @name PullsCreateReview - * @summary Create a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews - */ - pullsCreateReview: ( - owner: string, - repo: string, - pullNumber: number, - data: { - /** **Required** when using \`REQUEST_CHANGES\` or \`COMMENT\` for the \`event\` parameter. The body text of the pull request review. */ - body?: string; - /** Use the following table to specify the location, destination, and contents of the draft review comment. */ - comments?: { - /** Text of the review comment. */ - body: string; - /** @example 28 */ - line?: number; - /** The relative path to the file that necessitates a review comment. */ - path: string; - /** The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ - position?: number; - /** @example "RIGHT" */ - side?: string; - /** @example 26 */ - start_line?: number; - /** @example "LEFT" */ - start_side?: string; - }[]; - /** The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the \`position\`. Defaults to the most recent commit in the pull request when you do not specify a value. */ - commit_id?: string; - /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ - event?: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; + * @tags git + * @name GitListMatchingRefs + * @summary List matching references + * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + */ + gitListMatchingRefs: ( + owner: string, + repo: string, + ref: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/\` for branches and \`tags/\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned. **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * - * @tags pulls - * @name PullsGetReview - * @summary Get a review for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags git + * @name GitGetRef + * @summary Get a reference + * @request GET:/repos/{owner}/{repo}/git/ref/{ref} */ - pullsGetReview: ( + gitGetRef: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", format: "json", ...params, }), /** - * @description Update the review summary comment with new text. + * @description Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. * - * @tags pulls - * @name PullsUpdateReview - * @summary Update a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags git + * @name GitCreateRef + * @summary Create a reference + * @request POST:/repos/{owner}/{repo}/git/refs */ - pullsUpdateReview: ( + gitCreateRef: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, data: { - /** The body text of the pull request review. */ - body: string; + /** @example ""refs/heads/newbranch"" */ + key?: string; + /** The name of the fully qualified reference (ie: \`refs/heads/master\`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ + ref: string; + /** The SHA1 value for this reference. */ + sha: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -32635,84 +30462,90 @@ export class Api< /** * No description * - * @tags pulls - * @name PullsDeletePendingReview - * @summary Delete a pending review for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - pullsDeletePendingReview: ( + gitUpdateRef: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + ref: string, + data: { + /** + * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to \`false\` will make sure you're not overwriting work. + * @default false + */ + force?: boolean; + /** The SHA1 value to set this reference to */ + sha: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List comments for a specific pull request review. + * No description * - * @tags pulls - * @name PullsListCommentsForReview - * @summary List comments for a pull request review - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + * @tags git + * @name GitDeleteRef + * @summary Delete a reference + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - pullsListCommentsForReview: ( + gitDeleteRef: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "DELETE", ...params, }), /** - * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. + * @description 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](https://docs.github.com/rest/reference/git#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags pulls - * @name PullsDismissReview - * @summary Dismiss a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals + * @tags git + * @name GitCreateTag + * @summary Create a tag object + * @request POST:/repos/{owner}/{repo}/git/tags */ - pullsDismissReview: ( + gitCreateTag: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, data: { - /** @example ""APPROVE"" */ - event?: string; - /** The message for the pull request review dismissal */ + /** The tag message. */ message: string; + /** 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; + /** An object with information about the individual creating the tag. */ + tagger?: { + /** When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + date?: string; + /** The email of the author of the tag */ + email?: string; + /** The name of the author of the tag */ + name?: string; + }; + /** 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"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -32720,67 +30553,70 @@ export class Api< }), /** - * No description + * @description **Signature verification object** The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object: | Name | Type | Description | | ---- | ---- | ----------- | | \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. | | \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | \`signature\` | \`string\` | The signature that was extracted from the commit. | | \`payload\` | \`string\` | The value that was signed. | These are the possible values for \`reason\` in the \`verification\` object: | Value | Description | | ----- | ----------- | | \`expired_key\` | The key that made the signature is expired. | | \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | \`gpgverify_error\` | There was an error communicating with the signature verification service. | | \`gpgverify_unavailable\` | The signature verification service is currently unavailable. | | \`unsigned\` | The object does not include a signature. | | \`unknown_signature_type\` | A non-PGP signature was found in the commit. | | \`no_user\` | No user was associated with the \`committer\` email address in the commit. | | \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on her/his account. | | \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. | | \`unknown_key\` | The key that made the signature has not been registered with any user's account. | | \`malformed_signature\` | There was an error parsing the signature. | | \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | \`valid\` | None of the above errors applied, so the signature is considered to be verified. | * - * @tags pulls - * @name PullsSubmitReview - * @summary Submit a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + * @tags git + * @name GitGetTag + * @summary Get a tag + * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} */ - pullsSubmitReview: ( + gitGetTag: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, - data: { - /** The body text of the pull request review */ - body?: string; - /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ - event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; - }, + tagSha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, + method: "GET", format: "json", ...params, }), /** - * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + * @description The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." * - * @tags pulls - * @name PullsUpdateBranch - * @summary Update a pull request branch - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch + * @tags git + * @name GitCreateTree + * @summary Create a tree + * @request POST:/repos/{owner}/{repo}/git/trees */ - pullsUpdateBranch: ( + gitCreateTree: ( owner: string, repo: string, - pullNumber: number, data: { - /** The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a \`422 Unprocessable Entity\` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ - expected_head_sha?: string; - } | null, - params: RequestParams = {}, - ) => - this.request< - { - message?: string; - url?: string; - }, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, - method: "PUT", + /** + * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by \`base_tree\` and entries defined in the \`tree\` parameter. Entries defined in the \`tree\` parameter will overwrite items from \`base_tree\` with the same \`path\`. If you're creating new changes on a branch, then normally you'd set \`base_tree\` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. + * If not provided, GitHub will create a new Git tree object from only the entries defined in the \`tree\` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the \`tree\` parameter will be listed as deleted by the new commit. + */ + base_tree?: string; + /** Objects (of \`path\`, \`mode\`, \`type\`, and \`sha\`) specifying a tree structure. */ + tree: { + /** + * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or \`tree.sha\`. + * + * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. + */ + content?: string; + /** The file mode; 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. */ + mode?: "100644" | "100755" | "040000" | "160000" | "120000"; + /** The file referenced in the tree. */ + path?: string; + /** + * The SHA1 checksum ID of the object in the tree. Also called \`tree.sha\`. If the value is \`null\` then the file will be deleted. + * + * **Note:** Use either \`tree.sha\` or \`content\` to specify the contents of the entry. Using both \`tree.sha\` and \`content\` will return an error. + */ + sha?: string | null; + /** Either \`blob\`, \`tree\`, or \`commit\`. */ + type?: "blob" | "tree" | "commit"; + }[]; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -32788,24 +30624,25 @@ export class Api< }), /** - * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + * @description Returns a single tree using the SHA1 value for that tree. If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. * - * @tags repos - * @name ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @tags git + * @name GitGetTree + * @summary Get a tree + * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} */ - reposGetReadme: ( + gitGetTree: ( owner: string, repo: string, + treeSha: string, query?: { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; + /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in \`:tree_sha\`. For example, setting \`recursive\` to any of the following will enable returning objects or subtrees: \`0\`, \`1\`, \`"true"\`, and \`"false"\`. Omit this parameter to prevent recursively returning objects or subtrees. */ + recursive?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/readme\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, method: "GET", query: query, format: "json", @@ -32813,14 +30650,14 @@ export class Api< }), /** - * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + * No description * * @tags repos - * @name ReposListReleases - * @summary List releases - * @request GET:/repos/{owner}/{repo}/releases + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks */ - reposListReleases: ( + reposListWebhooks: ( owner: string, repo: string, query?: { @@ -32837,8 +30674,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, method: "GET", query: query, format: "json", @@ -32846,40 +30683,49 @@ export class Api< }), /** - * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can share the same \`config\` as long as those webhooks do not have any \`events\` that overlap. * * @tags repos - * @name ReposCreateRelease - * @summary Create a release - * @request POST:/repos/{owner}/{repo}/releases + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - reposCreateRelease: ( + reposCreateWebhook: ( owner: string, repo: string, data: { - /** Text describing the contents of the tag. */ - body?: string; /** - * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. - * @default false + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - draft?: boolean; - /** The name of the release. */ - name?: string; + active?: boolean; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ + config: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** @example ""sha256"" */ + digest?: string; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** @example ""abc"" */ + token?: string; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + }; /** - * \`true\` to identify the release as a prerelease. \`false\` to identify the release as a full release. - * @default false + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] */ - prerelease?: boolean; - /** The name of the tag. */ - tag_name: string; - /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ - target_commitish?: string; + events?: string[]; + /** Use \`web\` to create a webhook. Default: \`web\`. This parameter only accepts the value \`web\`. */ + name?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, method: "POST", body: data, type: ContentType.Json, @@ -32888,57 +30734,73 @@ export class Api< }), /** - * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. + * @description Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." * * @tags repos - * @name ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @name ReposGetWebhook + * @summary Get a repository webhook + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposGetReleaseAsset: ( + reposGetWebhook: ( owner: string, repo: string, - assetId: number, + hookId: number, params: RequestParams = {}, ) => - this.request< - ReleaseAsset, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", format: "json", ...params, }), /** - * @description Users with push access to the repository can edit a release asset. + * @description Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." * * @tags repos - * @name ReposUpdateReleaseAsset - * @summary Update a release asset - * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @name ReposUpdateWebhook + * @summary Update a repository webhook + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposUpdateReleaseAsset: ( + reposUpdateWebhook: ( owner: string, repo: string, - assetId: number, + hookId: number, data: { - /** An alternate short description of the asset. Used in place of the filename. */ - label?: string; - /** The file name of the asset. */ - name?: string; - /** @example ""uploaded"" */ - state?: string; + /** + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true + */ + active?: boolean; + /** Determines a list of events to be added to the list of events that the Hook triggers for. */ + add_events?: string[]; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ + config?: { + /** @example ""bar@example.com"" */ + address?: string; + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** @example ""The Serious Room"" */ + room?: string; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url: WebhookConfigUrl; + }; + /** + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. + * @default ["push"] + */ + events?: string[]; + /** Determines a list of events to be removed from the list of events that the Hook triggers for. */ + remove_events?: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -32950,114 +30812,195 @@ export class Api< * No description * * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposDeleteReleaseAsset: ( + reposDeleteWebhook: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." Access tokens must have the \`read:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:read\` permission. + * + * @tags repos + * @name ReposGetWebhookConfigForRepo + * @summary Get a webhook configuration for a repository + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + */ + reposGetWebhookConfigForRepo: ( + owner: string, + repo: string, + hookId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." Access tokens must have the \`write:repo_hook\` or \`repo\` scope, and GitHub Apps must have the \`repository_hooks:write\` permission. + * + * @tags repos + * @name ReposUpdateWebhookConfigForRepo + * @summary Update a webhook configuration for a repository + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + */ + reposUpdateWebhookConfigForRepo: ( + owner: string, + repo: string, + hookId: number, + data: { + /** The media type used to serialize the payloads. Supported values include \`json\` and \`form\`. The default is \`form\`. */ + content_type?: WebhookConfigContentType; + /** Determines whether the SSL certificate of the host for \`url\` will be verified when delivering payloads. Supported values include \`0\` (verification is performed) and \`1\` (verification is not performed). The default is \`0\`. **We strongly recommend not setting this to \`1\` as you are subject to man-in-the-middle and other attacks.** */ + insecure_ssl?: WebhookConfigInsecureSsl; + /** If provided, the \`secret\` will be used as the \`key\` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + secret?: WebhookConfigSecret; + /** The URL to which the payloads will be delivered. */ + url?: WebhookConfigUrl; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * + * @tags repos + * @name ReposPingWebhook + * @summary Ping a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + */ + reposPingWebhook: ( owner: string, repo: string, - assetId: number, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, + method: "POST", ...params, }), /** - * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. + * @description 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/:hook_id/test\` * * @tags repos - * @name ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest + * @name ReposTestPushWebhook + * @summary Test the push repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests */ - reposGetLatestRelease: ( + reposTestPushWebhook: ( owner: string, repo: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/latest\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, + method: "POST", ...params, }), /** - * @description Get a published release with the specified tag. + * @description View the progress of an import. **Import status** This section includes details about the possible values of the \`status\` field of the Import Progress response. An import that does not have errors will progress through these steps: * \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL. * \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import). * \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. * \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects". * \`complete\` - the import is complete, and the repository is ready on GitHub. If there are problems, you will see one of these in the \`status\` field: * \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. * \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. * \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. **The project_choices field** When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. **Git LFS related fields** This section includes details about Git LFS related fields that may be present in the Import Progress response. * \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken. * \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step. * \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository. * \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. * - * @tags repos - * @name ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @tags migrations + * @name MigrationsGetImportStatus + * @summary Get an import status + * @request GET:/repos/{owner}/{repo}/import */ - reposGetReleaseByTag: ( + migrationsGetImportStatus: ( owner: string, repo: string, - tag: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, method: "GET", format: "json", ...params, }), /** - * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). + * @description Start a source import to a GitHub repository using GitHub Importer. * - * @tags repos - * @name ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @tags migrations + * @name MigrationsStartImport + * @summary Start an import + * @request PUT:/repos/{owner}/{repo}/import */ - reposGetRelease: ( + migrationsStartImport: ( owner: string, repo: string, - releaseId: number, + data: { + /** For a tfvc import, the name of the project that is being imported. */ + tfvc_project?: string; + /** The originating VCS type. Can be one of \`subversion\`, \`git\`, \`mercurial\`, or \`tfvc\`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ + vcs?: "subversion" | "git" | "mercurial" | "tfvc"; + /** If authentication is required, the password to provide to \`vcs_url\`. */ + vcs_password?: string; + /** The URL of the originating repository. */ + vcs_url: string; + /** If authentication is required, the username to provide to \`vcs_url\`. */ + vcs_username?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Users with push access to the repository can edit a release. + * @description An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted. * - * @tags repos - * @name ReposUpdateRelease - * @summary Update a release - * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + * @tags migrations + * @name MigrationsUpdateImport + * @summary Update an import + * @request PATCH:/repos/{owner}/{repo}/import */ - reposUpdateRelease: ( + migrationsUpdateImport: ( owner: string, repo: string, - releaseId: number, data: { - /** Text describing the contents of the tag. */ - body?: string; - /** \`true\` makes the release a draft, and \`false\` publishes the release. */ - draft?: boolean; - /** The name of the release. */ - name?: string; - /** \`true\` to identify the release as a prerelease, \`false\` to identify the release as a full release. */ - prerelease?: boolean; - /** The name of the tag. */ - tag_name?: string; - /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ - target_commitish?: string; + /** @example ""project1"" */ + tfvc_project?: string; + /** @example ""git"" */ + vcs?: string; + /** The password to provide to the originating repository. */ + vcs_password?: string; + /** The username to provide to the originating repository. */ + vcs_username?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, method: "PATCH", body: data, type: ContentType.Json, @@ -33066,53 +31009,43 @@ export class Api< }), /** - * @description Users with push access to the repository can delete a release. + * @description Stop an import for a repository. * - * @tags repos - * @name ReposDeleteRelease - * @summary Delete a release - * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - reposDeleteRelease: ( + migrationsCancelImport: ( owner: string, repo: string, - releaseId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + path: \`/repos/\${owner}/\${repo}/import\`, method: "DELETE", ...params, }), /** - * No description + * @description Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot \`. This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. * - * @tags repos - * @name ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags migrations + * @name MigrationsGetCommitAuthors + * @summary Get commit authors + * @request GET:/repos/{owner}/{repo}/import/authors */ - reposListReleaseAssets: ( + migrationsGetCommitAuthors: ( owner: string, repo: string, - releaseId: number, query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors\`, method: "GET", query: query, format: "json", @@ -33120,132 +31053,75 @@ export class Api< }), /** - * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + * @description Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. * - * @tags repos - * @name ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags migrations + * @name MigrationsMapCommitAuthor + * @summary Map a commit author + * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} */ - reposUploadReleaseAsset: ( + migrationsMapCommitAuthor: ( owner: string, repo: string, - releaseId: number, - data: WebhookConfigUrl, - query?: { - label?: string; + authorId: number, + data: { + /** The new Git author email. */ + email?: string; + /** The new Git author name. */ name?: string; + /** @example ""can't touch this"" */ + remote_id?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, - method: "POST", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, + method: "PATCH", body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. - * - * @tags secret-scanning - * @name SecretScanningListAlertsForRepo - * @summary List secret scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts - */ - secretScanningListAlertsForRepo: ( - owner: string, - repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ - state?: "open" | "resolved"; - }, - params: RequestParams = {}, - ) => - this.request< - SecretScanningAlert[], - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. + * @description List files larger than 100MB found during the import * - * @tags secret-scanning - * @name SecretScanningGetAlert - * @summary Get a secret scanning alert - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags migrations + * @name MigrationsGetLargeFiles + * @summary Get large files + * @request GET:/repos/{owner}/{repo}/import/large_files */ - secretScanningGetAlert: ( + migrationsGetLargeFiles: ( owner: string, - repo: string, - alertNumber: AlertNumber, - params: RequestParams = {}, - ) => - this.request< - SecretScanningAlert, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/import/large_files\`, method: "GET", format: "json", ...params, }), /** - * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. + * @description You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). * - * @tags secret-scanning - * @name SecretScanningUpdateAlert - * @summary Update a secret scanning alert - * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags migrations + * @name MigrationsSetLfsPreference + * @summary Update Git LFS preference + * @request PATCH:/repos/{owner}/{repo}/import/lfs */ - secretScanningUpdateAlert: ( + migrationsSetLfsPreference: ( owner: string, repo: string, - alertNumber: AlertNumber, data: { - /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ - resolution?: SecretScanningAlertResolution; - /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ - state: SecretScanningAlertState; + /** Can be one of \`opt_in\` (large files will be stored using Git LFS) or \`opt_out\` (large files will be removed during the import). */ + use_lfs: "opt_in" | "opt_out"; }, params: RequestParams = {}, ) => - this.request< - SecretScanningAlert, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/import/lfs\`, method: "PATCH", body: data, type: ContentType.Json, @@ -33254,171 +31130,273 @@ export class Api< }), /** - * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * - * @tags activity - * @name ActivityListStargazersForRepo - * @summary List stargazers - * @request GET:/repos/{owner}/{repo}/stargazers + * @tags apps + * @name AppsGetRepoInstallation + * @summary Get a repository installation for the authenticated app + * @request GET:/repos/{owner}/{repo}/installation */ - activityListStargazersForRepo: ( + appsGetRepoInstallation: ( owner: string, repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stargazers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/installation\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * @description Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. * - * @tags repos - * @name ReposGetCodeFrequencyStats - * @summary Get the weekly commit activity - * @request GET:/repos/{owner}/{repo}/stats/code_frequency + * @tags interactions + * @name InteractionsGetRestrictionsForRepo + * @summary Get interaction restrictions for a repository + * @request GET:/repos/{owner}/{repo}/interaction-limits */ - reposGetCodeFrequencyStats: ( + interactionsGetRestrictionsForRepo: ( owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, method: "GET", format: "json", ...params, }), /** - * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. + * @description Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. * - * @tags repos - * @name ReposGetCommitActivityStats - * @summary Get the last year of commit activity - * @request GET:/repos/{owner}/{repo}/stats/commit_activity + * @tags interactions + * @name InteractionsSetRestrictionsForRepo + * @summary Set interaction restrictions for a repository + * @request PUT:/repos/{owner}/{repo}/interaction-limits */ - reposGetCommitActivityStats: ( + interactionsSetRestrictionsForRepo: ( owner: string, repo: string, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits + * @description Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository. * - * @tags repos - * @name ReposGetContributorsStats - * @summary Get all contributor commit activity - * @request GET:/repos/{owner}/{repo}/stats/contributors + * @tags interactions + * @name InteractionsRemoveRestrictionsForRepo + * @summary Remove interaction restrictions for a repository + * @request DELETE:/repos/{owner}/{repo}/interaction-limits */ - reposGetContributorsStats: ( + interactionsRemoveRestrictionsForRepo: ( owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/contributors\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "DELETE", ...params, }), /** - * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. + * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. * * @tags repos - * @name ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @name ReposListInvitations + * @summary List repository invitations + * @request GET:/repos/{owner}/{repo}/invitations */ - reposGetParticipationStats: ( + reposListInvitations: ( owner: string, repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/participation\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description 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. + * No description * * @tags repos - * @name ReposGetPunchCardStats - * @summary Get the hourly commit count for each day - * @request GET:/repos/{owner}/{repo}/stats/punch_card + * @name ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} */ - reposGetPunchCardStats: ( + reposUpdateInvitation: ( owner: string, repo: string, + invitationId: number, + data: { + /** The permissions that the associated user will have on the repository. Valid values are \`read\`, \`write\`, \`maintain\`, \`triage\`, and \`admin\`. */ + permissions?: "read" | "write" | "maintain" | "triage" | "admin"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. + * No description * * @tags repos - * @name ReposCreateCommitStatus - * @summary Create a commit status - * @request POST:/repos/{owner}/{repo}/statuses/{sha} + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - reposCreateCommitStatus: ( + reposDeleteInvitation: ( owner: string, repo: string, - sha: string, - data: { + invitationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description List issues in a repository. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * + * @tags issues + * @name IssuesListForRepo + * @summary List repository issues + * @request GET:/repos/{owner}/{repo}/issues + */ + issuesListForRepo: ( + owner: string, + repo: string, + query?: { + /** Can be the name of a user. Pass in \`none\` for issues with no assigned user, and \`*\` for issues assigned to any user. */ + assignee?: string; + /** The user that created the issue. */ + creator?: string; /** - * A string label to differentiate this status from the status of other systems. This field is case-insensitive. - * @default "default" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - context?: string; - /** A short description of the status. */ - description?: string; - /** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ - state: "error" | "failure" | "pending" | "success"; + direction?: "asc" | "desc"; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** A user that's mentioned in the issue. */ + mentioned?: string; + /** If an \`integer\` is passed, it should refer to a milestone by its \`number\` field. If the string \`*\` is passed, issues with any milestone are accepted. If the string \`none\` is passed, issues without milestones are returned. */ + milestone?: string; /** - * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. - * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: - * \`http://ci.example.com/user/repo/build/sha\` + * Page number of the results to fetch. + * @default 1 */ - target_url?: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: "created" | "updated" | "comments"; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. + * + * @tags issues + * @name IssuesCreate + * @summary Create an issue + * @request POST:/repos/{owner}/{repo}/issues + */ + issuesCreate: ( + owner: string, + repo: string, + data: { + /** Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ + assignee?: string | null; + /** Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + /** The contents of the issue. */ + body?: string; + /** Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + color?: string | null; + description?: string | null; + id?: number; + name?: string; + } + )[]; + /** The \`number\` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ */ + milestone?: string | number | null; + /** The title of the issue. */ + title: string | number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, + this.request< + Issue, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", body: data, type: ContentType.Json, @@ -33427,17 +31405,19 @@ export class Api< }), /** - * @description Lists the people watching the specified repository. + * @description By default, Issue Comments are ordered by ascending ID. * - * @tags activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * @tags issues + * @name IssuesListCommentsForRepo + * @summary List issue comments for a repository + * @request GET:/repos/{owner}/{repo}/issues/comments */ - activityListWatchersForRepo: ( + issuesListCommentsForRepo: ( owner: string, repo: string, query?: { + /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -33448,11 +31428,18 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscribers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments\`, method: "GET", query: query, format: "json", @@ -33462,45 +31449,45 @@ export class Api< /** * No description * - * @tags activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @tags issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - activityGetRepoSubscription: ( + issuesGetComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", format: "json", ...params, }), /** - * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. + * No description * - * @tags activity - * @name ActivitySetRepoSubscription - * @summary Set a repository subscription - * @request PUT:/repos/{owner}/{repo}/subscription + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - activitySetRepoSubscription: ( + issuesUpdateComment: ( owner: string, repo: string, + commentId: number, data: { - /** Determines if all notifications should be blocked from this repository. */ - ignored?: boolean; - /** Determines if notifications should be received from this repository. */ - subscribed?: boolean; + /** The contents of the comment. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -33508,36 +31495,48 @@ export class Api< }), /** - * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). + * No description * - * @tags activity - * @name ActivityDeleteRepoSubscription - * @summary Delete a repository subscription - * @request DELETE:/repos/{owner}/{repo}/subscription + * @tags issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - activityDeleteRepoSubscription: ( + issuesDeleteComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", ...params, }), /** - * No description + * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). * - * @tags repos - * @name ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @tags reactions + * @name ReactionsListForIssueComment + * @summary List reactions for an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - reposListTags: ( + reactionsListForIssueComment: ( owner: string, repo: string, + commentId: number, query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** * Page number of the results to fetch. * @default 1 @@ -33551,8 +31550,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tags\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -33560,34 +31566,77 @@ export class Api< }), /** - * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * @description Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue comment. * - * @tags repos - * @name ReposDownloadTarballArchive - * @summary Download a repository archive (tar) - * @request GET:/repos/{owner}/{repo}/tarball/{ref} + * @tags reactions + * @name ReactionsCreateForIssueComment + * @summary Create reaction for an issue comment + * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - reposDownloadTarballArchive: ( + reactionsCreateForIssueComment: ( owner: string, repo: string, - ref: string, + commentId: number, + data: { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, - method: "GET", + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`. Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * + * @tags reactions + * @name ReactionsDeleteForIssueComment + * @summary Delete an issue comment reaction + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + */ + reactionsDeleteForIssueComment: ( + owner: string, + repo: string, + commentId: number, + reactionId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** * No description * - * @tags repos - * @name ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @tags issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events */ - reposListTeams: ( + issuesListEventsForRepo: ( owner: string, repo: string, query?: { @@ -33604,69 +31653,106 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/teams\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags issues + * @name IssuesGetEvent + * @summary Get an issue event + * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + */ + issuesGetEvent: ( + owner: string, + repo: string, + eventId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @description The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. * - * @tags repos - * @name ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @tags issues + * @name IssuesGet + * @summary Get an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number} */ - reposGetAllTopics: ( + issuesGet: ( owner: string, repo: string, + issueNumber: number, params: RequestParams = {}, ) => - this.request< - Topic, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/topics\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Issue owners and users with push access can edit an issue. * - * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @tags issues + * @name IssuesUpdate + * @summary Update an issue + * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} */ - reposReplaceAllTopics: ( + issuesUpdate: ( owner: string, repo: string, + issueNumber: number, data: { - /** An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (\`[]\`) to clear all topics from the repository. **Note:** Topic \`names\` cannot contain uppercase letters. */ - names: string[]; + /** Login for the user that this issue should be assigned to. **This field is deprecated.** */ + assignee?: string | null; + /** Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (\`[]\`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + /** The contents of the issue. */ + body?: string; + /** Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (\`[]\`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + color?: string | null; + description?: string | null; + id?: number; + name?: string; + } + )[]; + /** The \`number\` of the milestone to associate this issue with or \`null\` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._ */ + milestone?: string | number | null; + /** State of the issue. Either \`open\` or \`closed\`. */ + state?: "open" | "closed"; + /** The title of the issue. */ + title?: string | number; }, params: RequestParams = {}, ) => this.request< - Topic, + Issue, | BasicError + | ValidationError | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + message?: string; } - | ValidationErrorSimple >({ - path: \`/repos/\${owner}/\${repo}/topics\`, - method: "PUT", + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -33674,95 +31760,89 @@ export class Api< }), /** - * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. * - * @tags repos - * @name ReposGetClones - * @summary Get repository clones - * @request GET:/repos/{owner}/{repo}/traffic/clones + * @tags issues + * @name IssuesAddAssignees + * @summary Add assignees to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - reposGetClones: ( + issuesAddAssignees: ( owner: string, repo: string, - query?: { - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: "day" | "week"; + issueNumber: number, + data: { + /** Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/clones\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Get the top 10 popular contents over the last 14 days. - * - * @tags repos - * @name ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths - */ - reposGetTopPaths: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the top 10 referrers over the last 14 days. + * @description Removes one or more assignees from an issue. * - * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @tags issues + * @name IssuesRemoveAssignees + * @summary Remove assignees from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - reposGetTopReferrers: ( + issuesRemoveAssignees: ( owner: string, repo: string, + issueNumber: number, + data: { + /** Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "DELETE", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * @description Issue Comments are ordered by ascending ID. * - * @tags repos - * @name ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @tags issues + * @name IssuesListComments + * @summary List issue comments + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reposGetViews: ( + issuesListComments: ( owner: string, repo: string, + issueNumber: number, query?: { /** - * Must be one of: \`day\`, \`week\`. - * @default "day" + * Page number of the results to fetch. + * @default 1 */ - per?: "day" | "week"; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/views\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "GET", query: query, format: "json", @@ -33770,26 +31850,25 @@ export class Api< }), /** - * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags repos - * @name ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @tags issues + * @name IssuesCreateComment + * @summary Create an issue comment + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reposTransfer: ( + issuesCreateComment: ( owner: string, repo: string, + issueNumber: number, data: { - /** The username or organization name the repository will be transferred to. */ - new_owner: string; - /** ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ - team_ids?: number[]; + /** The contents of the comment. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/transfer\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "POST", body: data, type: ContentType.Json, @@ -33798,278 +31877,308 @@ export class Api< }), /** - * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". - * - * @tags repos - * @name ReposCheckVulnerabilityAlerts - * @summary Check if vulnerability alerts are enabled for a repository - * @request GET:/repos/{owner}/{repo}/vulnerability-alerts - */ - reposCheckVulnerabilityAlerts: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "GET", - ...params, - }), - - /** - * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * No description * - * @tags repos - * @name ReposEnableVulnerabilityAlerts - * @summary Enable vulnerability alerts - * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts + * @tags issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events */ - reposEnableVulnerabilityAlerts: ( + issuesListEvents: ( owner: string, repo: string, + issueNumber: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * No description * - * @tags repos - * @name ReposDisableVulnerabilityAlerts - * @summary Disable vulnerability alerts - * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts + * @tags issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposDisableVulnerabilityAlerts: ( + issuesListLabelsOnIssue: ( owner: string, repo: string, + issueNumber: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. + * No description * - * @tags repos - * @name ReposDownloadZipballArchive - * @summary Download a repository archive (zip) - * @request GET:/repos/{owner}/{repo}/zipball/{ref} + * @tags issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposDownloadZipballArchive: ( + issuesAddLabels: ( owner: string, repo: string, - ref: string, + issueNumber: number, + data: { + /** The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ + labels: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description Removes any previous labels and sets the new labels for an issue. * - * @tags repos - * @name ReposCreateUsingTemplate - * @summary Create a repository using a template - * @request POST:/repos/{template_owner}/{template_repo}/generate + * @tags issues + * @name IssuesSetLabels + * @summary Set labels for an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposCreateUsingTemplate: ( - templateOwner: string, - templateRepo: string, + issuesSetLabels: ( + owner: string, + repo: string, + issueNumber: number, data: { - /** A short description of the new repository. */ - description?: string; - /** - * Set to \`true\` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: \`false\`. - * @default false - */ - include_all_branches?: boolean; - /** The name of the new repository. */ - name: string; - /** The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ - owner?: string; - /** - * Either \`true\` to create a new private repository or \`false\` to create a new public one. - * @default false - */ - private?: boolean; + /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a \`string\` or an \`array\` of labels directly, but GitHub recommends passing an object with the \`labels\` key. */ + labels?: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", ...params, }), - }; - repositories = { + /** - * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + * No description * - * @tags repos - * @name ReposListPublic - * @summary List public repositories - * @request GET:/repositories + * @tags issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposListPublic: ( - query?: { - /** A repository ID. Only return repositories with an ID greater than this ID. */ - since?: number; - }, + issuesRemoveAllLabels: ( + owner: string, + repo: string, + issueNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repositories\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "DELETE", ...params, }), - }; - scim = { + /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist. * - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedGroupsEnterprise - * @summary List provisioned SCIM groups for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Groups + * @tags issues + * @name IssuesRemoveLabel + * @summary Remove a label from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} */ - enterpriseAdminListProvisionedGroupsEnterprise: ( - enterprise: string, - query?: { - /** Used for pagination: the number of results to return. */ - count?: number; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; - }, + issuesRemoveLabel: ( + owner: string, + repo: string, + issueNumber: number, + name: string, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, + method: "DELETE", format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + * @description Users with push access can lock an issue or pull request's conversation. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup - * @summary Provision a SCIM enterprise group and invite users - * @request POST:/scim/v2/enterprises/{enterprise}/Groups + * @tags issues + * @name IssuesLock + * @summary Lock an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - enterpriseAdminProvisionAndInviteEnterpriseGroup: ( - enterprise: string, + issuesLock: ( + owner: string, + repo: string, + issueNumber: number, data: { - /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ - displayName: string; - members?: { - /** The SCIM user ID for a user. */ - value: string; - }[]; - /** The SCIM schema URIs. */ - schemas: string[]; - }, + /** + * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + * \\* \`off-topic\` + * \\* \`too heated\` + * \\* \`resolved\` + * \\* \`spam\` + */ + lock_reason?: "off-topic" | "too heated" | "resolved" | "spam"; + } | null, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description Users with push access can unlock an issue's conversation. * - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup - * @summary Get SCIM provisioning information for an enterprise group - * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags issues + * @name IssuesUnlock + * @summary Unlock an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( - enterprise: string, - scimGroupId: string, + issuesUnlock: ( + owner: string, + repo: string, + issueNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "DELETE", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). * - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup - * @summary Set SCIM information for a provisioned enterprise group - * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags reactions + * @name ReactionsListForIssue + * @summary List reactions for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( - enterprise: string, - scimGroupId: string, - data: { - /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ - displayName: string; - members?: { - /** The SCIM user ID for a user. */ - value: string; - }[]; - /** The SCIM schema URIs. */ - schemas: string[]; + reactionsListForIssue: ( + owner: string, + repo: string, + issueNumber: number, + query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * @description Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this issue. * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup - * @summary Update an attribute for a SCIM enterprise group - * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags reactions + * @name ReactionsCreateForIssue + * @summary Create reaction for an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - enterpriseAdminUpdateAttributeForEnterpriseGroup: ( - enterprise: string, - scimGroupId: string, + reactionsCreateForIssue: ( + owner: string, + repo: string, + issueNumber: number, data: { - /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ - Operations: object[]; - /** The SCIM schema URIs. */ - schemas: string[]; + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PATCH", + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -34077,44 +32186,61 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`. Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteScimGroupFromEnterprise - * @summary Delete a SCIM group from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags reactions + * @name ReactionsDeleteForIssue + * @summary Delete an issue reaction + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} */ - enterpriseAdminDeleteScimGroupFromEnterprise: ( - enterprise: string, - scimGroupId: string, + reactionsDeleteForIssue: ( + owner: string, + repo: string, + issueNumber: number, + reactionId: number, params: RequestParams = {}, ) => this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, method: "DELETE", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. + * No description * - * @tags enterprise-admin - * @name EnterpriseAdminListProvisionedIdentitiesEnterprise - * @summary List SCIM provisioned identities for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Users + * @tags issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - enterpriseAdminListProvisionedIdentitiesEnterprise: ( - enterprise: string, + issuesListEventsForTimeline: ( + owner: string, + repo: string, + issueNumber: number, query?: { - /** Used for pagination: the number of results to return. */ - count?: number; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + this.request< + IssueEventForIssue[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, method: "GET", query: query, format: "json", @@ -34122,112 +32248,66 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + * No description * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseUser - * @summary Provision and invite a SCIM enterprise user - * @request POST:/scim/v2/enterprises/{enterprise}/Users + * @tags repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys */ - enterpriseAdminProvisionAndInviteEnterpriseUser: ( - enterprise: string, - data: { - /** List of user emails. */ - emails: { - /** Whether this email address is the primary address. */ - primary: boolean; - /** The type of email address. */ - type: string; - /** The email address. */ - value: string; - }[]; - /** List of SCIM group IDs the user is a member of. */ - groups?: { - value?: string; - }[]; - name: { - /** The last name of the user. */ - familyName: string; - /** The first name of the user. */ - givenName: string; - }; - /** The SCIM schema URIs. */ - schemas: string[]; - /** The username for the user. */ - userName: string; + reposListDeployKeys: ( + owner: string, + repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. - * - * @tags enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser - * @summary Get SCIM provisioning information for an enterprise user - * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} - */ - enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( - enterprise: string, - scimUserId: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. - * - * @tags enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser - * @summary Set SCIM information for a provisioned enterprise user - * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} - */ - enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( - enterprise: string, - scimUserId: string, - data: { - /** List of user emails. */ - emails: { - /** Whether this email address is the primary address. */ - primary: boolean; - /** The type of email address. */ - type: string; - /** The email address. */ - value: string; - }[]; - /** List of SCIM group IDs the user is a member of. */ - groups?: { - value?: string; - }[]; - name: { - /** The last name of the user. */ - familyName: string; - /** The first name of the user. */ - givenName: string; - }; - /** The SCIM schema URIs. */ - schemas: string[]; - /** The username for the user. */ - userName: string; + * @description You can create a read-only deploy key. + * + * @tags repos + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys + */ + reposCreateDeployKey: ( + owner: string, + repo: string, + data: { + /** The contents of the key. */ + key: string; + /** + * If \`true\`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * + * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." + */ + read_only?: boolean; + /** A name for the key. */ + title?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -34235,82 +32315,73 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * No description * - * @tags enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseUser - * @summary Update an attribute for a SCIM enterprise user - * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags repos + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} */ - enterpriseAdminUpdateAttributeForEnterpriseUser: ( - enterprise: string, - scimUserId: string, - data: { - /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ - Operations: object[]; - /** The SCIM schema URIs. */ - schemas: string[]; - }, + reposGetDeployKey: ( + owner: string, + repo: string, + keyId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + method: "GET", format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. * - * @tags enterprise-admin - * @name EnterpriseAdminDeleteUserFromEnterprise - * @summary Delete a SCIM user from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags repos + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} */ - enterpriseAdminDeleteUserFromEnterprise: ( - enterprise: string, - scimUserId: string, + reposDeleteDeployKey: ( + owner: string, + repo: string, + keyId: number, params: RequestParams = {}, ) => this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, method: "DELETE", ...params, }), /** - * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. + * No description * - * @tags scim - * @name ScimListProvisionedIdentities - * @summary List SCIM provisioned identities - * @request GET:/scim/v2/organizations/{org}/Users + * @tags issues + * @name IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - scimListProvisionedIdentities: ( - org: string, + issuesListLabelsForRepo: ( + owner: string, + repo: string, query?: { - /** Used for pagination: the number of results to return. */ - count?: number; /** - * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: - * - * \`?filter=userName%20eq%20\\"Octocat\\"\`. - * - * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: - * - * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. + * Page number of the results to fetch. + * @default 1 */ - filter?: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "GET", query: query, format: "json", @@ -34318,51 +32389,28 @@ export class Api< }), /** - * @description Provision organization membership for a user, and send an activation email to the email address. + * No description * - * @tags scim - * @name ScimProvisionAndInviteUser - * @summary Provision and invite a SCIM user - * @request POST:/scim/v2/organizations/{org}/Users + * @tags issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - scimProvisionAndInviteUser: ( - org: string, + issuesCreateLabel: ( + owner: string, + repo: string, data: { - active?: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - type?: string; - value: string; - }[]; - externalId?: string; - groups?: string[]; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string; - formatted?: string; - givenName: string; - }; - schemas?: string[]; - /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" - */ - userName: string; + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ + color?: string; + /** A short description of the label. */ + description?: string; + /** The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ + name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", body: data, type: ContentType.Json, @@ -34373,212 +32421,171 @@ export class Api< /** * No description * - * @tags scim - * @name ScimGetProvisioningInformationForUser - * @summary Get SCIM provisioning information for a user - * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - scimGetProvisioningInformationForUser: ( - org: string, - scimUserId: string, + issuesGetLabel: ( + owner: string, + repo: string, + name: string, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "GET", format: "json", ...params, }), /** - * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. + * No description * - * @tags scim - * @name ScimSetInformationForProvisionedUser - * @summary Update a provisioned organization membership - * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - scimSetInformationForProvisionedUser: ( - org: string, - scimUserId: string, + issuesUpdateLabel: ( + owner: string, + repo: string, + name: string, data: { - active?: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string; - /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] - */ - emails: { - primary?: boolean; - type?: string; - value: string; - }[]; - externalId?: string; - groups?: string[]; - /** @example {"givenName":"Jane","familyName":"User"} */ - name: { - familyName: string; - formatted?: string; - givenName: string; - }; - schemas?: string[]; - /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" - */ - userName: string; + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading \`#\`. */ + color?: string; + /** A short description of the label. */ + description?: string; + /** The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing \`:strawberry:\` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). */ + new_name?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} + */ + issuesDeleteLabel: ( + owner: string, + repo: string, + name: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "DELETE", ...params, }), /** - * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` + * @description Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. * - * @tags scim - * @name ScimUpdateAttributeForUser - * @summary Update an attribute for a SCIM user - * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags repos + * @name ReposListLanguages + * @summary List repository languages + * @request GET:/repos/{owner}/{repo}/languages */ - scimUpdateAttributeForUser: ( - org: string, - scimUserId: string, - data: { - /** - * Set of operations to be performed - * @minItems 1 - * @example [{"op":"replace","value":{"active":false}}] - */ - Operations: { - op: "add" | "remove" | "replace"; - path?: string; - value?: - | { - active?: boolean | null; - externalId?: string | null; - familyName?: string | null; - givenName?: string | null; - userName?: string | null; - } - | { - primary?: boolean; - value?: string; - }[] - | string; - }[]; - schemas?: string[]; - }, + reposListLanguages: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/languages\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @description This method returns the contents of the repository's license file, if one is detected. Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. * - * @tags scim - * @name ScimDeleteUserFromOrg - * @summary Delete a SCIM user from an organization - * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags licenses + * @name LicensesGetForRepo + * @summary Get the license for a repository + * @request GET:/repos/{owner}/{repo}/license */ - scimDeleteUserFromOrg: ( - org: string, - scimUserId: string, + licensesGetForRepo: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/license\`, + method: "GET", + format: "json", ...params, }), - }; - search = { + /** - * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + * No description * - * @tags search - * @name SearchCode - * @summary Search code - * @request GET:/search/code + * @tags repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges */ - searchCode: ( - query: { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: "desc" | "asc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: "indexed"; + reposMerge: ( + owner: string, + repo: string, + data: { + /** The name of the base branch that the head will be merged into. */ + base: string; + /** Commit message to use for the merge commit. If omitted, a default message will be used. */ + commit_message?: string; + /** The head to merge. This can be a branch name or a commit SHA1. */ + head: string; }, params: RequestParams = {}, ) => this.request< - { - incomplete_results: boolean; - items: CodeSearchResultItem[]; - total_count: number; - }, + Commit, | BasicError - | ValidationError | { - code?: string; + /** @example ""https://docs.github.com/rest/reference/repos#perform-a-merge"" */ documentation_url?: string; message?: string; } + | ValidationError >({ - path: \`/search/code\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/merges\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` + * No description * - * @tags search - * @name SearchCommits - * @summary Search commits - * @request GET:/search/commits + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - searchCommits: ( - query: { + issuesListMilestones: ( + owner: string, + repo: string, + query?: { /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" */ - order?: "desc" | "asc"; + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -34589,25 +32596,21 @@ export class Api< * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: "author-date" | "committer-date"; + /** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ + sort?: "due_on" | "completeness"; + /** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request< - { - incomplete_results: boolean; - items: CommitSearchResultItem[]; - total_count: number; - }, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "GET", query: query, format: "json", @@ -34615,123 +32618,130 @@ export class Api< }), /** - * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + * No description * - * @tags search - * @name SearchIssuesAndPullRequests - * @summary Search issues and pull requests - * @request GET:/search/issues + * @tags issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - searchIssuesAndPullRequests: ( - query: { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: "desc" | "asc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + issuesCreateMilestone: ( + owner: string, + repo: string, + data: { + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + due_on?: string; /** - * Results per page (max 100) - * @default 30 + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" */ - per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: - | "comments" - | "reactions" - | "reactions-+1" - | "reactions--1" - | "reactions-smile" - | "reactions-thinking_face" - | "reactions-heart" - | "reactions-tada" - | "interactions" - | "created" - | "updated"; + state?: "open" | "closed"; + /** The title of the milestone. */ + title: string; }, params: RequestParams = {}, ) => - this.request< - { - incomplete_results: boolean; - items: IssueSearchResultItem[]; - total_count: number; - }, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/issues\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + */ + issuesGetMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. + * No description * - * @tags search - * @name SearchLabels - * @summary Search labels - * @request GET:/search/labels + * @tags issues + * @name IssuesUpdateMilestone + * @summary Update a milestone + * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} */ - searchLabels: ( - query: { + issuesUpdateMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + data: { + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + due_on?: string; /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" */ - order?: "desc" | "asc"; - /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; - /** The id of the repository. */ - repository_id: number; - /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: "created" | "updated"; + state?: "open" | "closed"; + /** The title of the milestone. */ + title?: string; }, params: RequestParams = {}, ) => - this.request< - { - incomplete_results: boolean; - items: LabelSearchResultItem[]; - total_count: number; - }, - BasicError | ValidationError - >({ - path: \`/search/labels\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` + * No description * - * @tags search - * @name SearchRepos - * @summary Search repositories - * @request GET:/search/repositories + * @tags issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - searchRepos: ( - query: { - /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" - */ - order?: "desc" | "asc"; + issuesDeleteMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "DELETE", + ...params, + }), + + /** + * No description + * + * @tags issues + * @name IssuesListLabelsForMilestone + * @summary List labels for issues in a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + */ + issuesListLabelsForMilestone: ( + owner: string, + repo: string, + milestoneNumber: number, + query?: { /** * Page number of the results to fetch. * @default 1 @@ -34742,60 +32752,11 @@ export class Api< * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: "stars" | "forks" | "help-wanted-issues" | "updated"; - }, - params: RequestParams = {}, - ) => - this.request< - { - incomplete_results: boolean; - items: RepoSearchResultItem[]; - total_count: number; - }, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/repositories\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. - * - * @tags search - * @name SearchTopics - * @summary Search topics - * @request GET:/search/topics - */ - searchTopics: ( - query: { - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ - q: string; }, params: RequestParams = {}, ) => - this.request< - { - incomplete_results: boolean; - items: TopicSearchResultItem[]; - total_count: number; - }, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/topics\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, method: "GET", query: query, format: "json", @@ -34803,116 +32764,129 @@ export class Api< }), /** - * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + * @description List all notifications for the current user. * - * @tags search - * @name SearchUsers - * @summary Search users - * @request GET:/search/users + * @tags activity + * @name ActivityListRepoNotificationsForAuthenticatedUser + * @summary List repository notifications for the authenticated user + * @request GET:/repos/{owner}/{repo}/notifications */ - searchUsers: ( - query: { + activityListRepoNotificationsForAuthenticatedUser: ( + owner: string, + repo: string, + query?: { /** - * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. - * @default "desc" + * If \`true\`, show notifications marked as read. + * @default false */ - order?: "desc" | "asc"; + all?: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; /** * Page number of the results to fetch. * @default 1 */ page?: number; + /** + * If \`true\`, only shows notifications in which the user is directly participating or mentioned. + * @default false + */ + participating?: boolean; /** * Results per page (max 100) * @default 30 */ per_page?: number; - /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ - q: string; - /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ - sort?: "followers" | "repositories" | "joined"; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; }, params: RequestParams = {}, ) => - this.request< - { - incomplete_results: boolean; - items: UserSearchResultItem[]; - total_count: number; - }, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, method: "GET", query: query, format: "json", ...params, }), - }; - teams = { + + /** + * @description Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`. + * + * @tags activity + * @name ActivityMarkRepoNotificationsAsRead + * @summary Mark repository notifications as read + * @request PUT:/repos/{owner}/{repo}/notifications + */ + activityMarkRepoNotificationsAsRead: ( + owner: string, + repo: string, + data: { + /** Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. Default: The current timestamp. */ + last_read_at?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), + /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * No description * - * @tags teams - * @name TeamsGetLegacy - * @summary Get a team (Legacy) - * @request GET:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - teamsGetLegacy: (teamId: number, params: RequestParams = {}) => - this.request({ - path: \`/teams/\${teamId}\`, + reposGetPages: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pages\`, method: "GET", format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. + * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * - * @tags teams - * @name TeamsUpdateLegacy - * @summary Update a team (Legacy) - * @request PATCH:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - teamsUpdateLegacy: ( - teamId: number, + reposCreatePagesSite: ( + owner: string, + repo: string, data: { - /** The description of the team. */ - description?: string; - /** The name of the team. */ - name: string; - /** The ID of a team to set as the parent team. */ - parent_team_id?: number | null; - /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. - * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. - * \\* \`admin\` - team members can pull, push and administer newly-added repositories. - * @default "pull" - */ - permission?: "pull" | "push" | "admin"; - /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: - * **For a non-nested team:** - * \\* \`secret\` - only visible to organization owners and members of this team. - * \\* \`closed\` - visible to all members of this organization. - * **For a parent or child team:** - * \\* \`closed\` - visible to all members of this organization. - */ - privacy?: "secret" | "closed"; + /** The source branch and directory used to publish your Pages site. */ + source: { + /** The repository branch used to publish your site's source files. */ + branch: string; + /** + * The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. Default: \`/\` + * @default "/" + */ + path?: "/" | "/docs"; + }; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, - method: "PATCH", + this.request< + Page, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -34920,38 +32894,82 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). * - * @tags teams - * @name TeamsDeleteLegacy - * @summary Delete a team (Legacy) - * @request DELETE:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposUpdateInformationAboutPagesSite + * @summary Update information about a GitHub Pages site + * @request PUT:/repos/{owner}/{repo}/pages */ - teamsDeleteLegacy: (teamId: number, params: RequestParams = {}) => + reposUpdateInformationAboutPagesSite: ( + owner: string, + repo: string, + data: { + /** Specify a custom domain for the repository. Sending a \`null\` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ + cname?: string | null; + /** Configures access controls for the GitHub Pages site. If public is set to \`true\`, the site is accessible to anyone on the internet. If set to \`false\`, the site will only be accessible to users who have at least \`read\` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to \`internal\` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ + public?: boolean; + /** Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory \`/docs\`. Possible values are \`"gh-pages"\`, \`"master"\`, and \`"master /docs"\`. */ + source: + | "gh-pages" + | "master" + | "master /docs" + | { + /** The repository branch used to publish your site's source files. */ + branch: string; + /** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ + path: "/" | "/docs"; + }; + }, + params: RequestParams = {}, + ) => this.request({ - path: \`/teams/\${teamId}\`, + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages + */ + reposDeletePagesSite: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags teams - * @name TeamsListDiscussionsLegacy - * @summary List discussions (Legacy) - * @request GET:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds */ - teamsListDiscussionsLegacy: ( - teamId: number, + reposListPagesBuilds: ( + owner: string, + repo: string, query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -34965,8 +32983,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "GET", query: query, format: "json", @@ -34974,126 +32992,78 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. * - * @tags teams - * @name TeamsCreateDiscussionLegacy - * @summary Create a discussion (Legacy) - * @request POST:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposRequestPagesBuild + * @summary Request a GitHub Pages build + * @request POST:/repos/{owner}/{repo}/pages/builds */ - teamsCreateDiscussionLegacy: ( - teamId: number, - data: { - /** The discussion post's body text. */ - body: string; - /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. - * @default false - */ - private?: boolean; - /** The discussion post's title. */ - title: string; - }, + reposRequestPagesBuild: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * - * @tags teams - * @name TeamsGetDiscussionLegacy - * @summary Get a discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number} - * @deprecated - */ - teamsGetDiscussionLegacy: ( - teamId: number, - discussionNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "GET", format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags teams - * @name TeamsUpdateDiscussionLegacy - * @summary Update a discussion (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - teamsUpdateDiscussionLegacy: ( - teamId: number, - discussionNumber: number, - data: { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; - }, + reposGetLatestPagesBuild: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, + method: "GET", format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags teams - * @name TeamsDeleteDiscussionLegacy - * @summary Delete a discussion (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - teamsDeleteDiscussionLegacy: ( - teamId: number, - discussionNumber: number, + reposGetPagesBuild: ( + owner: string, + repo: string, + buildId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Lists the projects in a repository. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags teams - * @name TeamsListDiscussionCommentsLegacy - * @summary List discussion comments (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags projects + * @name ProjectsListForRepo + * @summary List repository projects + * @request GET:/repos/{owner}/{repo}/projects */ - teamsListDiscussionCommentsLegacy: ( - teamId: number, - discussionNumber: number, + projectsListForRepo: ( + owner: string, + repo: string, query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -35104,11 +33074,16 @@ export class Api< * @default 30 */ per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/projects\`, method: "GET", query: query, format: "json", @@ -35116,25 +33091,26 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + * @description Creates a repository project board. Returns a \`404 Not Found\` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a \`401 Unauthorized\` or \`410 Gone\` status is returned. * - * @tags teams - * @name TeamsCreateDiscussionCommentLegacy - * @summary Create a discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags projects + * @name ProjectsCreateForRepo + * @summary Create a repository project + * @request POST:/repos/{owner}/{repo}/projects */ - teamsCreateDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, + projectsCreateForRepo: ( + owner: string, + repo: string, data: { - /** The discussion comment's body text. */ - body: string; + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/projects\`, method: "POST", body: data, type: ContentType.Json, @@ -35143,49 +33119,86 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * @tags teams - * @name TeamsGetDiscussionCommentLegacy - * @summary Get a discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags pulls + * @name PullsList + * @summary List pull requests + * @request GET:/repos/{owner}/{repo}/pulls */ - teamsGetDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + pullsList: ( + owner: string, + repo: string, + query?: { + /** Filter pulls by base branch name. Example: \`gh-pages\`. */ + base?: string; + /** The direction of the sort. Can be either \`asc\` or \`desc\`. Default: \`desc\` when sort is \`created\` or sort is not specified, otherwise \`asc\`. */ + direction?: "asc" | "desc"; + /** Filter pulls by head user or head organization and branch name in the format of \`user:ref-name\` or \`organization:ref-name\`. For example: \`github:new-script-format\` or \`octocat:test-branch\`. */ + head?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`popularity\` (comment count) or \`long-running\` (age, filtering by pulls updated in the last month). + * @default "created" + */ + sort?: "created" | "updated" | "popularity" | "long-running"; + /** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ + state?: "open" | "closed" | "all"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. You can create a new pull request. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags teams - * @name TeamsUpdateDiscussionCommentLegacy - * @summary Update a discussion comment (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags pulls + * @name PullsCreate + * @summary Create a pull request + * @request POST:/repos/{owner}/{repo}/pulls */ - teamsUpdateDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + pullsCreate: ( + owner: string, + repo: string, data: { - /** The discussion comment's body text. */ - body: string; + /** The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ + base: string; + /** The contents of the pull request. */ + body?: string; + /** Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ + draft?: boolean; + /** The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace \`head\` with a user like this: \`username:branch\`. */ + head: string; + /** @example 1 */ + issue?: number; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + /** The title of the new pull request. */ + title?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -35193,50 +33206,19 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * - * @tags teams - * @name TeamsDeleteDiscussionCommentLegacy - * @summary Delete a discussion comment (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated - */ - teamsDeleteDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", - ...params, - }), - - /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. * - * @tags reactions - * @name ReactionsListForTeamDiscussionCommentLegacy - * @summary List reactions for a team discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @tags pulls + * @name PullsListReviewCommentsForRepo + * @summary List review comments in a repository + * @request GET:/repos/{owner}/{repo}/pulls/comments */ - reactionsListForTeamDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + pullsListReviewCommentsForRepo: ( + owner: string, + repo: string, query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -35247,47 +33229,66 @@ export class Api< * @default 30 */ per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Provides details for a review comment. + * + * @tags pulls + * @name PullsGetReviewComment + * @summary Get a review comment for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + */ + pullsGetReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. + * @description Enables you to edit a review comment. * - * @tags reactions - * @name ReactionsCreateForTeamDiscussionCommentLegacy - * @summary Create reaction for a team discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions - * @deprecated + * @tags pulls + * @name PullsUpdateReviewComment + * @summary Update a review comment for a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reactionsCreateForTeamDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + pullsUpdateReviewComment: ( + owner: string, + repo: string, + commentId: number, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ - content: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** The text of the reply to the review comment. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -35295,19 +33296,39 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Deletes a review comment. + * + * @tags pulls + * @name PullsDeleteReviewComment + * @summary Delete a review comment for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + */ + pullsDeleteReviewComment: ( + owner: string, + repo: string, + commentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "DELETE", + ...params, + }), + + /** + * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). * * @tags reactions - * @name ReactionsListForTeamDiscussionLegacy - * @summary List reactions for a team discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @name ReactionsListForPullRequestReviewComment + * @summary List reactions for a pull request review comment + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - reactionsListForTeamDiscussionLegacy: ( - teamId: number, - discussionNumber: number, + reactionsListForPullRequestReviewComment: ( + owner: string, + repo: string, + commentId: number, query?: { - /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ content?: | "+1" | "-1" @@ -35330,8 +33351,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -35339,19 +33367,19 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. + * @description Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with a \`Status: 200 OK\` means that you already added the reaction type to this pull request review comment. * * @tags reactions - * @name ReactionsCreateForTeamDiscussionLegacy - * @summary Create reaction for a team discussion (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @name ReactionsCreateForPullRequestReviewComment + * @summary Create reaction for a pull request review comment + * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - reactionsCreateForTeamDiscussionLegacy: ( - teamId: number, - discussionNumber: number, + reactionsCreateForPullRequestReviewComment: ( + owner: string, + repo: string, + commentId: number, data: { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ content: | "+1" | "-1" @@ -35364,8 +33392,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -35374,214 +33409,190 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * @description **Note:** You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\` Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). * - * @tags teams - * @name TeamsListPendingInvitationsLegacy - * @summary List pending team invitations (Legacy) - * @request GET:/teams/{team_id}/invitations - * @deprecated + * @tags reactions + * @name ReactionsDeleteForPullRequestComment + * @summary Delete a pull request comment reaction + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} */ - teamsListPendingInvitationsLegacy: ( - teamId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + reactionsDeleteForPullRequestComment: ( + owner: string, + repo: string, + commentId: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Lists details of a pull request by providing its number. When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit. The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request: * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit. * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch. * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * - * @tags teams - * @name TeamsListMembersLegacy - * @summary List team members (Legacy) - * @request GET:/teams/{team_id}/members - * @deprecated + * @tags pulls + * @name PullsGet + * @summary Get a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} */ - teamsListMembersLegacy: ( - teamId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Filters members returned by their role in the team. Can be one of: - * \\* \`member\` - normal members of the team. - * \\* \`maintainer\` - team maintainers. - * \\* \`all\` - all members of the team. - * @default "all" - */ - role?: "member" | "maintainer" | "all"; - }, + pullsGet: ( + owner: string, + repo: string, + pullNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. - * - * @tags teams - * @name TeamsGetMemberLegacy - * @summary Get team member (Legacy) - * @request GET:/teams/{team_id}/members/{username} - * @deprecated - */ - teamsGetMemberLegacy: ( - teamId: number, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "GET", - ...params, - }), - - /** - * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. * - * @tags teams - * @name TeamsAddMemberLegacy - * @summary Add team member (Legacy) - * @request PUT:/teams/{team_id}/members/{username} - * @deprecated + * @tags pulls + * @name PullsUpdate + * @summary Update a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} */ - teamsAddMemberLegacy: ( - teamId: number, - username: string, + pullsUpdate: ( + owner: string, + repo: string, + pullNumber: number, + data: { + /** The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ + base?: string; + /** The contents of the pull request. */ + body?: string; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + /** State of this Pull Request. Either \`open\` or \`closed\`. */ + state?: "open" | "closed"; + /** The title of the pull request. */ + title?: string; + }, params: RequestParams = {}, ) => - this.request< - void, - | BasicError - | void - | { - /** @example ""https://docs.github.com/rest"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; - } - >({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. * - * @tags teams - * @name TeamsRemoveMemberLegacy - * @summary Remove team member (Legacy) - * @request DELETE:/teams/{team_id}/members/{username} - * @deprecated + * @tags pulls + * @name PullsListReviewComments + * @summary List review comments on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - teamsRemoveMemberLegacy: ( - teamId: number, - username: string, + pullsListReviewComments: ( + owner: string, + repo: string, + pullNumber: number, + query?: { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * @description Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` if your comment applies to more than one line in the pull request diff. You can still create a review comment using the \`position\` parameter. When you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required. For more information, see the [\`comfort-fade\` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags teams - * @name TeamsGetMembershipForUserLegacy - * @summary Get team membership for a user (Legacy) - * @request GET:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags pulls + * @name PullsCreateReviewComment + * @summary Create a review comment for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - teamsGetMembershipForUserLegacy: ( - teamId: number, - username: string, + pullsCreateReviewComment: ( + owner: string, + repo: string, + pullNumber: number, + data: { + /** The text of the review comment. */ + body: string; + /** The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the \`position\`. */ + commit_id?: string; + /** @example 2 */ + in_reply_to?: number; + /** **Required with \`comfort-fade\` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ + line?: number; + /** The relative path to the file that necessitates a comment. */ + path: string; + /** **Required without \`comfort-fade\` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ + position?: number; + /** **Required with \`comfort-fade\` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be \`LEFT\` or \`RIGHT\`. Use \`LEFT\` for deletions that appear in red. Use \`RIGHT\` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ + side?: "LEFT" | "RIGHT"; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_line\` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ + start_line?: number; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the \`comfort-fade\` preview header. The \`start_side\` is the starting side of the diff that the comment applies to. Can be \`LEFT\` or \`RIGHT\`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See \`side\` in this table for additional context. */ + start_side?: "LEFT" | "RIGHT" | "side"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * @description Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags teams - * @name TeamsAddOrUpdateMembershipForUserLegacy - * @summary Add or update team membership for a user (Legacy) - * @request PUT:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags pulls + * @name PullsCreateReplyForReviewComment + * @summary Create a reply for a review comment + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies */ - teamsAddOrUpdateMembershipForUserLegacy: ( - teamId: number, - username: string, + pullsCreateReplyForReviewComment: ( + owner: string, + repo: string, + pullNumber: number, + commentId: number, data: { - /** - * The role that this user should have in the team. Can be one of: - * \\* \`member\` - a normal member of the team. - * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - * @default "member" - */ - role?: "member" | "maintainer"; + /** The text of the review comment. */ + body: string; }, params: RequestParams = {}, ) => - this.request< - TeamMembership, - | void - | BasicError - | { - /** @example ""https://help.github.com/articles/github-and-trade-controls"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; - } - >({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -35589,36 +33600,51 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * @description Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. * - * @tags teams - * @name TeamsRemoveMembershipForUserLegacy - * @summary Remove team membership for a user (Legacy) - * @request DELETE:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags pulls + * @name PullsListCommits + * @summary List commits on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits */ - teamsRemoveMembershipForUserLegacy: ( - teamId: number, - username: string, + pullsListCommits: ( + owner: string, + repo: string, + pullNumber: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. + * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. * - * @tags teams - * @name TeamsListProjectsLegacy - * @summary List team projects (Legacy) - * @request GET:/teams/{team_id}/projects - * @deprecated + * @tags pulls + * @name PullsListFiles + * @summary List pull requests files + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files */ - teamsListProjectsLegacy: ( - teamId: number, + pullsListFiles: ( + owner: string, + repo: string, + pullNumber: number, query?: { /** * Page number of the results to fetch. @@ -35633,15 +33659,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - TeamProject[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, method: "GET", query: query, format: "json", @@ -35649,115 +33668,78 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. + * No description * - * @tags teams - * @name TeamsCheckPermissionsForProjectLegacy - * @summary Check team permissions for a project (Legacy) - * @request GET:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags pulls + * @name PullsCheckIfMerged + * @summary Check if a pull request has been merged + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - teamsCheckPermissionsForProjectLegacy: ( - teamId: number, - projectId: number, + pullsCheckIfMerged: ( + owner: string, + repo: string, + pullNumber: number, params: RequestParams = {}, ) => - this.request< - TeamProject, - void | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, method: "GET", - format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsLegacy - * @summary Add or update team project permissions (Legacy) - * @request PUT:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags pulls + * @name PullsMerge + * @summary Merge a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - teamsAddOrUpdateProjectPermissionsLegacy: ( - teamId: number, - projectId: number, + pullsMerge: ( + owner: string, + repo: string, + pullNumber: number, data: { - /** - * The permission to grant to the team for this project. Can be one of: - * \\* \`read\` - team members can read, but not write to or administer this project. - * \\* \`write\` - team members can read and write, but not administer this project. - * \\* \`admin\` - team members can read, write and administer this project. - * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." - */ - permission?: "read" | "write" | "admin"; - }, + /** Extra detail to append to automatic commit message. */ + commit_message?: string; + /** Title for the automatic commit message. */ + commit_title?: string; + /** Merge method to use. Possible values are \`merge\`, \`squash\` or \`rebase\`. Default is \`merge\`. */ + merge_method?: "merge" | "squash" | "rebase"; + /** SHA that pull request head must match to allow merge. */ + sha?: string; + } | null, params: RequestParams = {}, ) => this.request< - void, + PullRequestMergeResult, + | BasicError | { documentation_url?: string; message?: string; } - | BasicError - | { - documentation_url: string; - message: string; - } | ValidationError >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, method: "PUT", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. - * - * @tags teams - * @name TeamsRemoveProjectLegacy - * @summary Remove a project from a team (Legacy) - * @request DELETE:/teams/{team_id}/projects/{project_id} - * @deprecated - */ - teamsRemoveProjectLegacy: ( - teamId: number, - projectId: number, - params: RequestParams = {}, - ) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "DELETE", - ...params, - }), - - /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * No description * - * @tags teams - * @name TeamsListReposLegacy - * @summary List team repositories (Legacy) - * @request GET:/teams/{team_id}/repos - * @deprecated + * @tags pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - teamsListReposLegacy: ( - teamId: number, + pullsListRequestedReviewers: ( + owner: string, + repo: string, + pullNumber: number, query?: { /** * Page number of the results to fetch. @@ -35772,8 +33754,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, method: "GET", query: query, format: "json", @@ -35781,134 +33763,188 @@ export class Api< }), /** - * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-abuse-rate-limits)" for details. * - * @tags teams - * @name TeamsCheckPermissionsForRepoLegacy - * @summary Check team permissions for a repository (Legacy) - * @request GET:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags pulls + * @name PullsRequestReviewers + * @summary Request reviewers for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - teamsCheckPermissionsForRepoLegacy: ( - teamId: number, + pullsRequestReviewers: ( owner: string, repo: string, + pullNumber: number, + data: { + /** An array of user \`login\`s that will be requested. */ + reviewers?: string[]; + /** An array of team \`slug\`s that will be requested. */ + team_reviewers?: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * No description * - * @tags teams - * @name TeamsAddOrUpdateRepoPermissionsLegacy - * @summary Add or update team repository permissions (Legacy) - * @request PUT:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags pulls + * @name PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - teamsAddOrUpdateRepoPermissionsLegacy: ( - teamId: number, + pullsRemoveRequestedReviewers: ( owner: string, repo: string, + pullNumber: number, data: { - /** - * The permission to grant the team on this repository. Can be one of: - * \\* \`pull\` - team members can pull, but not push to or administer this repository. - * \\* \`push\` - team members can pull and push, but not administer this repository. - * \\* \`admin\` - team members can pull, push and administer this repository. - * - * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: "pull" | "push" | "admin"; + /** An array of user \`login\`s that will be removed. */ + reviewers?: string[]; + /** An array of team \`slug\`s that will be removed. */ + team_reviewers?: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "DELETE", body: data, type: ContentType.Json, ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + * @description The list of reviews returns in chronological order. * - * @tags teams - * @name TeamsRemoveRepoLegacy - * @summary Remove a repository from a team (Legacy) - * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags pulls + * @name PullsListReviews + * @summary List reviews for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - teamsRemoveRepoLegacy: ( - teamId: number, + pullsListReviews: ( owner: string, repo: string, + pullNumber: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. + * @description This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. Pull request reviews created in the \`PENDING\` state do not include the \`submitted_at\` property in the response. **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the \`application/vnd.github.v3.diff\` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the \`Accept\` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * - * @tags teams - * @name TeamsListIdpGroupsForLegacy - * @summary List IdP groups for a team (Legacy) - * @request GET:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags pulls + * @name PullsCreateReview + * @summary Create a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + */ + pullsCreateReview: ( + owner: string, + repo: string, + pullNumber: number, + data: { + /** **Required** when using \`REQUEST_CHANGES\` or \`COMMENT\` for the \`event\` parameter. The body text of the pull request review. */ + body?: string; + /** Use the following table to specify the location, destination, and contents of the draft review comment. */ + comments?: { + /** Text of the review comment. */ + body: string; + /** @example 28 */ + line?: number; + /** The relative path to the file that necessitates a review comment. */ + path: string; + /** The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ + position?: number; + /** @example "RIGHT" */ + side?: string; + /** @example 26 */ + start_line?: number; + /** @example "LEFT" */ + start_side?: string; + }[]; + /** The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the \`position\`. Defaults to the most recent commit in the pull request when you do not specify a value. */ + commit_id?: string; + /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. By leaving this blank, you set the review action state to \`PENDING\`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ + event?: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags pulls + * @name PullsGetReview + * @summary Get a review for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - teamsListIdpGroupsForLegacy: (teamId: number, params: RequestParams = {}) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, + pullsGetReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "GET", format: "json", ...params, }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. + * @description Update the review summary comment with new text. * - * @tags teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy - * @summary Create or update IdP group connections (Legacy) - * @request PATCH:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags pulls + * @name PullsUpdateReview + * @summary Update a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( - teamId: number, + pullsUpdateReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, data: { - /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ - groups: { - /** @example ""moar cheese pleese"" */ - description?: string; - /** Description of the IdP group. */ - group_description: string; - /** ID of the IdP group. */ - group_id: string; - /** Name of the IdP group. */ - group_name: string; - /** @example ""caceab43fc9ffa20081c"" */ - id?: string; - /** @example ""external-team-6c13e7288ef7"" */ - name?: string; - }[]; - /** @example ""I am not a timestamp"" */ - synced_at?: string; + /** The body text of the pull request review. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -35916,16 +33952,40 @@ export class Api< }), /** - * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. + * No description * - * @tags teams - * @name TeamsListChildLegacy - * @summary List child teams (Legacy) - * @request GET:/teams/{team_id}/teams - * @deprecated + * @tags pulls + * @name PullsDeletePendingReview + * @summary Delete a pending review for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - teamsListChildLegacy: ( - teamId: number, + pullsDeletePendingReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "DELETE", + format: "json", + ...params, + }), + + /** + * @description List comments for a specific pull request review. + * + * @tags pulls + * @name PullsListCommentsForReview + * @summary List comments for a pull request review + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments + */ + pullsListCommentsForReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, query?: { /** * Page number of the results to fetch. @@ -35940,81 +34000,68 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/teams\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, method: "GET", query: query, format: "json", ...params, }), - }; - user = { + /** - * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. + * @description **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. * - * @tags users - * @name UsersGetAuthenticated - * @summary Get the authenticated user - * @request GET:/user + * @tags pulls + * @name PullsDismissReview + * @summary Dismiss a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals */ - usersGetAuthenticated: (params: RequestParams = {}) => - this.request({ - path: \`/user\`, - method: "GET", + pullsDismissReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + data: { + /** @example ""APPROVE"" */ + event?: string; + /** The message for the pull request review dismissal */ + message: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. + * No description * - * @tags users - * @name UsersUpdateAuthenticated - * @summary Update the authenticated user - * @request PATCH:/user + * @tags pulls + * @name PullsSubmitReview + * @summary Submit a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events */ - usersUpdateAuthenticated: ( + pullsSubmitReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, data: { - /** The new short biography of the user. */ - bio?: string; - /** - * The new blog URL of the user. - * @example "blog.example.com" - */ - blog?: string; - /** - * The new company of the user. - * @example "Acme corporation" - */ - company?: string; - /** - * The publicly visible email address of the user. - * @example "omar@example.com" - */ - email?: string; - /** The new hiring availability of the user. */ - hireable?: boolean; - /** - * The new location of the user. - * @example "Berlin, Germany" - */ - location?: string; - /** - * The new name of the user. - * @example "Omar Jahandar" - */ - name?: string; - /** - * The new Twitter username of the user. - * @example "therealomarj" - */ - twitter_username?: string | null; + /** The body text of the pull request review */ + body?: string; + /** The review action you want to perform. The review actions include: \`APPROVE\`, \`REQUEST_CHANGES\`, or \`COMMENT\`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to \`PENDING\`, which means you will need to re-submit the pull request review using a review action. */ + event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -36022,111 +34069,79 @@ export class Api< }), /** - * @description List the users you've blocked on your personal account. + * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. * - * @tags users - * @name UsersListBlockedByAuthenticated - * @summary List users blocked by the authenticated user - * @request GET:/user/blocks + * @tags pulls + * @name PullsUpdateBranch + * @summary Update a pull request branch + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch */ - usersListBlockedByAuthenticated: (params: RequestParams = {}) => + pullsUpdateBranch: ( + owner: string, + repo: string, + pullNumber: number, + data: { + /** The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a \`422 Unprocessable Entity\` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ + expected_head_sha?: string; + } | null, + params: RequestParams = {}, + ) => this.request< - SimpleUser[], + { + message?: string; + url?: string; + }, | BasicError | { - documentation_url: string; - message: string; - } - >({ - path: \`/user/blocks\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @tags users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} - */ - usersCheckBlocked: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "GET", - ...params, - }), - - /** - * No description - * - * @tags users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} - */ - usersBlock: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description - * - * @tags users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} - */ - usersUnblock: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "DELETE", - ...params, - }), - - /** - * @description Sets the visibility for your primary email addresses. + * @description Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. * - * @tags users - * @name UsersSetPrimaryEmailVisibilityForAuthenticated - * @summary Set primary email visibility for the authenticated user - * @request PATCH:/user/email/visibility + * @tags repos + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - usersSetPrimaryEmailVisibilityForAuthenticated: ( - data: { - /** - * An email address associated with the GitHub user account to manage. - * @example "org@example.com" - */ - email: string; - /** Denotes whether an email is publically visible. */ - visibility: "public" | "private"; + reposGetReadme: ( + owner: string, + repo: string, + query?: { + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/email/visibility\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/readme\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. + * @description This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. * - * @tags users - * @name UsersListEmailsForAuthenticated - * @summary List email addresses for the authenticated user - * @request GET:/user/emails + * @tags repos + * @name ReposListReleases + * @summary List releases + * @request GET:/repos/{owner}/{repo}/releases */ - usersListEmailsForAuthenticated: ( + reposListReleases: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -36141,8 +34156,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, method: "GET", query: query, format: "json", @@ -36150,28 +34165,40 @@ export class Api< }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @description Users with push access to the repository can create a release. This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags users - * @name UsersAddEmailForAuthenticated - * @summary Add an email address for the authenticated user - * @request POST:/user/emails + * @tags repos + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - usersAddEmailForAuthenticated: ( - data: - | { - /** - * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. - * @example [] - */ - emails: string[]; - } - | string[] - | string, + reposCreateRelease: ( + owner: string, + repo: string, + data: { + /** Text describing the contents of the tag. */ + body?: string; + /** + * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. + * @default false + */ + draft?: boolean; + /** The name of the release. */ + name?: string; + /** + * \`true\` to identify the release as a prerelease. \`false\` to identify the release as a full release. + * @default false + */ + prerelease?: boolean; + /** The name of the tag. */ + tag_name: string; + /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ + target_commitish?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, method: "POST", body: data, type: ContentType.Json, @@ -36180,150 +34207,215 @@ export class Api< }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @description To download the asset's binary content, set the \`Accept\` header of the request to [\`application/octet-stream\`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a \`200\` or \`302\` response. * - * @tags users - * @name UsersDeleteEmailForAuthenticated - * @summary Delete an email address for the authenticated user - * @request DELETE:/user/emails + * @tags repos + * @name ReposGetReleaseAsset + * @summary Get a release asset + * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - usersDeleteEmailForAuthenticated: ( - data: + reposGetReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => + this.request< + ReleaseAsset, + | BasicError | { - /** Email addresses associated with the GitHub user account. */ - emails: string[]; + documentation_url: string; + message: string; } - | string[] - | string, + >({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Users with push access to the repository can edit a release asset. + * + * @tags repos + * @name ReposUpdateReleaseAsset + * @summary Update a release asset + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} + */ + reposUpdateReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + data: { + /** An alternate short description of the asset. Used in place of the filename. */ + label?: string; + /** The file name of the asset. */ + name?: string; + /** @example ""uploaded"" */ + state?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description Lists the people following the authenticated user. + * No description * - * @tags users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @tags repos + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - usersListFollowersForAuthenticatedUser: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + reposDeleteReleaseAsset: ( + owner: string, + repo: string, + assetId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/user/followers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "DELETE", ...params, }), /** - * @description Lists the people who the authenticated user follows. + * @description View the latest published full release for the repository. The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. * - * @tags users - * @name UsersListFollowedByAuthenticated - * @summary List the people the authenticated user follows - * @request GET:/user/following + * @tags repos + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest */ - usersListFollowedByAuthenticated: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + reposGetLatestRelease: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/latest\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Get a published release with the specified tag. + * + * @tags repos + * @name ReposGetReleaseByTag + * @summary Get a release by tag name + * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + */ + reposGetReleaseByTag: ( + owner: string, + repo: string, + tag: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @description **Note:** This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). * - * @tags users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @tags repos + * @name ReposGetRelease + * @summary Get a release + * @request GET:/repos/{owner}/{repo}/releases/{release_id} */ - usersCheckPersonIsFollowedByAuthenticated: ( - username: string, + reposGetRelease: ( + owner: string, + repo: string, + releaseId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "GET", + format: "json", ...params, }), /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * @description Users with push access to the repository can edit a release. * - * @tags users - * @name UsersFollow - * @summary Follow a user - * @request PUT:/user/following/{username} + * @tags repos + * @name ReposUpdateRelease + * @summary Update a release + * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} */ - usersFollow: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/following/\${username}\`, - method: "PUT", + reposUpdateRelease: ( + owner: string, + repo: string, + releaseId: number, + data: { + /** Text describing the contents of the tag. */ + body?: string; + /** \`true\` makes the release a draft, and \`false\` publishes the release. */ + draft?: boolean; + /** The name of the release. */ + name?: string; + /** \`true\` to identify the release as a prerelease, \`false\` to identify the release as a full release. */ + prerelease?: boolean; + /** The name of the tag. */ + tag_name?: string; + /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually \`master\`). */ + target_commitish?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * @description Users with push access to the repository can delete a release. * - * @tags users - * @name UsersUnfollow - * @summary Unfollow a user - * @request DELETE:/user/following/{username} + * @tags repos + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - usersUnfollow: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/following/\${username}\`, + reposDeleteRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "DELETE", ...params, }), /** - * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * No description * - * @tags users - * @name UsersListGpgKeysForAuthenticated - * @summary List GPG keys for the authenticated user - * @request GET:/user/gpg_keys + * @tags repos + * @name ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets */ - usersListGpgKeysForAuthenticated: ( + reposListReleaseAssets: ( + owner: string, + repo: string, + releaseId: number, query?: { /** * Page number of the results to fetch. @@ -36338,8 +34430,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "GET", query: query, format: "json", @@ -36347,117 +34439,150 @@ export class Api< }), /** - * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: \`application/zip\` GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset. When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted. **Notes:** * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. * - * @tags users - * @name UsersCreateGpgKeyForAuthenticated - * @summary Create a GPG key for the authenticated user - * @request POST:/user/gpg_keys + * @tags repos + * @name ReposUploadReleaseAsset + * @summary Upload a release asset + * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets */ - usersCreateGpgKeyForAuthenticated: ( - data: { - /** A GPG key in ASCII-armored format. */ - armored_public_key: string; + reposUploadReleaseAsset: ( + owner: string, + repo: string, + releaseId: number, + data: WebhookConfigUrl, + query?: { + label?: string; + name?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "POST", + query: query, body: data, - type: ContentType.Json, format: "json", ...params, }), /** - * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. * - * @tags users - * @name UsersGetGpgKeyForAuthenticated - * @summary Get a GPG key for the authenticated user - * @request GET:/user/gpg_keys/{gpg_key_id} + * @tags secret-scanning + * @name SecretScanningListAlertsForRepo + * @summary List secret scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts */ - usersGetGpgKeyForAuthenticated: ( - gpgKeyId: number, + secretScanningListAlertsForRepo: ( + owner: string, + repo: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ + state?: "open" | "resolved"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, + this.request< + SecretScanningAlert[], + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` read permission to use this endpoint. * - * @tags users - * @name UsersDeleteGpgKeyForAuthenticated - * @summary Delete a GPG key for the authenticated user - * @request DELETE:/user/gpg_keys/{gpg_key_id} + * @tags secret-scanning + * @name SecretScanningGetAlert + * @summary Get a secret scanning alert + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} */ - usersDeleteGpgKeyForAuthenticated: ( - gpgKeyId: number, + secretScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: AlertNumber, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, - method: "DELETE", + this.request< + SecretScanningAlert, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + method: "GET", + format: "json", ...params, }), /** - * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. + * @description Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the \`repo\` scope or \`security_events\` scope. GitHub Apps must have the \`secret_scanning_alerts\` write permission to use this endpoint. * - * @tags apps - * @name AppsListInstallationsForAuthenticatedUser - * @summary List app installations accessible to the user access token - * @request GET:/user/installations + * @tags secret-scanning + * @name SecretScanningUpdateAlert + * @summary Update a secret scanning alert + * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} */ - appsListInstallationsForAuthenticatedUser: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + secretScanningUpdateAlert: ( + owner: string, + repo: string, + alertNumber: AlertNumber, + data: { + /** **Required when the \`state\` is \`resolved\`.** The reason for resolving the alert. Can be one of \`false_positive\`, \`wont_fix\`, \`revoked\`, or \`used_in_tests\`. */ + resolution?: SecretScanningAlertResolution; + /** Sets the state of the secret scanning alert. Can be either \`open\` or \`resolved\`. You must provide \`resolution\` when you set the state to \`resolved\`. */ + state: SecretScanningAlertState; }, params: RequestParams = {}, ) => this.request< - { - installations: Installation[]; - total_count: number; - }, - | BasicError - | { - documentation_url: string; - message: string; - } + SecretScanningAlert, + void | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/user/installations\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. + * @description Lists the people that have starred the repository. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: * - * @tags apps - * @name AppsListInstallationReposForAuthenticatedUser - * @summary List repositories accessible to the user access token - * @request GET:/user/installations/{installation_id}/repositories + * @tags activity + * @name ActivityListStargazersForRepo + * @summary List stargazers + * @request GET:/repos/{owner}/{repo}/stargazers */ - appsListInstallationReposForAuthenticatedUser: ( - installationId: number, + activityListStargazersForRepo: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -36472,15 +34597,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - repositories: Repository[]; - repository_selection?: string; - total_count: number; - }, - BasicError - >({ - path: \`/user/installations/\${installationId}/repositories\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stargazers\`, method: "GET", query: query, format: "json", @@ -36488,168 +34606,156 @@ export class Api< }), /** - * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. * - * @tags apps - * @name AppsAddRepoToInstallation - * @summary Add a repository to an app installation - * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + * @tags repos + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - appsAddRepoToInstallation: ( - installationId: number, - repositoryId: number, + reposGetCodeFrequencyStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + method: "GET", + format: "json", ...params, }), /** - * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * @description Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`. * - * @tags apps - * @name AppsRemoveRepoFromInstallation - * @summary Remove a repository from an app installation - * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + * @tags repos + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - appsRemoveRepoFromInstallation: ( - installationId: number, - repositoryId: number, + reposGetCommitActivityStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + method: "GET", + format: "json", ...params, }), /** - * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. + * @description Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information: * \`w\` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). * \`a\` - Number of additions * \`d\` - Number of deletions * \`c\` - Number of commits * - * @tags interactions - * @name InteractionsGetRestrictionsForAuthenticatedUser - * @summary Get interaction restrictions for your public repositories - * @request GET:/user/interaction-limits + * @tags repos + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors */ - interactionsGetRestrictionsForAuthenticatedUser: ( + reposGetContributorsStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/contributors\`, method: "GET", format: "json", ...params, }), /** - * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * @description Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`. The array order is oldest week (index 0) to most recent week. * - * @tags interactions - * @name InteractionsSetRestrictionsForAuthenticatedUser - * @summary Set interaction restrictions for your public repositories - * @request PUT:/user/interaction-limits + * @tags repos + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation */ - interactionsSetRestrictionsForAuthenticatedUser: ( - data: InteractionLimit, + reposGetParticipationStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/interaction-limits\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/participation\`, + method: "GET", format: "json", ...params, }), /** - * @description Removes any interaction restrictions from your public repositories. + * @description 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. * - * @tags interactions - * @name InteractionsRemoveRestrictionsForAuthenticatedUser - * @summary Remove interaction restrictions from your public repositories - * @request DELETE:/user/interaction-limits + * @tags repos + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - interactionsRemoveRestrictionsForAuthenticatedUser: ( + reposGetPunchCardStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/interaction-limits\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, + method: "GET", + format: "json", ...params, }), /** - * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * @description Users with push access in a repository can create commit statuses for a given SHA. Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error. * - * @tags issues - * @name IssuesListForAuthenticatedUser - * @summary List user account issues assigned to the authenticated user - * @request GET:/user/issues + * @tags repos + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - issuesListForAuthenticatedUser: ( - query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** - * Indicates which sorts of issues to return. Can be one of: - * \\* \`assigned\`: Issues assigned to you - * \\* \`created\`: Issues created by you - * \\* \`mentioned\`: Issues mentioning you - * \\* \`subscribed\`: Issues you're subscribed to updates for - * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation - * @default "assigned" - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + reposCreateCommitStatus: ( + owner: string, + repo: string, + sha: string, + data: { /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * A string label to differentiate this status from the status of other systems. This field is case-insensitive. + * @default "default" */ - sort?: "created" | "updated" | "comments"; + context?: string; + /** A short description of the status. */ + description?: string; + /** The state of the status. Can be one of \`error\`, \`failure\`, \`pending\`, or \`success\`. */ + state: "error" | "failure" | "pending" | "success"; /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. + * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: + * \`http://ci.example.com/user/repo/build/sha\` */ - state?: "open" | "closed" | "all"; + target_url?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/issues\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description Lists the people watching the specified repository. * - * @tags users - * @name UsersListPublicSshKeysForAuthenticated - * @summary List public SSH keys for the authenticated user - * @request GET:/user/keys + * @tags activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - usersListPublicSshKeysForAuthenticated: ( + activityListWatchersForRepo: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -36664,40 +34770,56 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscribers\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription + */ + activityGetRepoSubscription: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. * - * @tags users - * @name UsersCreatePublicSshKeyForAuthenticated - * @summary Create a public SSH key for the authenticated user - * @request POST:/user/keys + * @tags activity + * @name ActivitySetRepoSubscription + * @summary Set a repository subscription + * @request PUT:/repos/{owner}/{repo}/subscription */ - usersCreatePublicSshKeyForAuthenticated: ( + activitySetRepoSubscription: ( + owner: string, + repo: string, data: { - /** - * The public SSH key to add to your GitHub account. - * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) - */ - key: string; - /** - * A descriptive name for the new key. - * @example "Personal MacBook Air" - */ - title?: string; + /** Determines if all notifications should be blocked from this repository. */ + ignored?: boolean; + /** Determines if notifications should be received from this repository. */ + subscribed?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -36705,51 +34827,35 @@ export class Api< }), /** - * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). - * - * @tags users - * @name UsersGetPublicSshKeyForAuthenticated - * @summary Get a public SSH key for the authenticated user - * @request GET:/user/keys/{key_id} - */ - usersGetPublicSshKeyForAuthenticated: ( - keyId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/keys/\${keyId}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * @description This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). * - * @tags users - * @name UsersDeletePublicSshKeyForAuthenticated - * @summary Delete a public SSH key for the authenticated user - * @request DELETE:/user/keys/{key_id} + * @tags activity + * @name ActivityDeleteRepoSubscription + * @summary Delete a repository subscription + * @request DELETE:/repos/{owner}/{repo}/subscription */ - usersDeletePublicSshKeyForAuthenticated: ( - keyId: number, + activityDeleteRepoSubscription: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, method: "DELETE", ...params, }), /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * No description * - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUser - * @summary List subscriptions for the authenticated user - * @request GET:/user/marketplace_purchases + * @tags repos + * @name ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags */ - appsListSubscriptionsForAuthenticatedUser: ( + reposListTags: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -36764,8 +34870,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/marketplace_purchases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/tags\`, method: "GET", query: query, format: "json", @@ -36773,14 +34879,36 @@ export class Api< }), /** - * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * @description Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. * - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUserStubbed - * @summary List subscriptions for the authenticated user (stubbed) - * @request GET:/user/marketplace_purchases/stubbed + * @tags repos + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - appsListSubscriptionsForAuthenticatedUserStubbed: ( + reposDownloadTarballArchive: ( + owner: string, + repo: string, + ref: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, + method: "GET", + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposListTeams + * @summary List repository teams + * @request GET:/repos/{owner}/{repo}/teams + */ + reposListTeams: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -36795,8 +34923,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/marketplace_purchases/stubbed\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/teams\`, method: "GET", query: query, format: "json", @@ -36806,30 +34934,86 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @tags repos + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - orgsListMembershipsForAuthenticatedUser: ( + reposGetAllTopics: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request< + Topic, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/topics\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics + */ + reposReplaceAllTopics: ( + owner: string, + repo: string, + data: { + /** An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (\`[]\`) to clear all topics from the repository. **Note:** Topic \`names\` cannot contain uppercase letters. */ + names: string[]; + }, + params: RequestParams = {}, + ) => + this.request< + Topic, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/topics\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. + * + * @tags repos + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones + */ + reposGetClones: ( + owner: string, + repo: string, query?: { /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - per_page?: number; - /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ - state?: "active" | "pending"; + per?: "day" | "week"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/clones\`, method: "GET", query: query, format: "json", @@ -36837,74 +35021,67 @@ export class Api< }), /** - * No description + * @description Get the top 10 popular contents over the last 14 days. * - * @tags orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @tags repos + * @name ReposGetTopPaths + * @summary Get top referral paths + * @request GET:/repos/{owner}/{repo}/traffic/popular/paths */ - orgsGetMembershipForAuthenticatedUser: ( - org: string, + reposGetTopPaths: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, method: "GET", format: "json", ...params, }), /** - * No description + * @description Get the top 10 referrers over the last 14 days. * - * @tags orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} - */ - orgsUpdateMembershipForAuthenticatedUser: ( - org: string, - data: { - /** The state that the membership should be in. Only \`"active"\` will be accepted. */ - state: "active"; - }, + * @tags repos + * @name ReposGetTopReferrers + * @summary Get top referral sources + * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + */ + reposGetTopReferrers: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, + method: "GET", format: "json", ...params, }), /** - * @description Lists all migrations a user has started. + * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. * - * @tags migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * @tags repos + * @name ReposGetViews + * @summary Get page views + * @request GET:/repos/{owner}/{repo}/traffic/views */ - migrationsListForAuthenticatedUser: ( + reposGetViews: ( + owner: string, + repo: string, query?: { /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - per_page?: number; + per?: "day" | "week"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/views\`, method: "GET", query: query, format: "json", @@ -36912,36 +35089,26 @@ export class Api< }), /** - * @description Initiates the generation of a user migration archive. + * @description A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). * - * @tags migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @tags repos + * @name ReposTransfer + * @summary Transfer a repository + * @request POST:/repos/{owner}/{repo}/transfer */ - migrationsStartForAuthenticatedUser: ( + reposTransfer: ( + owner: string, + repo: string, data: { - /** - * Exclude attributes from the API response to improve performance - * @example ["repositories"] - */ - exclude?: "repositories"[]; - /** - * Do not include attachments in the migration - * @example true - */ - exclude_attachments?: boolean; - /** - * Lock the repositories being migrated at the start of the migration - * @example true - */ - lock_repositories?: boolean; - repositories: string[]; + /** The username or organization name the repository will be transferred to. */ + new_owner: string; + /** ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ + team_ids?: number[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/transfer\`, method: "POST", body: data, type: ContentType.Json, @@ -36950,140 +35117,167 @@ export class Api< }), /** - * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + * @description Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags migrations - * @name MigrationsGetStatusForAuthenticatedUser - * @summary Get a user migration status - * @request GET:/user/migrations/{migration_id} + * @tags repos + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - migrationsGetStatusForAuthenticatedUser: ( - migrationId: number, - query?: { - exclude?: string[]; - }, + reposCheckVulnerabilityAlerts: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. + * @description Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags migrations - * @name MigrationsGetArchiveForAuthenticatedUser - * @summary Download a user migration archive - * @request GET:/user/migrations/{migration_id}/archive + * @tags repos + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - migrationsGetArchiveForAuthenticatedUser: ( - migrationId: number, + reposEnableVulnerabilityAlerts: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/archive\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + method: "PUT", ...params, }), /** - * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * @description Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". * - * @tags migrations - * @name MigrationsDeleteArchiveForAuthenticatedUser - * @summary Delete a user migration archive - * @request DELETE:/user/migrations/{migration_id}/archive + * @tags repos + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - migrationsDeleteArchiveForAuthenticatedUser: ( - migrationId: number, + reposDisableVulnerabilityAlerts: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/archive\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "DELETE", ...params, }), /** - * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. + * @description Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually \`master\`) will be used. 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 after five minutes. * - * @tags migrations - * @name MigrationsUnlockRepoForAuthenticatedUser - * @summary Unlock a user repository - * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + * @tags repos + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - migrationsUnlockRepoForAuthenticatedUser: ( - migrationId: number, - repoName: string, + reposDownloadZipballArchive: ( + owner: string, + repo: string, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + method: "GET", ...params, }), /** - * @description Lists all the repositories for this user migration. + * @description Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository * - * @tags migrations - * @name MigrationsListReposForUser - * @summary List repositories for a user migration - * @request GET:/user/migrations/{migration_id}/repositories + * @tags repos + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - migrationsListReposForUser: ( - migrationId: number, - query?: { + reposCreateUsingTemplate: ( + templateOwner: string, + templateRepo: string, + data: { + /** A short description of the new repository. */ + description?: string; /** - * Page number of the results to fetch. - * @default 1 + * Set to \`true\` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: \`false\`. + * @default false */ - page?: number; + include_all_branches?: boolean; + /** The name of the new repository. */ + name: string; + /** The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ + owner?: string; /** - * Results per page (max 100) - * @default 30 + * Either \`true\` to create a new private repository or \`false\` to create a new public one. + * @default false */ - per_page?: number; + private?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; + repositories = { + /** + * @description Lists all public repositories in the order that they were created. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + * + * @tags repos + * @name ReposListPublic + * @summary List public repositories + * @request GET:/repositories + */ + reposListPublic: ( + query?: { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repositories\`, method: "GET", query: query, format: "json", ...params, }), - + }; + scim = { /** - * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags orgs - * @name OrgsListForAuthenticatedUser - * @summary List organizations for the authenticated user - * @request GET:/user/orgs + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedGroupsEnterprise + * @summary List provisioned SCIM groups for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Groups */ - orgsListForAuthenticatedUser: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + enterpriseAdminListProvisionedGroupsEnterprise: ( + enterprise: string, + query?: { + /** Used for pagination: the number of results to return. */ + count?: number; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/orgs\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, method: "GET", query: query, format: "json", @@ -37091,38 +35285,29 @@ export class Api< }), /** - * No description + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. * - * @tags projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup + * @summary Provision a SCIM enterprise group and invite users + * @request POST:/scim/v2/enterprises/{enterprise}/Groups */ - projectsCreateForAuthenticatedUser: ( + enterpriseAdminProvisionAndInviteEnterpriseGroup: ( + enterprise: string, data: { - /** - * Body of the project - * @example "This project represents the sprint of the first week in January" - */ - body?: string | null; - /** - * Name of the project - * @example "Week One Sprint" - */ - name: string; + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + /** The SCIM schema URIs. */ + schemas: string[]; }, params: RequestParams = {}, ) => - this.request< - Project, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationErrorSimple - >({ - path: \`/user/projects\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, method: "POST", body: data, type: ContentType.Json, @@ -37131,199 +35316,79 @@ export class Api< }), /** - * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags users - * @name UsersListPublicEmailsForAuthenticated - * @summary List public email addresses for the authenticated user - * @request GET:/user/public_emails + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup + * @summary Get SCIM provisioning information for an enterprise group + * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - usersListPublicEmailsForAuthenticated: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( + enterprise: string, + scimGroupId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/public_emails\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. * - * @tags repos - * @name ReposListForAuthenticatedUser - * @summary List repositories for the authenticated user - * @request GET:/user/repos + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup + * @summary Set SCIM information for a provisioned enterprise group + * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - reposListForAuthenticatedUser: ( - query?: { - /** - * Comma-separated list of values. Can include: - * \\* \`owner\`: Repositories that are owned by the authenticated user. - * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. - * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. - * @default "owner,collaborator,organization_member" - */ - affiliation?: string; - /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - before?: string; - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** - * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` - * - * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. - * @default "all" - */ - type?: "all" | "owner" | "public" | "private" | "member"; - /** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ - visibility?: "all" | "public" | "private"; + enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( + enterprise: string, + scimGroupId: string, + data: { + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + /** The SCIM schema URIs. */ + schemas: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repos\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). * - * @tags repos - * @name ReposCreateForAuthenticatedUser - * @summary Create a repository for the authenticated user - * @request POST:/user/repos + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup + * @summary Update an attribute for a SCIM enterprise group + * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - reposCreateForAuthenticatedUser: ( - data: { - /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true - */ - allow_merge_commit?: boolean; - /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true - */ - allow_rebase_merge?: boolean; - /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true - */ - allow_squash_merge?: boolean; - /** - * Whether the repository is initialized with a minimal README. - * @default false - */ - auto_init?: boolean; - /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false - */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; - /** - * The desired language or platform to apply to the .gitignore. - * @example "Haskell" - */ - gitignore_template?: string; - /** - * Whether downloads are enabled. - * @default true - * @example true - */ - has_downloads?: boolean; - /** - * Whether issues are enabled. - * @default true - * @example true - */ - has_issues?: boolean; - /** - * Whether projects are enabled. - * @default true - * @example true - */ - has_projects?: boolean; - /** - * Whether the wiki is enabled. - * @default true - * @example true - */ - has_wiki?: boolean; - /** A URL with more information about the repository. */ - homepage?: string; - /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false - * @example true - */ - is_template?: boolean; - /** - * The license keyword of the open source license for this repository. - * @example "mit" - */ - license_template?: string; - /** - * The name of the repository. - * @example "Team Environment" - */ - name: string; - /** - * Whether the repository is private or public. - * @default false - */ - private?: boolean; - /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ - team_id?: number; + enterpriseAdminUpdateAttributeForEnterpriseGroup: ( + enterprise: string, + scimGroupId: string, + data: { + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: object[]; + /** The SCIM schema URIs. */ + schemas: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repos\`, - method: "POST", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -37331,192 +35396,240 @@ export class Api< }), /** - * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags repos - * @name ReposListInvitationsForAuthenticatedUser - * @summary List repository invitations for the authenticated user - * @request GET:/user/repository_invitations + * @tags enterprise-admin + * @name EnterpriseAdminDeleteScimGroupFromEnterprise + * @summary Delete a SCIM group from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - reposListInvitationsForAuthenticatedUser: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminDeleteScimGroupFromEnterprise: ( + enterprise: string, + scimGroupId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Retrieves a paginated list of all provisioned enterprise members, including pending invitations. When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity \`null\` entry remains in place. * - * @tags repos - * @name ReposAcceptInvitation - * @summary Accept a repository invitation - * @request PATCH:/user/repository_invitations/{invitation_id} + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedIdentitiesEnterprise + * @summary List SCIM provisioned identities for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Users */ - reposAcceptInvitation: (invitationId: number, params: RequestParams = {}) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "PATCH", + enterpriseAdminListProvisionedIdentitiesEnterprise: ( + enterprise: string, + query?: { + /** Used for pagination: the number of results to return. */ + count?: number; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Provision enterprise membership for a user, and send organization invitation emails to the email address. You can optionally include the groups a user will be invited to join. If you do not provide a list of \`groups\`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. * - * @tags repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseUser + * @summary Provision and invite a SCIM enterprise user + * @request POST:/scim/v2/enterprises/{enterprise}/Users */ - reposDeclineInvitation: ( - invitationId: number, + enterpriseAdminProvisionAndInviteEnterpriseUser: ( + enterprise: string, + data: { + /** List of user emails. */ + emails: { + /** Whether this email address is the primary address. */ + primary: boolean; + /** The type of email address. */ + type: string; + /** The email address. */ + value: string; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + name: { + /** The last name of the user. */ + familyName: string; + /** The first name of the user. */ + givenName: string; + }; + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags activity - * @name ActivityListReposStarredByAuthenticatedUser - * @summary List repositories starred by the authenticated user - * @request GET:/user/starred + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser + * @summary Get SCIM provisioning information for an enterprise user + * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - activityListReposStarredByAuthenticatedUser: ( - query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; - }, + enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( + enterprise: string, + scimUserId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the enterprise, deletes the external identity, and deletes the associated \`{scim_user_id}\`. * - * @tags activity - * @name ActivityCheckRepoIsStarredByAuthenticatedUser - * @summary Check if a repository is starred by the authenticated user - * @request GET:/user/starred/{owner}/{repo} + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser + * @summary Set SCIM information for a provisioned enterprise user + * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - activityCheckRepoIsStarredByAuthenticatedUser: ( - owner: string, - repo: string, + enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( + enterprise: string, + scimUserId: string, + data: { + /** List of user emails. */ + emails: { + /** Whether this email address is the primary address. */ + primary: boolean; + /** The type of email address. */ + type: string; + /** The email address. */ + value: string; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + name: { + /** The last name of the user. */ + familyName: string; + /** The first name of the user. */ + givenName: string; + }; + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "GET", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` * - * @tags activity - * @name ActivityStarRepoForAuthenticatedUser - * @summary Star a repository for the authenticated user - * @request PUT:/user/starred/{owner}/{repo} + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseUser + * @summary Update an attribute for a SCIM enterprise user + * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - activityStarRepoForAuthenticatedUser: ( - owner: string, - repo: string, + enterpriseAdminUpdateAttributeForEnterpriseUser: ( + enterprise: string, + scimUserId: string, + data: { + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: object[]; + /** The SCIM schema URIs. */ + schemas: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteUserFromEnterprise + * @summary Delete a SCIM user from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - activityUnstarRepoForAuthenticatedUser: ( - owner: string, - repo: string, + enterpriseAdminDeleteUserFromEnterprise: ( + enterprise: string, + scimUserId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "DELETE", ...params, }), /** - * @description Lists repositories the authenticated user is watching. + * @description Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the \`filter\` parameter, the resources for all matching provisions members are returned. When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. The returned list of external identities can include an entry for a \`null\` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: 1. The user is granted access by the IdP and is not a member of the GitHub organization. 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. 1. After successfully authenticating with the SAML SSO IdP, the \`null\` external identity entry is created and the user is prompted to sign in to their GitHub account: - If the user signs in, their GitHub account is linked to this entry. - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity \`null\` entry remains in place. * - * @tags activity - * @name ActivityListWatchedReposForAuthenticatedUser - * @summary List repositories watched by the authenticated user - * @request GET:/user/subscriptions + * @tags scim + * @name ScimListProvisionedIdentities + * @summary List SCIM provisioned identities + * @request GET:/scim/v2/organizations/{org}/Users */ - activityListWatchedReposForAuthenticatedUser: ( + scimListProvisionedIdentities: ( + org: string, query?: { + /** Used for pagination: the number of results to return. */ + count?: number; /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 + * Filters results using the equals query parameter operator (\`eq\`). You can filter results that are equal to \`id\`, \`userName\`, \`emails\`, and \`external_id\`. For example, to search for an identity with the \`userName\` Octocat, you would use this query: + * + * \`?filter=userName%20eq%20\\"Octocat\\"\`. + * + * To filter results for the identity with the email \`octocat@github.com\`, you would use this query: + * + * \`?filter=emails%20eq%20\\"octocat@github.com\\"\`. */ - per_page?: number; + filter?: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/subscriptions\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, method: "GET", query: query, format: "json", @@ -37524,92 +35637,214 @@ export class Api< }), /** - * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). + * @description Provision organization membership for a user, and send an activation email to the email address. * - * @tags teams - * @name TeamsListForAuthenticatedUser - * @summary List teams for the authenticated user - * @request GET:/user/teams + * @tags scim + * @name ScimProvisionAndInviteUser + * @summary Provision and invite a SCIM user + * @request POST:/scim/v2/organizations/{org}/Users */ - teamsListForAuthenticatedUser: ( - query?: { + scimProvisionAndInviteUser: ( + org: string, + data: { + active?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - page?: number; + displayName?: string; /** - * Results per page (max 100) - * @default 30 + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] */ - per_page?: number; + emails: { + primary?: boolean; + type?: string; + value: string; + }[]; + externalId?: string; + groups?: string[]; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string; + formatted?: string; + givenName: string; + }; + schemas?: string[]; + /** + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" + */ + userName: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/teams\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags scim + * @name ScimGetProvisioningInformationForUser + * @summary Get SCIM provisioning information for a user + * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimGetProvisioningInformationForUser: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "GET", - query: query, format: "json", ...params, }), - }; - users = { + /** - * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + * @description Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. You must at least provide the required values for the user: \`userName\`, \`name\`, and \`emails\`. **Warning:** Setting \`active: false\` removes the user from the organization, deletes the external identity, and deletes the associated \`{scim_user_id}\`. * - * @tags users - * @name UsersList - * @summary List users - * @request GET:/users + * @tags scim + * @name ScimSetInformationForProvisionedUser + * @summary Update a provisioned organization membership + * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - usersList: ( - query?: { + scimSetInformationForProvisionedUser: ( + org: string, + scimUserId: string, + data: { + active?: boolean; /** - * Results per page (max 100) - * @default 30 + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - per_page?: number; - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; + displayName?: string; + /** + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + */ + emails: { + primary?: boolean; + type?: string; + value: string; + }[]; + externalId?: string; + groups?: string[]; + /** @example {"givenName":"Jane","familyName":"User"} */ + name: { + familyName: string; + formatted?: string; + givenName: string; + }; + schemas?: string[]; + /** + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" + */ + userName: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + * @description Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific \`Operations\` JSON format that contains at least one of the \`add\`, \`remove\`, or \`replace\` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). **Note:** Complicated SCIM \`path\` selectors that include filters are not supported. For example, a \`path\` selector defined as \`"path": "emails[type eq \\"work\\"]"\` will not work. **Warning:** If you set \`active:false\` using the \`replace\` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated \`:scim_user_id\`. \`\`\` { "Operations":[{ "op":"replace", "value":{ "active":false } }] } \`\`\` * - * @tags users - * @name UsersGetByUsername - * @summary Get a user - * @request GET:/users/{username} + * @tags scim + * @name ScimUpdateAttributeForUser + * @summary Update an attribute for a SCIM user + * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - usersGetByUsername: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/users/\${username}\`, - method: "GET", + scimUpdateAttributeForUser: ( + org: string, + scimUserId: string, + data: { + /** + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] + */ + Operations: { + op: "add" | "remove" | "replace"; + path?: string; + value?: + | { + active?: boolean | null; + externalId?: string | null; + familyName?: string | null; + givenName?: string | null; + userName?: string | null; + } + | { + primary?: boolean; + value?: string; + }[] + | string; + }[]; + schemas?: string[]; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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. + * No description * - * @tags activity - * @name ActivityListEventsForAuthenticatedUser - * @summary List events for the authenticated user - * @request GET:/users/{username}/events + * @tags scim + * @name ScimDeleteUserFromOrg + * @summary Delete a SCIM user from an organization + * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + */ + scimDeleteUserFromOrg: ( + org: string, + scimUserId: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "DELETE", + ...params, + }), + }; + search = { + /** + * @description Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: \`q=addClass+in:file+language:js+repo:jquery/jquery\` This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository. #### Considerations for code search Due to the complexity of searching code, there are a few restrictions on how searches are performed: * Only the _default branch_ is considered. In most cases, this will be the \`master\` branch. * Only files smaller than 384 KB are searchable. * You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + * + * @tags search + * @name SearchCode + * @summary Search code + * @request GET:/search/code */ - activityListEventsForAuthenticatedUser: ( - username: string, - query?: { + searchCode: ( + query: { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: "desc" | "asc"; /** * Page number of the results to fetch. * @default 1 @@ -37620,11 +35855,28 @@ export class Api< * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query. Can only be \`indexed\`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "indexed"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events\`, + this.request< + { + incomplete_results: boolean; + items: CodeSearchResultItem[]; + total_count: number; + }, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/code\`, method: "GET", query: query, format: "json", @@ -37632,17 +35884,20 @@ export class Api< }), /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * @description Find commits via various criteria on the default branch (usually \`master\`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: \`q=repo:octocat/Spoon-Knife+css\` * - * @tags activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} + * @tags search + * @name SearchCommits + * @summary Search commits + * @request GET:/search/commits */ - activityListOrgEventsForAuthenticatedUser: ( - username: string, - org: string, - query?: { + searchCommits: ( + query: { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: "desc" | "asc"; /** * Page number of the results to fetch. * @default 1 @@ -37653,11 +35908,25 @@ export class Api< * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by \`author-date\` or \`committer-date\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "author-date" | "committer-date"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/orgs/\${org}\`, + this.request< + { + incomplete_results: boolean; + items: CommitSearchResultItem[]; + total_count: number; + }, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/commits\`, method: "GET", query: query, format: "json", @@ -37665,16 +35934,20 @@ export class Api< }), /** - * No description + * @description Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. \`q=windows+label:bug+language:python+state:open&sort=created&order=asc\` This query searches for the keyword \`windows\`, within any open issue that is labeled as \`bug\`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the \`is:issue\` or \`is:pull-request\` qualifier will receive an HTTP \`422 Unprocessable Entity\` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the \`is\` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." * - * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @tags search + * @name SearchIssuesAndPullRequests + * @summary Search issues and pull requests + * @request GET:/search/issues */ - activityListPublicEventsForUser: ( - username: string, - query?: { + searchIssuesAndPullRequests: ( + query: { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: "desc" | "asc"; /** * Page number of the results to fetch. * @default 1 @@ -37685,11 +35958,39 @@ export class Api< * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by the number of \`comments\`, \`reactions\`, \`reactions-+1\`, \`reactions--1\`, \`reactions-smile\`, \`reactions-thinking_face\`, \`reactions-heart\`, \`reactions-tada\`, or \`interactions\`. You can also sort results by how recently the items were \`created\` or \`updated\`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: + | "comments" + | "reactions" + | "reactions-+1" + | "reactions--1" + | "reactions-smile" + | "reactions-thinking_face" + | "reactions-heart" + | "reactions-tada" + | "interactions" + | "created" + | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/public\`, + this.request< + { + incomplete_results: boolean; + items: IssueSearchResultItem[]; + total_count: number; + }, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/issues\`, method: "GET", query: query, format: "json", @@ -37697,31 +35998,38 @@ export class Api< }), /** - * @description Lists the people following the specified user. + * @description Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this: \`q=bug+defect+enhancement&repository_id=64778136\` The labels that best match the query appear first in the search results. * - * @tags users - * @name UsersListFollowersForUser - * @summary List followers of a user - * @request GET:/users/{username}/followers + * @tags search + * @name SearchLabels + * @summary Search labels + * @request GET:/search/labels */ - usersListFollowersForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + searchLabels: ( + query: { /** - * Results per page (max 100) - * @default 30 + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" */ - per_page?: number; + order?: "desc" | "asc"; + /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + /** The id of the repository. */ + repository_id: number; + /** Sorts the results of your query by when the label was \`created\` or \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "created" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/followers\`, + this.request< + { + incomplete_results: boolean; + items: LabelSearchResultItem[]; + total_count: number; + }, + BasicError | ValidationError + >({ + path: \`/search/labels\`, method: "GET", query: query, format: "json", @@ -37729,16 +36037,20 @@ export class Api< }), /** - * @description Lists the people who the specified user follows. + * @description Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: \`q=tetris+language:assembly&sort=stars&order=desc\` This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. When you include the \`mercy\` preview header, you can also search for multiple topics by adding more \`topic:\` instances. For example, your query might look like this: \`q=topic:ruby+topic:rails\` * - * @tags users - * @name UsersListFollowingForUser - * @summary List the people a user follows - * @request GET:/users/{username}/following + * @tags search + * @name SearchRepos + * @summary Search repositories + * @request GET:/search/repositories */ - usersListFollowingForUser: ( - username: string, - query?: { + searchRepos: ( + query: { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: "desc" | "asc"; /** * Page number of the results to fetch. * @default 1 @@ -37749,11 +36061,27 @@ export class Api< * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`stars\`, \`forks\`, or \`help-wanted-issues\` or how recently the items were \`updated\`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "stars" | "forks" | "help-wanted-issues" | "updated"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following\`, + this.request< + { + incomplete_results: boolean; + items: RepoSearchResultItem[]; + total_count: number; + }, + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/repositories\`, method: "GET", query: query, format: "json", @@ -37761,52 +36089,32 @@ export class Api< }), /** - * No description - * - * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} - */ - usersCheckFollowingForUser: ( - username: string, - targetUser: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/users/\${username}/following/\${targetUser}\`, - method: "GET", - ...params, - }), - - /** - * @description Lists public gists for the specified user: + * @description Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. When searching for topics, you can get text match metadata for the topic's **short\\_description**, **description**, **name**, or **display\\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: \`q=ruby+is:featured\` This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. * - * @tags gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @tags search + * @name SearchTopics + * @summary Search topics + * @request GET:/search/topics */ - gistsListForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ - since?: string; + searchTopics: ( + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gists\`, + this.request< + { + incomplete_results: boolean; + items: TopicSearchResultItem[]; + total_count: number; + }, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/topics\`, method: "GET", query: query, format: "json", @@ -37814,16 +36122,20 @@ export class Api< }), /** - * @description Lists the GPG keys for a user. This information is accessible by anyone. + * @description Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For example, if you're looking for a list of popular users, you might try this query: \`q=tom+repos:%3E42+followers:%3E1000\` This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers. * - * @tags users - * @name UsersListGpgKeysForUser - * @summary List GPG keys for a user - * @request GET:/users/{username}/gpg_keys + * @tags search + * @name SearchUsers + * @summary Search users + * @request GET:/search/users */ - usersListGpgKeysForUser: ( - username: string, - query?: { + searchUsers: ( + query: { + /** + * Determines whether the first search result returned is the highest number of matches (\`desc\`) or lowest number of matches (\`asc\`). This parameter is ignored unless you provide \`sort\`. + * @default "desc" + */ + order?: "desc" | "asc"; /** * Page number of the results to fetch. * @default 1 @@ -37834,70 +36146,131 @@ export class Api< * @default 30 */ per_page?: number; + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of \`followers\` or \`repositories\`, or when the person \`joined\` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "followers" | "repositories" | "joined"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gpg_keys\`, + this.request< + { + incomplete_results: boolean; + items: UserSearchResultItem[]; + total_count: number; + }, + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/search/users\`, method: "GET", query: query, format: "json", ...params, }), + }; + teams = { + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * + * @tags teams + * @name TeamsGetLegacy + * @summary Get a team (Legacy) + * @request GET:/teams/{team_id} + * @deprecated + */ + teamsGetLegacy: (teamId: number, params: RequestParams = {}) => + this.request({ + path: \`/teams/\${teamId}\`, + method: "GET", + format: "json", + ...params, + }), /** - * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. To edit a team, the authenticated user must either be an organization owner or a team maintainer. **Note:** With nested teams, the \`privacy\` for parent teams cannot be \`secret\`. * - * @tags users - * @name UsersGetContextForUser - * @summary Get contextual information for a user - * @request GET:/users/{username}/hovercard + * @tags teams + * @name TeamsUpdateLegacy + * @summary Update a team (Legacy) + * @request PATCH:/teams/{team_id} + * @deprecated */ - usersGetContextForUser: ( - username: string, - query?: { - /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ - subject_id?: string; - /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ - subject_type?: "organization" | "repository" | "issue" | "pull_request"; + teamsUpdateLegacy: ( + teamId: number, + data: { + /** The description of the team. */ + description?: string; + /** The name of the team. */ + name: string; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number | null; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer newly-added repositories. + * \\* \`push\` - team members can pull and push, but not administer newly-added repositories. + * \\* \`admin\` - team members can pull, push and administer newly-added repositories. + * @default "pull" + */ + permission?: "pull" | "push" | "admin"; + /** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: + * **For a non-nested team:** + * \\* \`secret\` - only visible to organization owners and members of this team. + * \\* \`closed\` - visible to all members of this organization. + * **For a parent or child team:** + * \\* \`closed\` - visible to all members of this organization. + */ + privacy?: "secret" | "closed"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/hovercard\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. * - * @tags apps - * @name AppsGetUserInstallation - * @summary Get a user installation for the authenticated app - * @request GET:/users/{username}/installation + * @tags teams + * @name TeamsDeleteLegacy + * @summary Delete a team (Legacy) + * @request DELETE:/teams/{team_id} + * @deprecated */ - appsGetUserInstallation: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/users/\${username}/installation\`, - method: "GET", - format: "json", + teamsDeleteLegacy: (teamId: number, params: RequestParams = {}) => + this.request({ + path: \`/teams/\${teamId}\`, + method: "DELETE", ...params, }), /** - * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. List all discussions on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags users - * @name UsersListPublicKeysForUser - * @summary List public keys for a user - * @request GET:/users/{username}/keys + * @tags teams + * @name TeamsListDiscussionsLegacy + * @summary List discussions (Legacy) + * @request GET:/teams/{team_id}/discussions + * @deprecated */ - usersListPublicKeysForUser: ( - username: string, + teamsListDiscussionsLegacy: ( + teamId: number, query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -37911,8 +36284,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/keys\`, + this.request({ + path: \`/teams/\${teamId}/discussions\`, method: "GET", query: query, format: "json", @@ -37920,157 +36293,125 @@ export class Api< }), /** - * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. Creates a new discussion post on a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags orgs - * @name OrgsListForUser - * @summary List organizations for a user - * @request GET:/users/{username}/orgs + * @tags teams + * @name TeamsCreateDiscussionLegacy + * @summary Create a discussion (Legacy) + * @request POST:/teams/{team_id}/discussions + * @deprecated */ - orgsListForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + teamsCreateDiscussionLegacy: ( + teamId: number, + data: { + /** The discussion post's body text. */ + body: string; /** - * Results per page (max 100) - * @default 30 + * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to \`true\` to create a private post. + * @default false */ - per_page?: number; + private?: boolean; + /** The discussion post's title. */ + title: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/orgs\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}/discussions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. Get a specific discussion on a team's page. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @tags teams + * @name TeamsGetDiscussionLegacy + * @summary Get a discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - projectsListForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: "open" | "closed" | "all"; - }, + teamsGetDiscussionLegacy: ( + teamId: number, + discussionNumber: number, params: RequestParams = {}, ) => - this.request< - Project[], - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/users/\${username}/projects\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags activity - * @name ActivityListReceivedEventsForUser - * @summary List events received by the authenticated user - * @request GET:/users/{username}/received_events + * @tags teams + * @name TeamsUpdateDiscussionLegacy + * @summary Update a discussion (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - activityListReceivedEventsForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + teamsUpdateDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + data: { + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. Delete a discussion from a team's page. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @tags teams + * @name TeamsDeleteDiscussionLegacy + * @summary Delete a discussion (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - activityListReceivedPublicEventsForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + teamsDeleteDiscussionLegacy: ( + teamId: number, + discussionNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events/public\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "DELETE", ...params, }), /** - * @description Lists public repositories for the specified user. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. List all comments on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * @tags teams + * @name TeamsListDiscussionCommentsLegacy + * @summary List discussion comments (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - reposListForUser: ( - username: string, + teamsListDiscussionCommentsLegacy: ( + teamId: number, + discussionNumber: number, query?: { - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ direction?: "asc" | "desc"; /** * Page number of the results to fetch. @@ -38082,21 +36423,11 @@ export class Api< * @default 30 */ per_page?: number; - /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" - */ - type?: "all" | "owner" | "member"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/repos\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, method: "GET", query: query, format: "json", @@ -38104,115 +36435,127 @@ export class Api< }), /** - * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. Creates a new comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. * - * @tags billing - * @name BillingGetGithubActionsBillingUser - * @summary Get GitHub Actions billing for a user - * @request GET:/users/{username}/settings/billing/actions + * @tags teams + * @name TeamsCreateDiscussionCommentLegacy + * @summary Create a discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - billingGetGithubActionsBillingUser: ( - username: string, + teamsCreateDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + data: { + /** The discussion comment's body text. */ + body: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/actions\`, - method: "GET", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. Get a specific comment on a team discussion. OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags billing - * @name BillingGetGithubPackagesBillingUser - * @summary Get GitHub Packages billing for a user - * @request GET:/users/{username}/settings/billing/packages + * @tags teams + * @name TeamsGetDiscussionCommentLegacy + * @summary Get a discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - billingGetGithubPackagesBillingUser: ( - username: string, + teamsGetDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/packages\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, method: "GET", format: "json", ...params, }), /** - * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. Edits the body text of a discussion comment. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags billing - * @name BillingGetSharedStorageBillingUser - * @summary Get shared storage billing for a user - * @request GET:/users/{username}/settings/billing/shared-storage + * @tags teams + * @name TeamsUpdateDiscussionCommentLegacy + * @summary Update a discussion comment (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - billingGetSharedStorageBillingUser: ( - username: string, + teamsUpdateDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, + data: { + /** The discussion comment's body text. */ + body: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/shared-storage\`, - method: "GET", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. Deletes a comment on a team discussion. OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags activity - * @name ActivityListReposStarredByUser - * @summary List repositories starred by a user - * @request GET:/users/{username}/starred + * @tags teams + * @name TeamsDeleteDiscussionCommentLegacy + * @summary Delete a discussion comment (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - activityListReposStarredByUser: ( - username: string, - query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ - sort?: "created" | "updated"; - }, + teamsDeleteDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/starred\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", ...params, }), /** - * @description Lists repositories a user is watching. + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @tags reactions + * @name ReactionsListForTeamDiscussionCommentLegacy + * @summary List reactions for a team discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated */ - activityListReposWatchedByUser: ( - username: string, + reactionsListForTeamDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** * Page number of the results to fetch. * @default 1 @@ -38226,1918 +36569,3011 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/subscriptions\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "GET", query: query, format: "json", ...params, }), - }; - zen = { - /** - * @description Get a random sentence from the Zen of GitHub - * - * @tags meta - * @name MetaGetZen - * @summary Get the Zen of GitHub - * @request GET:/zen - */ - metaGetZen: (params: RequestParams = {}) => - this.request({ - path: \`/zen\`, - method: "GET", - ...params, - }), - }; -} -" -`; - -exports[`simple > 'furkot-example' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ -export interface Step { - /** address of the stop */ - address?: string; - /** - * arrival at the stop in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - arrival?: string; - /** geographical coordinates of the stop */ - coordinates?: { - /** - * latitude - * @format float - */ - lat?: number; - /** - * longitude - * @format float - */ - lon?: number; - }; - /** - * departure from the stop in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - departure?: string; - /** name of the stop */ - name?: string; - /** - * number of nights - * @format int64 - */ - nights?: number; - /** route leading to the stop */ - route?: { - /** - * route distance in meters - * @format int64 - */ - distance?: number; /** - * route duration in seconds - * @format int64 + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion comment. + * + * @tags reactions + * @name ReactionsCreateForTeamDiscussionCommentLegacy + * @summary Create reaction for a team discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions + * @deprecated */ - duration?: number; - /** travel mode */ - mode?: "car" | "motorcycle" | "bicycle" | "walk" | "other"; - /** route path compatible with Google polyline encoding algorithm */ - polyline?: string; - }; - /** url of the page with more information about the stop */ - url?: string; -} - -export interface Trip { - /** - * begin of the trip in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - begin?: string; - /** description of the trip (truncated to 200 characters) */ - description?: string; - /** - * end of the trip in its local timezone as YYYY-MM-DDThh:mm - * @format date-time - */ - end?: string; - /** Unique ID of the trip */ - id?: string; - /** name of the trip */ - name?: 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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -export class HttpClient { - public baseUrl: string = "https://trips.furkot.com/pub/api"; - 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}\` : ""; - } + reactionsCreateForTeamDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, + data: { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`read:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags reactions + * @name ReactionsListForTeamDiscussionLegacy + * @summary List reactions for a team discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + reactionsListForTeamDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + query?: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - return 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), - }; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the \`write:discussion\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a \`Status: 200 OK\` means that you already added the reaction type to this team discussion. + * + * @tags reactions + * @name ReactionsCreateForTeamDiscussionLegacy + * @summary Create reaction for a team discussion (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated + */ + reactionsCreateForTeamDiscussionLegacy: ( + teamId: number, + discussionNumber: number, + data: { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`. + * + * @tags teams + * @name TeamsListPendingInvitationsLegacy + * @summary List pending team invitations (Legacy) + * @request GET:/teams/{team_id}/invitations + * @deprecated + */ + teamsListPendingInvitationsLegacy: ( + teamId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, - }; - } + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/invitations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - 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; - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * + * @tags teams + * @name TeamsListMembersLegacy + * @summary List team members (Legacy) + * @request GET:/teams/{team_id}/members + * @deprecated + */ + teamsListMembersLegacy: ( + teamId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Filters members returned by their role in the team. Can be one of: + * \\* \`member\` - normal members of the team. + * \\* \`maintainer\` - team maintainers. + * \\* \`all\` - all members of the team. + * @default "all" + */ + role?: "member" | "maintainer" | "all"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description The "Get team member" endpoint (described below) is deprecated. We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. To list members in a team, the team must be visible to the authenticated user. + * + * @tags teams + * @name TeamsGetMemberLegacy + * @summary Get team member (Legacy) + * @request GET:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsGetMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "GET", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description The "Add team member" endpoint (described below) is deprecated. We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags teams + * @name TeamsAddMemberLegacy + * @summary Add team member (Legacy) + * @request PUT:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsAddMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request< + void, + | BasicError + | void + | { + /** @example ""https://docs.github.com/rest"" */ + documentation_url?: string; + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; + } + >({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "PUT", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description The "Remove team member" endpoint (described below) is deprecated. We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * @tags teams + * @name TeamsRemoveMemberLegacy + * @summary Remove team member (Legacy) + * @request DELETE:/teams/{team_id}/members/{username} + * @deprecated + */ + teamsRemoveMemberLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "DELETE", + ...params, + }), - 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; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. Team members will include the members of child teams. To get a user's membership with a team, the team must be visible to the authenticated user. **Note:** The \`role\` for organization owners returns as \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + * + * @tags teams + * @name TeamsGetMembershipForUserLegacy + * @summary Get team membership for a user (Legacy) + * @request GET:/teams/{team_id}/memberships/{username} + * @deprecated + */ + teamsGetMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "GET", + format: "json", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - body: - typeof body === "undefined" || body === null - ? null - : payloadFormatter(body), + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." If the user is unaffiliated with the team's organization, 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserLegacy + * @summary Add or update team membership for a user (Legacy) + * @request PUT:/teams/{team_id}/memberships/{username} + * @deprecated + */ + teamsAddOrUpdateMembershipForUserLegacy: ( + teamId: number, + username: string, + data: { + /** + * The role that this user should have in the team. Can be one of: + * \\* \`member\` - a normal member of the team. + * \\* \`maintainer\` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + * @default "member" + */ + role?: "member" | "maintainer"; }, - ).then(async (response) => { - const r = response as HttpResponse; - r.data = null as unknown as T; - r.error = null as unknown as E; - - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + params: RequestParams = {}, + ) => + this.request< + TeamMembership, + | void + | BasicError + | { + /** @example ""https://help.github.com/articles/github-and-trade-controls"" */ + documentation_url?: string; + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; + } + >({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. 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. Removing team membership does not delete the user, it just removes their membership from the team. **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * @tags teams + * @name TeamsRemoveMembershipForUserLegacy + * @summary Remove team membership for a user (Legacy) + * @request DELETE:/teams/{team_id}/memberships/{username} + * @deprecated + */ + teamsRemoveMembershipForUserLegacy: ( + teamId: number, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "DELETE", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. + * + * @tags teams + * @name TeamsListProjectsLegacy + * @summary List team projects (Legacy) + * @request GET:/teams/{team_id}/projects + * @deprecated + */ + teamsListProjectsLegacy: ( + teamId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request< + TeamProject[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -/** - * @title Furkot Trips - * @version 1.0.0 - * @baseUrl https://trips.furkot.com/pub/api - * @externalDocs https://help.furkot.com/widgets/furkot-api.html - * @contact - * - * Furkot provides Rest API to access user trip data. - * Using Furkot API an application can list user trips and display stops for a specific trip. - * Furkot API uses OAuth2 protocol to authorize applications to access data on behalf of users. - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { - trip = { /** - * @description list user's trips + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. Checks whether a team has \`read\`, \`write\`, or \`admin\` permissions for an organization project. The response includes projects inherited from a parent team. * - * @name TripList - * @request GET:/trip - * @secure + * @tags teams + * @name TeamsCheckPermissionsForProjectLegacy + * @summary Check team permissions for a project (Legacy) + * @request GET:/teams/{team_id}/projects/{project_id} + * @deprecated */ - tripList: (params: RequestParams = {}) => - this.request({ - path: \`/trip\`, + teamsCheckPermissionsForProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => + this.request< + TeamProject, + void | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, method: "GET", - secure: true, format: "json", ...params, }), /** - * @description list stops for a trip identified by {trip_id} + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have \`admin\` permissions for the project. The project and team must be part of the same organization. * - * @name StopList - * @request GET:/trip/{trip_id}/stop - * @secure + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsLegacy + * @summary Add or update team project permissions (Legacy) + * @request PUT:/teams/{team_id}/projects/{project_id} + * @deprecated */ - stopList: (tripId: string, params: RequestParams = {}) => - this.request({ - path: \`/trip/\${tripId}/stop\`, - method: "GET", - secure: true, - format: "json", - ...params, - }), - }; -} -" -`; - -exports[`simple > 'giphy' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface Gif { - /** - * The unique bit.ly URL for this GIF - * @example "http://gph.is/1gsWDcL" - */ - bitly_url?: string; - /** Currently unused */ - content_url?: string; - /** - * The date this GIF was added to the GIPHY database. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - create_datetime?: string; - /** - * A URL used for embedding this GIF - * @example "http://giphy.com/embed/YsTs5ltWtEhnq" - */ - embded_url?: string; - /** An array of featured tags for this GIF (Note: Not available when using the Public Beta Key) */ - featured_tags?: string[]; - /** - * This GIF's unique ID - * @example "YsTs5ltWtEhnq" - */ - id?: string; - /** An object containing data for various available formats and sizes of this GIF. */ - images?: { - /** Data surrounding a version of this GIF downsized to be under 2mb. */ - downsized?: Image; - /** Data surrounding a version of this GIF downsized to be under 8mb. */ - downsized_large?: Image; - /** Data surrounding a version of this GIF downsized to be under 5mb. */ - downsized_medium?: Image; - /** Data surrounding a version of this GIF downsized to be under 200kb. */ - downsized_small?: Image; - /** Data surrounding a static preview image of the downsized version of this GIF. */ - downsized_still?: Image; - /** Data surrounding versions of this GIF with a fixed height of 200 pixels. Good for mobile use. */ - fixed_height?: Image; - /** Data surrounding versions of this GIF with a fixed height of 200 pixels and the number of frames reduced to 6. */ - fixed_height_downsampled?: Image; - /** Data surrounding versions of this GIF with a fixed height of 100 pixels. Good for mobile keyboards. */ - fixed_height_small?: Image; - /** Data surrounding a static image of this GIF with a fixed height of 100 pixels. */ - fixed_height_small_still?: Image; - /** Data surrounding a static image of this GIF with a fixed height of 200 pixels. */ - fixed_height_still?: Image; - /** Data surrounding versions of this GIF with a fixed width of 200 pixels. Good for mobile use. */ - fixed_width?: Image; - /** Data surrounding versions of this GIF with a fixed width of 200 pixels and the number of frames reduced to 6. */ - fixed_width_downsampled?: Image; - /** Data surrounding versions of this GIF with a fixed width of 100 pixels. Good for mobile keyboards. */ - fixed_width_small?: Image; - /** Data surrounding a static image of this GIF with a fixed width of 100 pixels. */ - fixed_width_small_still?: Image; - /** Data surrounding a static image of this GIF with a fixed width of 200 pixels. */ - fixed_width_still?: Image; - /** Data surrounding a version of this GIF set to loop for 15 seconds. */ - looping?: Image; - /** Data surrounding the original version of this GIF. Good for desktop use. */ - original?: Image; - /** Data surrounding a static preview image of the original GIF. */ - original_still?: Image; - /** Data surrounding a version of this GIF in .MP4 format limited to 50kb that displays the first 1-2 seconds of the GIF. */ - preview?: Image; - /** Data surrounding a version of this GIF limited to 50kb that displays the first 1-2 seconds of the GIF. */ - preview_gif?: Image; - }; - /** - * The creation or upload date from this GIF's source. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - import_datetime?: string; - /** - * The MPAA-style rating for this content. Examples include Y, G, PG, PG-13 and R - * @example "g" - */ - rating?: string; - /** - * The unique slug used in this GIF's URL - * @example "confused-flying-YsTs5ltWtEhnq" - */ - slug?: string; - /** - * The page on which this GIF was found - * @example "http://www.reddit.com/r/reactiongifs/comments/1xpyaa/superman_goes_to_hollywood/" - */ - source?: string; - /** - * The URL of the webpage on which this GIF was found. - * @example "http://cheezburger.com/5282328320" - */ - source_post_url?: string; - /** - * The top level domain of the source URL. - * @example "cheezburger.com" - */ - source_tld?: string; - /** An array of tags for this GIF (Note: Not available when using the Public Beta Key) */ - tags?: string[]; - /** - * The date on which this gif was marked trending, if applicable. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - trending_datetime?: string; - /** - * Type of the gif. By default, this is almost always gif - * @default "gif" - */ - type?: "gif"; - /** - * The date on which this GIF was last updated. - * @format date-time - * @example "2013-08-01 12:41:48" - */ - update_datetime?: string; - /** - * The unique URL for this GIF - * @example "http://giphy.com/gifs/confused-flying-YsTs5ltWtEhnq" - */ - url?: string; - /** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ - user?: User; - /** - * The username this GIF is attached to, if applicable - * @example "JoeCool4000" - */ - username?: string; -} - -export interface Image { - /** - * The URL for this GIF in .MP4 format. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.mp4" - */ - mp4?: string; - /** - * The size in bytes of the .MP4 file corresponding to this GIF. - * @example "25123" - */ - mp4_size?: string; - /** - * The number of frames in this GIF. - * @example "15" - */ - frames?: string; - /** - * The height of this GIF in pixels. - * @example "200" - */ - height?: string; - /** - * The size of this GIF in bytes. - * @example "32381" - */ - size?: string; - /** - * The publicly-accessible direct URL for this GIF. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/200.gif" - */ - url?: string; - /** - * The URL for this GIF in .webp format. - * @example "https://media1.giphy.com/media/cZ7rmKfFYOvYI/giphy.webp" - */ - webp?: string; - /** - * The size in bytes of the .webp file corresponding to this GIF. - * @example "12321" - */ - webp_size?: string; - /** - * The width of this GIF in pixels. - * @example "320" - */ - width?: string; -} - -/** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ -export interface Meta { - /** - * HTTP Response Message - * @example "OK" - */ - msg?: string; - /** - * A unique ID paired with this response from the API. - * @example "57eea03c72381f86e05c35d2" - */ - response_id?: string; - /** - * HTTP Response Code - * @format int32 - * @example 200 - */ - status?: number; -} + teamsAddOrUpdateProjectPermissionsLegacy: ( + teamId: number, + projectId: number, + data: { + /** + * The permission to grant to the team for this project. Can be one of: + * \\* \`read\` - team members can read, but not write to or administer this project. + * \\* \`write\` - team members can read and write, but not administer this project. + * \\* \`admin\` - team members can read, write and administer this project. + * Default: the team's \`permission\` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + permission?: "read" | "write" | "admin"; + }, + params: RequestParams = {}, + ) => + this.request< + void, + | { + documentation_url?: string; + message?: string; + } + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), -/** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ -export interface Pagination { - /** - * Total number of items returned. - * @format int32 - * @example 25 - */ - count?: number; - /** - * Position in pagination. - * @format int32 - * @example 75 - */ - offset?: number; - /** - * Total number of items available. - * @format int32 - * @example 250 - */ - total_count?: number; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have \`read\` access to both the team and project, or \`admin\` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + * + * @tags teams + * @name TeamsRemoveProjectLegacy + * @summary Remove a project from a team (Legacy) + * @request DELETE:/teams/{team_id}/projects/{project_id} + * @deprecated + */ + teamsRemoveProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "DELETE", + ...params, + }), -/** The User Object contains information about the user associated with a GIF and URLs to assets such as that user's avatar image, profile, and more. */ -export interface User { - /** - * The URL for this user's avatar image. - * @example "https://media1.giphy.com/avatars/election2016/XwYrZi5H87o6.gif" - */ - avatar_url?: string; - /** - * The URL for the banner image that appears atop this user's profile page. - * @example "https://media4.giphy.com/avatars/cheezburger/XkuejOhoGLE6.jpg" - */ - banner_url?: string; - /** - * The display name associated with this user (contains formatting the base username might not). - * @example "JoeCool4000" - */ - display_name?: string; - /** - * The URL for this user's profile. - * @example "https://giphy.com/cheezburger/" - */ - profile_url?: string; - /** - * The Twitter username associated with this user, if applicable. - * @example "@joecool4000" - */ - twitter?: string; - /** - * The username associated with this user. - * @example "joecool4000" - */ - username?: string; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * + * @tags teams + * @name TeamsListReposLegacy + * @summary List team repositories (Legacy) + * @request GET:/teams/{team_id}/repos + * @deprecated + */ + teamsListReposLegacy: ( + teamId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * @description **Note**: Repositories inherited through a parent team will also be checked. **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * + * @tags teams + * @name TeamsCheckPermissionsForRepoLegacy + * @summary Check team permissions for a repository (Legacy) + * @request GET:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsCheckPermissionsForRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "GET", + format: "json", + ...params, + }), -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; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsLegacy + * @summary Add or update team repository permissions (Legacy) + * @request PUT:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsAddOrUpdateRepoPermissionsLegacy: ( + teamId: number, + owner: string, + repo: string, + data: { + /** + * The permission to grant the team on this repository. Can be one of: + * \\* \`pull\` - team members can pull, but not push to or administer this repository. + * \\* \`push\` - team members can pull and push, but not administer this repository. + * \\* \`admin\` - team members can pull, push and administer this repository. + * + * If no permission is specified, the team's \`permission\` attribute will be used to determine what permission to grant the team on this repository. + */ + permission?: "pull" | "push" | "admin"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + * + * @tags teams + * @name TeamsRemoveRepoLegacy + * @summary Remove a repository from a team (Legacy) + * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated + */ + teamsRemoveRepoLegacy: ( + teamId: number, + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "DELETE", + ...params, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List IdP groups for a team\`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. List IdP groups connected to a team on GitHub. + * + * @tags teams + * @name TeamsListIdpGroupsForLegacy + * @summary List IdP groups for a team (Legacy) + * @request GET:/teams/{team_id}/team-sync/group-mappings + * @deprecated + */ + teamsListIdpGroupsForLegacy: (teamId: number, params: RequestParams = {}) => + this.request({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + method: "GET", + format: "json", + ...params, + }), -export interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create or update IdP group connections\`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty \`groups\` array will remove all connections for a team. + * + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy + * @summary Create or update IdP group connections (Legacy) + * @request PATCH:/teams/{team_id}/team-sync/group-mappings + * @deprecated + */ + teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( + teamId: number, + data: { + /** The IdP groups you want to connect to a GitHub team. When updating, the new \`groups\` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups: { + /** @example ""moar cheese pleese"" */ + description?: string; + /** Description of the IdP group. */ + group_description: string; + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + /** @example ""caceab43fc9ffa20081c"" */ + id?: string; + /** @example ""external-team-6c13e7288ef7"" */ + name?: string; + }[]; + /** @example ""I am not a timestamp"" */ + synced_at?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -type CancelToken = Symbol | string | number; + /** + * @description **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. + * + * @tags teams + * @name TeamsListChildLegacy + * @summary List child teams (Legacy) + * @request GET:/teams/{team_id}/teams + * @deprecated + */ + teamsListChildLegacy: ( + teamId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/teams/\${teamId}/teams\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + user = { + /** + * @description If the authenticated user is authenticated through basic authentication or OAuth with the \`user\` scope, then the response lists public and private profile information. If the authenticated user is authenticated through OAuth without the \`user\` scope, then the response lists only public profile information. + * + * @tags users + * @name UsersGetAuthenticated + * @summary Get the authenticated user + * @request GET:/user + */ + usersGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/user\`, + method: "GET", + format: "json", + ...params, + }), -export enum ContentType { - Json = "application/json", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} + /** + * @description **Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. + * + * @tags users + * @name UsersUpdateAuthenticated + * @summary Update the authenticated user + * @request PATCH:/user + */ + usersUpdateAuthenticated: ( + data: { + /** The new short biography of the user. */ + bio?: string; + /** + * The new blog URL of the user. + * @example "blog.example.com" + */ + blog?: string; + /** + * The new company of the user. + * @example "Acme corporation" + */ + company?: string; + /** + * The publicly visible email address of the user. + * @example "omar@example.com" + */ + email?: string; + /** The new hiring availability of the user. */ + hireable?: boolean; + /** + * The new location of the user. + * @example "Berlin, Germany" + */ + location?: string; + /** + * The new name of the user. + * @example "Omar Jahandar" + */ + name?: string; + /** + * The new Twitter username of the user. + * @example "therealomarj" + */ + twitter_username?: string | null; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -export class HttpClient { - public baseUrl: string = "https://api.giphy.com/v1"; - private securityData: SecurityDataType | null = null; - private securityWorker?: ApiConfig["securityWorker"]; - private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => - fetch(...fetchParams); + /** + * @description List the users you've blocked on your personal account. + * + * @tags users + * @name UsersListBlockedByAuthenticated + * @summary List users blocked by the authenticated user + * @request GET:/user/blocks + */ + usersListBlockedByAuthenticated: (params: RequestParams = {}) => + this.request< + SimpleUser[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/blocks\`, + method: "GET", + format: "json", + ...params, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; + /** + * No description + * + * @tags users + * @name UsersCheckBlocked + * @summary Check if a user is blocked by the authenticated user + * @request GET:/user/blocks/{username} + */ + usersCheckBlocked: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "GET", + ...params, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * No description + * + * @tags users + * @name UsersBlock + * @summary Block a user + * @request PUT:/user/blocks/{username} + */ + usersBlock: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "PUT", + ...params, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; - }; + /** + * No description + * + * @tags users + * @name UsersUnblock + * @summary Unblock a user + * @request DELETE:/user/blocks/{username} + */ + usersUnblock: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "DELETE", + ...params, + }), - protected encodeQueryParam(key: string, value: any) { - const encodedKey = encodeURIComponent(key); - return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; - } + /** + * @description Sets the visibility for your primary email addresses. + * + * @tags users + * @name UsersSetPrimaryEmailVisibilityForAuthenticated + * @summary Set primary email visibility for the authenticated user + * @request PATCH:/user/email/visibility + */ + usersSetPrimaryEmailVisibilityForAuthenticated: ( + data: { + /** + * An email address associated with the GitHub user account to manage. + * @example "org@example.com" + */ + email: string; + /** Denotes whether an email is publically visible. */ + visibility: "public" | "private"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/email/visibility\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); - } + /** + * @description Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the \`user:email\` scope. + * + * @tags users + * @name UsersListEmailsForAuthenticated + * @summary List email addresses for the authenticated user + * @request GET:/user/emails + */ + usersListEmailsForAuthenticated: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/emails\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); - } + /** + * @description This endpoint is accessible with the \`user\` scope. + * + * @tags users + * @name UsersAddEmailForAuthenticated + * @summary Add an email address for the authenticated user + * @request POST:/user/emails + */ + usersAddEmailForAuthenticated: ( + data: + | { + /** + * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an \`array\` of emails addresses directly, but we recommend that you pass an object using the \`emails\` key. + * @example [] + */ + emails: string[]; + } + | string[] + | string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/emails\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - 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("&"); - } + /** + * @description This endpoint is accessible with the \`user\` scope. + * + * @tags users + * @name UsersDeleteEmailForAuthenticated + * @summary Delete an email address for the authenticated user + * @request DELETE:/user/emails + */ + usersDeleteEmailForAuthenticated: ( + data: + | { + /** Email addresses associated with the GitHub user account. */ + emails: string[]; + } + | string[] + | string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/emails\`, + method: "DELETE", + body: data, + type: ContentType.Json, + ...params, + }), - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * @description Lists the people following the authenticated user. + * + * @tags users + * @name UsersListFollowersForAuthenticatedUser + * @summary List followers of the authenticated user + * @request GET:/user/followers + */ + usersListFollowersForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/followers\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * @description Lists the people who the authenticated user follows. + * + * @tags users + * @name UsersListFollowedByAuthenticated + * @summary List the people the authenticated user follows + * @request GET:/user/following + */ + usersListFollowedByAuthenticated: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/following\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - return 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), - }; + /** + * No description + * + * @tags users + * @name UsersCheckPersonIsFollowedByAuthenticated + * @summary Check if a person is followed by the authenticated user + * @request GET:/user/following/{username} + */ + usersCheckPersonIsFollowedByAuthenticated: ( + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/following/\${username}\`, + method: "GET", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * + * @tags users + * @name UsersFollow + * @summary Follow a user + * @request PUT:/user/following/{username} + */ + usersFollow: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/following/\${username}\`, + method: "PUT", + ...params, + }), - 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; - } + /** + * @description Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the \`user:follow\` scope. + * + * @tags users + * @name UsersUnfollow + * @summary Unfollow a user + * @request DELETE:/user/following/{username} + */ + usersUnfollow: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/following/\${username}\`, + method: "DELETE", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersListGpgKeysForAuthenticated + * @summary List GPG keys for the authenticated user + * @request GET:/user/gpg_keys + */ + usersListGpgKeysForAuthenticated: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersCreateGpgKeyForAuthenticated + * @summary Create a GPG key for the authenticated user + * @request POST:/user/gpg_keys + */ + usersCreateGpgKeyForAuthenticated: ( + data: { + /** A GPG key in ASCII-armored format. */ + armored_public_key: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersGetGpgKeyForAuthenticated + * @summary Get a GPG key for the authenticated user + * @request GET:/user/gpg_keys/{gpg_key_id} + */ + usersGetGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys/\${gpgKeyId}\`, + method: "GET", + format: "json", + ...params, + }), - 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; + /** + * @description Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:gpg_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersDeleteGpgKeyForAuthenticated + * @summary Delete a GPG key for the authenticated user + * @request DELETE:/user/gpg_keys/{gpg_key_id} + */ + usersDeleteGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys/\${gpgKeyId}\`, + method: "DELETE", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), + /** + * @description Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You can find the permissions for the installation under the \`permissions\` key. + * + * @tags apps + * @name AppsListInstallationsForAuthenticatedUser + * @summary List app installations accessible to the user access token + * @request GET:/user/installations + */ + appsListInstallationsForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request< + { + installations: Installation[]; + total_count: number; }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - body: - typeof body === "undefined" || body === null - ? null - : payloadFormatter(body), + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/installations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. The access the user has to each repository is included in the hash under the \`permissions\` key. + * + * @tags apps + * @name AppsListInstallationReposForAuthenticatedUser + * @summary List repositories accessible to the user access token + * @request GET:/user/installations/{installation_id}/repositories + */ + appsListInstallationReposForAuthenticatedUser: ( + installationId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, - ).then(async (response) => { - const r = response as HttpResponse; - r.data = null as unknown as T; - r.error = null as unknown as E; + params: RequestParams = {}, + ) => + this.request< + { + repositories: Repository[]; + repository_selection?: string; + total_count: number; + }, + BasicError + >({ + path: \`/user/installations/\${installationId}/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description Add a single repository to an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * + * @tags apps + * @name AppsAddRepoToInstallation + * @summary Add a repository to an app installation + * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + */ + appsAddRepoToInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "PUT", + ...params, + }), - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Remove a single repository from an installation. The authenticated user must have admin access to the repository. You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + * + * @tags apps + * @name AppsRemoveRepoFromInstallation + * @summary Remove a repository from an app installation + * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + */ + appsRemoveRepoFromInstallation: ( + installationId: number, + repositoryId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "DELETE", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response. + * + * @tags interactions + * @name InteractionsGetRestrictionsForAuthenticatedUser + * @summary Get interaction restrictions for your public repositories + * @request GET:/user/interaction-limits + */ + interactionsGetRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/interaction-limits\`, + method: "GET", + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * + * @tags interactions + * @name InteractionsSetRestrictionsForAuthenticatedUser + * @summary Set interaction restrictions for your public repositories + * @request PUT:/user/interaction-limits + */ + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), -/** - * @title Giphy - * @version 1.0 - * @termsOfService https://developers.giphy.com/ - * @baseUrl https://api.giphy.com/v1 - * @externalDocs https://developers.giphy.com/docs/ - * @contact - * - * Giphy API - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient { - gifs = { /** - * @description A multiget version of the get GIF by ID endpoint. + * @description Removes any interaction restrictions from your public repositories. * - * @tags gifs - * @name GetGifsById - * @summary Get GIFs by ID - * @request GET:/gifs - * @secure + * @tags interactions + * @name InteractionsRemoveRestrictionsForAuthenticatedUser + * @summary Remove interaction restrictions from your public repositories + * @request DELETE:/user/interaction-limits */ - getGifsById: ( + interactionsRemoveRestrictionsForAuthenticatedUser: ( + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/interaction-limits\`, + method: "DELETE", + ...params, + }), + + /** + * @description List issues across owned and member repositories assigned to the authenticated user. **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + * + * @tags issues + * @name IssuesListForAuthenticatedUser + * @summary List user account issues assigned to the authenticated user + * @request GET:/user/issues + */ + issuesListForAuthenticatedUser: ( query?: { - /** Filters results by specified GIF IDs, separated by commas. */ - ids?: string; + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Indicates which sorts of issues to return. Can be one of: + * \\* \`assigned\`: Issues assigned to you + * \\* \`created\`: Issues created by you + * \\* \`mentioned\`: Issues mentioning you + * \\* \`subscribed\`: Issues you're subscribed to updates for + * \\* \`all\`: All issues the authenticated user can see, regardless of participation or creation + * @default "assigned" + */ + filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; + /** A list of comma separated label names. Example: \`bug,ui,@high\` */ + labels?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ + sort?: "created" | "updated" | "comments"; + /** + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; - }, - any - >({ - path: \`/gifs\`, + this.request({ + path: \`/user/issues\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @description Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags gifs - * @name RandomGif - * @summary Random GIF - * @request GET:/gifs/random - * @secure + * @tags users + * @name UsersListPublicSshKeysForAuthenticated + * @summary List public SSH keys for the authenticated user + * @request GET:/user/keys */ - randomGif: ( + usersListPublicSshKeysForAuthenticated: ( query?: { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - }, - any - >({ - path: \`/gifs/random\`, + this.request({ + path: \`/user/keys\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Search all GIPHY GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. + * @description Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least \`write:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * @tags users + * @name UsersCreatePublicSshKeyForAuthenticated + * @summary Create a public SSH key for the authenticated user + * @request POST:/user/keys + */ + usersCreatePublicSshKeyForAuthenticated: ( + data: { + /** + * The public SSH key to add to your GitHub account. + * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) + */ + key: string; + /** + * A descriptive name for the new key. + * @example "Personal MacBook Air" + */ + title?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/keys\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least \`read:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags gifs - * @name SearchGifs - * @summary Search GIFs - * @request GET:/gifs/search - * @secure + * @tags users + * @name UsersGetPublicSshKeyForAuthenticated + * @summary Get a public SSH key for the authenticated user + * @request GET:/user/keys/{key_id} */ - searchGifs: ( - query: { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; - /** - * The maximum number of records to return. - * @format int32 - * @default 25 - */ - limit?: number; - /** - * An optional results offset. - * @format int32 - * @default 0 - */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; - }, + usersGetPublicSshKeyForAuthenticated: ( + keyId: number, params: RequestParams = {}, ) => - this.request< - { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; - }, - any - >({ - path: \`/gifs/search\`, + this.request({ + path: \`/user/keys/\${keyId}\`, method: "GET", - query: query, - secure: true, format: "json", ...params, }), /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIF + * @description Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least \`admin:public_key\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * @tags gifs - * @name TranslateGif - * @summary Translate phrase to GIF - * @request GET:/gifs/translate - * @secure + * @tags users + * @name UsersDeletePublicSshKeyForAuthenticated + * @summary Delete a public SSH key for the authenticated user + * @request DELETE:/user/keys/{key_id} */ - translateGif: ( - query: { - /** Search term. */ - s: string; - }, + usersDeletePublicSshKeyForAuthenticated: ( + keyId: number, params: RequestParams = {}, ) => - this.request< - { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - }, - any - >({ - path: \`/gifs/translate\`, - method: "GET", - query: query, - secure: true, - format: "json", + this.request({ + path: \`/user/keys/\${keyId}\`, + method: "DELETE", ...params, }), /** - * @description Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the GIPHY homepage. Returns 25 results by default. + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). * - * @tags gifs - * @name TrendingGifs - * @summary Trending GIFs - * @request GET:/gifs/trending - * @secure + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUser + * @summary List subscriptions for the authenticated user + * @request GET:/user/marketplace_purchases */ - trendingGifs: ( + appsListSubscriptionsForAuthenticatedUser: ( query?: { /** - * The maximum number of records to return. - * @format int32 - * @default 25 + * Page number of the results to fetch. + * @default 1 */ - limit?: number; + page?: number; /** - * An optional results offset. - * @format int32 - * @default 0 + * Results per page (max 100) + * @default 30 */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; + per_page?: number; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; - }, - any - >({ - path: \`/gifs/trending\`, + this.request({ + path: \`/user/marketplace_purchases\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Returns a GIF given that GIF's unique ID - * - * @tags gifs - * @name GetGifById - * @summary Get GIF by Id - * @request GET:/gifs/{gifId} - * @secure - */ - getGifById: (gifId: number, params: RequestParams = {}) => - this.request< - { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - }, - any - >({ - path: \`/gifs/\${gifId}\`, - method: "GET", - secure: true, - format: "json", - ...params, - }), - }; - stickers = { - /** - * @description Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. + * @description Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). * - * @tags stickers - * @name RandomSticker - * @summary Random Sticker - * @request GET:/stickers/random - * @secure + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUserStubbed + * @summary List subscriptions for the authenticated user (stubbed) + * @request GET:/user/marketplace_purchases/stubbed */ - randomSticker: ( + appsListSubscriptionsForAuthenticatedUserStubbed: ( query?: { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - }, - any - >({ - path: \`/stickers/random\`, + this.request({ + path: \`/user/marketplace_purchases/stubbed\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. + * No description * - * @tags stickers - * @name SearchStickers - * @summary Search Stickers - * @request GET:/stickers/search - * @secure + * @tags orgs + * @name OrgsListMembershipsForAuthenticatedUser + * @summary List organization memberships for the authenticated user + * @request GET:/user/memberships/orgs */ - searchStickers: ( - query: { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; + orgsListMembershipsForAuthenticatedUser: ( + query?: { /** - * The maximum number of records to return. - * @format int32 - * @default 25 + * Page number of the results to fetch. + * @default 1 */ - limit?: number; + page?: number; /** - * An optional results offset. - * @format int32 - * @default 0 + * Results per page (max 100) + * @default 30 */ - offset?: number; - /** Search query term or prhase. */ - q: string; - /** Filters results by specified rating. */ - rating?: string; + per_page?: number; + /** Indicates the state of the memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ + state?: "active" | "pending"; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; - }, - any - >({ - path: \`/stickers/search\`, + this.request({ + path: \`/user/memberships/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags orgs + * @name OrgsGetMembershipForAuthenticatedUser + * @summary Get an organization membership for the authenticated user + * @request GET:/user/memberships/orgs/{org} + */ + orgsGetMembershipForAuthenticatedUser: ( + org: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/memberships/orgs/\${org}\`, method: "GET", - query: query, - secure: true, format: "json", ...params, }), /** - * @description The translate API draws on search, but uses the GIPHY \`special sauce\` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. + * No description * - * @tags stickers - * @name TranslateSticker - * @summary Translate phrase to Sticker - * @request GET:/stickers/translate - * @secure + * @tags orgs + * @name OrgsUpdateMembershipForAuthenticatedUser + * @summary Update an organization membership for the authenticated user + * @request PATCH:/user/memberships/orgs/{org} */ - translateSticker: ( - query: { - /** Search term. */ - s: string; + orgsUpdateMembershipForAuthenticatedUser: ( + org: string, + data: { + /** The state that the membership should be in. Only \`"active"\` will be accepted. */ + state: "active"; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - }, - any - >({ - path: \`/stickers/translate\`, - method: "GET", - query: query, - secure: true, + this.request({ + path: \`/user/memberships/orgs/\${org}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Fetch Stickers currently trending online. Hand curated by the GIPHY editorial team. Returns 25 results by default. + * @description Lists all migrations a user has started. * - * @tags stickers - * @name TrendingStickers - * @summary Trending Stickers - * @request GET:/stickers/trending - * @secure + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations */ - trendingStickers: ( + migrationsListForAuthenticatedUser: ( query?: { /** - * The maximum number of records to return. - * @format int32 - * @default 25 + * Page number of the results to fetch. + * @default 1 */ - limit?: number; + page?: number; /** - * An optional results offset. - * @format int32 - * @default 0 + * Results per page (max 100) + * @default 30 */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; + per_page?: number; }, params: RequestParams = {}, ) => - this.request< - { - data?: Gif[]; - /** The Meta Object contains basic information regarding the request, whether it was successful, and the response given by the API. Check \`responses\` to see a description of types of response codes the API might give you under different cirumstances. */ - meta?: Meta; - /** The Pagination Object contains information relating to the number of total results available as well as the number of results fetched and their relative positions. */ - pagination?: Pagination; - }, - any - >({ - path: \`/stickers/trending\`, + this.request({ + path: \`/user/migrations\`, method: "GET", query: query, - secure: true, format: "json", - ...params, - }), - }; -} -" -`; - -exports[`simple > 'issue-1057' 1`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ - -export interface MySchema { - not_working?: "phone_number"; - working?: "email_address"; -} - -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< - FullRequestParams, - "body" | "method" | "query" | "path" ->; - -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", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} - -export class HttpClient { - public baseUrl: string = ""; - 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.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } - - return 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), - }; + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), + /** + * @description Initiates the generation of a user migration archive. + * + * @tags migrations + * @name MigrationsStartForAuthenticatedUser + * @summary Start a user migration + * @request POST:/user/migrations + */ + migrationsStartForAuthenticatedUser: ( + data: { + /** + * Exclude attributes from the API response to improve performance + * @example ["repositories"] + */ + exclude?: "repositories"[]; + /** + * Do not include attachments in the migration + * @example true + */ + exclude_attachments?: boolean; + /** + * Lock the repositories being migrated at the start of the migration + * @example true + */ + lock_repositories?: boolean; + repositories: string[]; }, - }; - } + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - 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; - } + /** + * @description Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values: * \`pending\` - the migration hasn't started yet. * \`exporting\` - the migration is in progress. * \`exported\` - the migration finished successfully. * \`failed\` - the migration failed. Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + * + * @tags migrations + * @name MigrationsGetStatusForAuthenticatedUser + * @summary Get a user migration status + * @request GET:/user/migrations/{migration_id} + */ + migrationsGetStatusForAuthenticatedUser: ( + migrationId: number, + query?: { + exclude?: string[]; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: * attachments * bases * commit\\_comments * issue\\_comments * issue\\_events * issues * milestones * organizations * projects * protected\\_branches * pull\\_request\\_reviews * pull\\_requests * releases * repositories * review\\_comments * schema * users The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data. + * + * @tags migrations + * @name MigrationsGetArchiveForAuthenticatedUser + * @summary Download a user migration archive + * @request GET:/user/migrations/{migration_id}/archive + */ + migrationsGetArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/archive\`, + method: "GET", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @description Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * + * @tags migrations + * @name MigrationsDeleteArchiveForAuthenticatedUser + * @summary Delete a user migration archive + * @request DELETE:/user/migrations/{migration_id}/archive + */ + migrationsDeleteArchiveForAuthenticatedUser: ( + migrationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/archive\`, + method: "DELETE", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked. + * + * @tags migrations + * @name MigrationsUnlockRepoForAuthenticatedUser + * @summary Unlock a user repository + * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + */ + migrationsUnlockRepoForAuthenticatedUser: ( + migrationId: number, + repoName: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, + method: "DELETE", + ...params, + }), - 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; + /** + * @description Lists all the repositories for this user migration. + * + * @tags migrations + * @name MigrationsListReposForUser + * @summary List repositories for a user migration + * @request GET:/user/migrations/{migration_id}/repositories + */ + migrationsListReposForUser: ( + migrationId: number, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}/repositories\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @description List organizations for the authenticated user. **OAuth scope requirements** This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope. OAuth requests with insufficient scope receive a \`403 Forbidden\` response. + * + * @tags orgs + * @name OrgsListForAuthenticatedUser + * @summary List organizations for the authenticated user + * @request GET:/user/orgs + */ + orgsListForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags projects + * @name ProjectsCreateForAuthenticatedUser + * @summary Create a user project + * @request POST:/user/projects + */ + projectsCreateForAuthenticatedUser: ( + data: { + /** + * Body of the project + * @example "This project represents the sprint of the first week in January" + */ + body?: string | null; + /** + * Name of the project + * @example "Week One Sprint" + */ + name: string; + }, + params: RequestParams = {}, + ) => + this.request< + Project, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/user/projects\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - body: - typeof body === "undefined" || body === null - ? null - : payloadFormatter(body), + /** + * @description Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the \`user:email\` scope. + * + * @tags users + * @name UsersListPublicEmailsForAuthenticated + * @summary List public email addresses for the authenticated user + * @request GET:/user/public_emails + */ + usersListPublicEmailsForAuthenticated: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, - ).then(async (response) => { - const r = response as HttpResponse; - r.data = null as unknown as T; - r.error = null as unknown as E; + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/public_emails\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access. The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * @tags repos + * @name ReposListForAuthenticatedUser + * @summary List repositories for the authenticated user + * @request GET:/user/repos + */ + reposListForAuthenticatedUser: ( + query?: { + /** + * Comma-separated list of values. Can include: + * \\* \`owner\`: Repositories that are owned by the authenticated user. + * \\* \`collaborator\`: Repositories that the user has been added to as a collaborator. + * \\* \`organization_member\`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + * @default "owner,collaborator,organization_member" + */ + affiliation?: string; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + before?: string; + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** + * Can be one of \`all\`, \`owner\`, \`public\`, \`private\`, \`member\`. Default: \`all\` + * + * Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. Will cause a \`422\` error if used in the same request as **visibility** or **affiliation**. + * @default "all" + */ + type?: "all" | "owner" | "public" | "private" | "member"; + /** + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" + */ + visibility?: "all" | "public" | "private"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repos\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description Creates a new repository for the authenticated user. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * \`public_repo\` scope or \`repo\` scope to create a public repository * \`repo\` scope to create a private repository + * + * @tags repos + * @name ReposCreateForAuthenticatedUser + * @summary Create a repository for the authenticated user + * @request POST:/user/repos + */ + reposCreateForAuthenticatedUser: ( + data: { + /** + * Whether to allow merge commits for pull requests. + * @default true + * @example true + */ + allow_merge_commit?: boolean; + /** + * Whether to allow rebase merges for pull requests. + * @default true + * @example true + */ + allow_rebase_merge?: boolean; + /** + * Whether to allow squash merges for pull requests. + * @default true + * @example true + */ + allow_squash_merge?: boolean; + /** + * Whether the repository is initialized with a minimal README. + * @default false + */ + auto_init?: boolean; + /** + * Whether to delete head branches when pull requests are merged + * @default false + * @example false + */ + delete_branch_on_merge?: boolean; + /** A short description of the repository. */ + description?: string; + /** + * The desired language or platform to apply to the .gitignore. + * @example "Haskell" + */ + gitignore_template?: string; + /** + * Whether downloads are enabled. + * @default true + * @example true + */ + has_downloads?: boolean; + /** + * Whether issues are enabled. + * @default true + * @example true + */ + has_issues?: boolean; + /** + * Whether projects are enabled. + * @default true + * @example true + */ + has_projects?: boolean; + /** + * Whether the wiki is enabled. + * @default true + * @example true + */ + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true + */ + is_template?: boolean; + /** + * The license keyword of the open source license for this repository. + * @example "mit" + */ + license_template?: string; + /** + * The name of the repository. + * @example "Team Environment" + */ + name: string; + /** + * Whether the repository is private or public. + * @default false + */ + private?: boolean; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repos\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that user. + * + * @tags repos + * @name ReposListInvitationsForAuthenticatedUser + * @summary List repository invitations for the authenticated user + * @request GET:/user/repository_invitations + */ + reposListInvitationsForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repository_invitations\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -/** - * @title No title - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient {} -" -`; + /** + * No description + * + * @tags repos + * @name ReposAcceptInvitation + * @summary Accept a repository invitation + * @request PATCH:/user/repository_invitations/{invitation_id} + */ + reposAcceptInvitation: (invitationId: number, params: RequestParams = {}) => + this.request({ + path: \`/user/repository_invitations/\${invitationId}\`, + method: "PATCH", + ...params, + }), -exports[`simple > 'issue-1057' 2`] = ` -"/* eslint-disable */ -/* tslint:disable */ -// @ts-nocheck -/* - * --------------------------------------------------------------- - * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## - * ## ## - * ## AUTHOR: acacode ## - * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## - * --------------------------------------------------------------- - */ + /** + * No description + * + * @tags repos + * @name ReposDeclineInvitation + * @summary Decline a repository invitation + * @request DELETE:/user/repository_invitations/{invitation_id} + */ + reposDeclineInvitation: ( + invitationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/repository_invitations/\${invitationId}\`, + method: "DELETE", + ...params, + }), -export interface MySchema { - not_working?: "phone_number"; - working?: "email_address"; -} + /** + * @description Lists repositories the authenticated user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * + * @tags activity + * @name ActivityListReposStarredByAuthenticatedUser + * @summary List repositories starred by the authenticated user + * @request GET:/user/starred + */ + activityListReposStarredByAuthenticatedUser: ( + query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * No description + * + * @tags activity + * @name ActivityCheckRepoIsStarredByAuthenticatedUser + * @summary Check if a repository is starred by the authenticated user + * @request GET:/user/starred/{owner}/{repo} + */ + activityCheckRepoIsStarredByAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + method: "GET", + ...params, + }), -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; -} + /** + * @description Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * @tags activity + * @name ActivityStarRepoForAuthenticatedUser + * @summary Star a repository for the authenticated user + * @request PUT:/user/starred/{owner}/{repo} + */ + activityStarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + method: "PUT", + ...params, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * No description + * + * @tags activity + * @name ActivityUnstarRepoForAuthenticatedUser + * @summary Unstar a repository for the authenticated user + * @request DELETE:/user/starred/{owner}/{repo} + */ + activityUnstarRepoForAuthenticatedUser: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + method: "DELETE", + ...params, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * @description Lists repositories the authenticated user is watching. + * + * @tags activity + * @name ActivityListWatchedReposForAuthenticatedUser + * @summary List repositories watched by the authenticated user + * @request GET:/user/subscriptions + */ + activityListWatchedReposForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/subscriptions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * @description List all of the teams across all of the organizations to which the authenticated user belongs. This method requires \`user\`, \`repo\`, or \`read:org\` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). + * + * @tags teams + * @name TeamsListForAuthenticatedUser + * @summary List teams for the authenticated user + * @request GET:/user/teams + */ + teamsListForAuthenticatedUser: ( + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/teams\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + users = { + /** + * @description Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + * + * @tags users + * @name UsersList + * @summary List users + * @request GET:/users + */ + usersList: ( + query?: { + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -type CancelToken = Symbol | string | number; + /** + * @description Provides publicly available information about someone with a GitHub account. GitHub Apps with the \`Plan\` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + * + * @tags users + * @name UsersGetByUsername + * @summary Get a user + * @request GET:/users/{username} + */ + usersGetByUsername: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/users/\${username}\`, + method: "GET", + format: "json", + ...params, + }), -export enum ContentType { - Json = "application/json", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} + /** + * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * + * @tags activity + * @name ActivityListEventsForAuthenticatedUser + * @summary List events for the authenticated user + * @request GET:/users/{username}/events + */ + activityListEventsForAuthenticatedUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events\`, + method: "GET", + query: query, + format: "json", + ...params, + }), -export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType | null = null; - private securityWorker?: ApiConfig["securityWorker"]; - private abortControllers = new Map(); - private customFetch = (...fetchParams: Parameters) => - fetch(...fetchParams); + /** + * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * + * @tags activity + * @name ActivityListOrgEventsForAuthenticatedUser + * @summary List organization events for the authenticated user + * @request GET:/users/{username}/events/orgs/{org} + */ + activityListOrgEventsForAuthenticatedUser: ( + username: string, + org: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events/orgs/\${org}\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; + /** + * No description + * + * @tags activity + * @name ActivityListPublicEventsForUser + * @summary List public events for a user + * @request GET:/users/{username}/events/public + */ + activityListPublicEventsForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/events/public\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * @description Lists the people following the specified user. + * + * @tags users + * @name UsersListFollowersForUser + * @summary List followers of a user + * @request GET:/users/{username}/followers + */ + usersListFollowersForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/followers\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; - }; + /** + * @description Lists the people who the specified user follows. + * + * @tags users + * @name UsersListFollowingForUser + * @summary List the people a user follows + * @request GET:/users/{username}/following + */ + usersListFollowingForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/following\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected encodeQueryParam(key: string, value: any) { - const encodedKey = encodeURIComponent(key); - return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; - } + /** + * No description + * + * @tags users + * @name UsersCheckFollowingForUser + * @summary Check if a user follows another user + * @request GET:/users/{username}/following/{target_user} + */ + usersCheckFollowingForUser: ( + username: string, + targetUser: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/following/\${targetUser}\`, + method: "GET", + ...params, + }), - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); - } + /** + * @description Lists public gists for the specified user: + * + * @tags gists + * @name GistsListForUser + * @summary List gists for a user + * @request GET:/users/{username}/gists + */ + gistsListForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: \`YYYY-MM-DDTHH:MM:SSZ\`. */ + since?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/gists\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); - } + /** + * @description Lists the GPG keys for a user. This information is accessible by anyone. + * + * @tags users + * @name UsersListGpgKeysForUser + * @summary List GPG keys for a user + * @request GET:/users/{username}/gpg_keys + */ + usersListGpgKeysForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/gpg_keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - 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("&"); - } + /** + * @description Provides hovercard information when authenticated through basic auth or OAuth with the \`repo\` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository via cURL, it would look like this: \`\`\`shell curl -u username:token https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 \`\`\` + * + * @tags users + * @name UsersGetContextForUser + * @summary Get contextual information for a user + * @request GET:/users/{username}/hovercard + */ + usersGetContextForUser: ( + username: string, + query?: { + /** Uses the ID for the \`subject_type\` you specified. **Required** when using \`subject_type\`. */ + subject_id?: string; + /** Identifies which additional information you'd like to receive about the person's hovercard. Can be \`organization\`, \`repository\`, \`issue\`, \`pull_request\`. **Required** when using \`subject_id\`. */ + subject_type?: "organization" | "repository" | "issue" | "pull_request"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/hovercard\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * @description Enables an authenticated GitHub App to find the user’s installation information. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * @tags apps + * @name AppsGetUserInstallation + * @summary Get a user installation for the authenticated app + * @request GET:/users/{username}/installation + */ + appsGetUserInstallation: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/users/\${username}/installation\`, + method: "GET", + format: "json", + ...params, + }), - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.JsonApi]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") - ? JSON.stringify(input) - : input, - [ContentType.Text]: (input: any) => - input !== null && typeof input !== "string" - ? JSON.stringify(input) - : input, - [ContentType.FormData]: (input: any) => { - if (input instanceof FormData) { - return input; - } + /** + * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * + * @tags users + * @name UsersListPublicKeysForUser + * @summary List public keys for a user + * @request GET:/users/{username}/keys + */ + usersListPublicKeysForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/keys\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - return 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), - }; + /** + * @description List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + * + * @tags orgs + * @name OrgsListForUser + * @summary List organizations for a user + * @request GET:/users/{username}/orgs + */ + orgsListForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), + /** + * No description + * + * @tags projects + * @name ProjectsListForUser + * @summary List user projects + * @request GET:/users/{username}/projects + */ + projectsListForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ + state?: "open" | "closed" | "all"; }, - }; - } - - 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; - } + params: RequestParams = {}, + ) => + this.request< + Project[], + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/users/\${username}/projects\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @description These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. + * + * @tags activity + * @name ActivityListReceivedEventsForUser + * @summary List events received by the authenticated user + * @request GET:/users/{username}/received_events + */ + activityListReceivedEventsForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/received_events\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * No description + * + * @tags activity + * @name ActivityListReceivedPublicEventsForUser + * @summary List public events received by a user + * @request GET:/users/{username}/received_events/public + */ + activityListReceivedPublicEventsForUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/received_events/public\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Lists public repositories for the specified user. + * + * @tags repos + * @name ReposListForUser + * @summary List repositories for a user + * @request GET:/users/{username}/repos + */ + reposListForUser: ( + username: string, + query?: { + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ + type?: "all" | "owner" | "member"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/repos\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - 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; + /** + * @description Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetGithubActionsBillingUser + * @summary Get GitHub Actions billing for a user + * @request GET:/users/{username}/settings/billing/actions + */ + billingGetGithubActionsBillingUser: ( + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/actions\`, + method: "GET", + format: "json", + ...params, + }), - return this.customFetch( - \`\${baseUrl || this.baseUrl || ""}\${path}\${queryString ? \`?\${queryString}\` : ""}\`, - { - ...requestParams, - headers: { - ...(requestParams.headers || {}), - ...(type && type !== ContentType.FormData - ? { "Content-Type": type } - : {}), - }, - signal: - (cancelToken - ? this.createAbortSignal(cancelToken) - : requestParams.signal) || null, - 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; + /** + * @description Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetGithubPackagesBillingUser + * @summary Get GitHub Packages billing for a user + * @request GET:/users/{username}/settings/billing/packages + */ + billingGetGithubPackagesBillingUser: ( + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/packages\`, + method: "GET", + format: "json", + ...params, + }), - const responseToParse = responseFormat ? response.clone() : response; - const data = !responseFormat - ? r - : await responseToParse[responseFormat]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); + /** + * @description Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the \`user\` scope. + * + * @tags billing + * @name BillingGetSharedStorageBillingUser + * @summary Get shared storage billing for a user + * @request GET:/users/{username}/settings/billing/shared-storage + */ + billingGetSharedStorageBillingUser: ( + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/shared-storage\`, + method: "GET", + format: "json", + ...params, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @description Lists repositories a user has starred. You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the \`Accept\` header: + * + * @tags activity + * @name ActivityListReposStarredByUser + * @summary List repositories starred by a user + * @request GET:/users/{username}/starred + */ + activityListReposStarredByUser: ( + username: string, + query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ + sort?: "created" | "updated"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/starred\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); + /** + * @description Lists repositories a user is watching. + * + * @tags activity + * @name ActivityListReposWatchedByUser + * @summary List repositories watched by a user + * @request GET:/users/{username}/subscriptions + */ + activityListReposWatchedByUser: ( + username: string, + query?: { + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/subscriptions\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + }; + zen = { + /** + * @description Get a random sentence from the Zen of GitHub + * + * @tags meta + * @name MetaGetZen + * @summary Get the Zen of GitHub + * @request GET:/zen + */ + metaGetZen: (params: RequestParams = {}) => + this.request({ + path: \`/zen\`, + method: "GET", + ...params, + }), }; } - -/** - * @title No title - */ -export class Api< - SecurityDataType extends unknown, -> extends HttpClient {} " `; -exports[`simple > 'link-example' 1`] = ` +exports[`simple > 'issue-1057' 2`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck @@ -40150,21 +39586,9 @@ exports[`simple > 'link-example' 1`] = ` * --------------------------------------------------------------- */ -export interface Pullrequest { - author?: User; - id?: number; - repository?: Repository; - title?: string; -} - -export interface Repository { - owner?: User; - slug?: string; -} - -export interface User { - username?: string; - uuid?: string; +export interface MySchema { + not_working?: "phone_number"; + working?: "email_address"; } export type QueryParamsType = Record; @@ -40423,127 +39847,15 @@ export class HttpClient { } /** - * @title Link Example - * @version 1.0.0 + * @title No title */ export class Api< SecurityDataType extends unknown, -> extends HttpClient { - v20 = { - /** - * No description - * - * @name GetUserByName - * @request GET:/2.0/users/{username} - * @link \`200.userRepositories\` operationId:getRepositoriesByOwner - */ - getUserByName: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/2.0/users/\${username}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @name GetRepositoriesByOwner - * @request GET:/2.0/repositories/{username} - * @link \`200.userRepository\` operationId:getRepository - */ - getRepositoriesByOwner: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/2.0/repositories/\${username}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @name GetRepository - * @request GET:/2.0/repositories/{username}/{slug} - * @link \`200.repositoryPullRequests\` operationId:getPullRequestsByRepository - */ - getRepository: ( - username: string, - slug: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @name GetPullRequestsByRepository - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests - */ - getPullRequestsByRepository: ( - username: string, - slug: string, - query?: { - state?: "open" | "merged" | "declined"; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * No description - * - * @name GetPullRequestsById - * @request GET:/2.0/repositories/{username}/{slug}/pullrequests/{pid} - * @link \`200.pullRequestMerge\` operationId:mergePullRequest - */ - getPullRequestsById: ( - username: string, - slug: string, - pid: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}\`, - method: "GET", - format: "json", - ...params, - }), - - /** - * No description - * - * @name MergePullRequest - * @request POST:/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge - */ - mergePullRequest: ( - username: string, - slug: string, - pid: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/2.0/repositories/\${username}/\${slug}/pullrequests/\${pid}/merge\`, - method: "POST", - ...params, - }), - }; -} +> extends HttpClient {} " `; -exports[`simple > 'link-example' 2`] = ` +exports[`simple > 'link-example' 1`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck